Exemplo n.º 1
0
 def testTimeout(self):
   """HOD should raise Exception when rpc call times out"""
   # Give client some random nonexistent url
   serverPort = ServiceUtil.getUniqRandomPort(h='localhost',low=40000,high=50000)
   client = hodXRClient('http://localhost:' + str(serverPort), retryRequests=False)
   self.assertRaises(Exception, client.testing)
   pass
Exemplo n.º 2
0
 def testTimeout(self):
     """HOD should raise Exception when rpc call times out"""
     # Give client some random nonexistent url
     serverPort = ServiceUtil.getUniqRandomPort(h='localhost',
                                                low=40000,
                                                high=50000)
     client = hodXRClient('http://localhost:' + str(serverPort),
                          retryRequests=False)
     self.assertRaises(Exception, client.testing)
     pass
Exemplo n.º 3
0
  def testInterrupt(self):
    """ HOD should raise HodInterruptException when interrupted"""

    def interrupt(testClass):
      testClass.assertRaises(HodInterruptException, client.testing)
      
    serverPort = ServiceUtil.getUniqRandomPort(h='localhost',low=40000,high=50000)
    client = hodXRClient('http://localhost:' + str(serverPort))
    myThread = threading.Thread(name='testinterrupt', target=interrupt,args=(self,))
    # Set the global interrupt
    hodInterrupt.setFlag()
    myThread.start()
    myThread.join()
    pass
Exemplo n.º 4
0
  def __init__(self):
    # suite setup
    BaseTestSuite.__init__(self, __name__, excludes)

    def rpcCall():
      return True
    
    global serverPort
    serverPort = ServiceUtil.getUniqRandomPort(h='localhost',low=40000,high=50000)
    self.server = hodXMLRPCServer('localhost', [serverPort])
    self.server.register_function(rpcCall, 'testing')
    self.thread = threading.Thread(name="server", 
                                   target=self.server._serve_forever)
    self.thread.start()
    time.sleep(1) # give some time to start server
Exemplo n.º 5
0
    def __init__(self):
        # suite setup
        BaseTestSuite.__init__(self, __name__, excludes)

        def rpcCall():
            return True

        global serverPort
        serverPort = ServiceUtil.getUniqRandomPort(h='localhost',
                                                   low=40000,
                                                   high=50000)
        self.server = hodXMLRPCServer('localhost', [serverPort])
        self.server.register_function(rpcCall, 'testing')
        self.thread = threading.Thread(name="server",
                                       target=self.server._serve_forever)
        self.thread.start()
        time.sleep(1)  # give some time to start server
Exemplo n.º 6
0
    def testInterrupt(self):
        """ HOD should raise HodInterruptException when interrupted"""
        def interrupt(testClass):
            testClass.assertRaises(HodInterruptException, client.testing)

        serverPort = ServiceUtil.getUniqRandomPort(h='localhost',
                                                   low=40000,
                                                   high=50000)
        client = hodXRClient('http://localhost:' + str(serverPort))
        myThread = threading.Thread(name='testinterrupt',
                                    target=interrupt,
                                    args=(self, ))
        # Set the global interrupt
        hodInterrupt.setFlag()
        myThread.start()
        myThread.join()
        pass