/[storm]/storm/org/nongnu/storm/http/client/testSimpleHTTPClient.test
ViewVC logotype

Diff of /storm/org/nongnu/storm/http/client/testSimpleHTTPClient.test

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by hemppah, Mon Apr 28 13:21:39 2003 UTC revision 1.7 by hemppah, Mon Apr 28 13:44:08 2003 UTC
# Line 34  host2 = "io.it.jyu.fi" Line 34  host2 = "io.it.jyu.fi"
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"
# Line 64  def testHTTPClient(): Line 62  def testHTTPClient():
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..."  

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26