34 |
host3 = "kanetti1390.kanetti.com" |
host3 = "kanetti1390.kanetti.com" |
35 |
|
|
36 |
port = 5555 |
port = 5555 |
|
request = "rewrite/urn:x-storm:1.0:text/plain,\ |
|
|
dvi7nrvd36pnprsmg4x55klqnqzvfgkc.f2aagxw4lfv7smbyzpm5tpf6ypajrdvh6ndqfky" |
|
37 |
|
|
38 |
protocol1 = "HTTP/1.1" |
protocol1 = "HTTP/1.1" |
39 |
protocol2 = "HTTP/1.0" |
protocol2 = "HTTP/1.0" |
62 |
print "HTTP proxy thread started..." |
print "HTTP proxy thread started..." |
63 |
|
|
64 |
|
|
65 |
#Create HTTP connection to localhost |
# Perform GET requests using the ID of created block |
66 |
httpconn = org.nongnu.storm.http.client.HTTPConnection(host0, port) |
print "Perform GET request(s)..." |
67 |
|
getlist = ["///rewrite/" + blockid, blockid, "foo" + blockid, "rewrite/" + blockid] |
|
|
|
|
# Perform GET request using the ID of created block |
|
|
print "Perform GET request(s)..." |
|
|
req = httpconn.newRequest("GET", "rewrite/" + blockid, protocol2, java.lang.Boolean.FALSE) |
|
|
# Add more requests here... |
|
68 |
|
|
69 |
|
for reqs in getlist: |
70 |
resp = httpconn.send(req) |
#Create HTTP connection to localhost |
71 |
print resp.status, resp.reason |
httpconn = org.nongnu.storm.http.client.HTTPConnection(host0, port) |
72 |
|
req = httpconn.newRequest("GET", reqs, protocol2, java.lang.Boolean.FALSE) |
73 |
# Conditions here... |
resp = httpconn.send(req) |
74 |
assert resp.status == 200 |
print resp.status, resp.reason |
75 |
|
# Conditions here... |
76 |
|
# assert resp.status == 200 |
77 |
|
|
78 |
httpconn.close |
httpconn.close |
79 |
|
|
80 |
if serverthread.isAlive() == 1: |
if serverthread.isAlive() == 1: |
81 |
print serverthread.isAlive() |
serverthread.interrupt() |
82 |
serverthread.interrupt() |
print "HTTP proxy thread stopped..." |
|
print "HTTP proxy thread stopped..." |
|