Ticket #171: franktest.py

File franktest.py, 1.4 kB (added by fcohen, 8 months ago)

Unit test script that takes more than 5 seconds to process

Line 
1 '''
2 Agent name: Untitled
3 Created on:
4 Created by:
5
6 Note: This is a skeleton of a PushToTest(tm) TestMaker unit test
7 Use this as a starting-point to build your unit test. Then run
8 this test in a TestScenario as a load test, service monitor, and
9 functional test.
10
11 For details on PushToTest TestMaker see http://www.pushtotest.com
12 '''
13
14 from junit.framework import TestCase
15 import sys, re, time
16 from java.lang import Exception
17 from com.pushtotest.tool.protocolhandler import ProtocolHandler
18
19 class franktest:
20
21     def __init__( self ):
22         ''' Initialize the test case '''
23         self.http = ProtocolHandler.getProtocol("http")
24        
25     def setUp( self ):
26         ''' Add any needed set-up code here. '''
27         pass
28        
29     def runTest( self ):
30         ''' Run the test '''
31
32         self.url = "http://examples.pushtotest.com/responder/htmlresponder?sleeptime=5000"
33         self.old_url = "http://examples.pushtotest.com"
34        
35         self.http.setUrl( self.url )
36
37         self.response = self.http.connect()
38        
39         print "ding"
40
41         self.http.setUrl("http://examples.pushtotest.com")
42         self.response = self.http.connect()
43        
44         print "ding"
45        
46        
47     def tearDown( self ):
48         ''' Add any needed code to end the test here. '''
49         pass
50    
51 def getfranktest():
52     test = franktest()
53     return test
54
55 '''
56 test=franktest()
57 test.runTest()
58 print "done"
59 '''