HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
ftests.ftest_AdminProcessorDataHandler Namespace Reference

Classes

class  TestAdminProcessorDataHandler
 

Functions

def testAdminProcessorDataHandler (self)
 Test method, creates request with 2 nodes and 4 commands So really we have 8 requests/responses. More...
 

Detailed Description

Created on Mar 10, 2014

@author: scorp

Function Documentation

◆ testAdminProcessorDataHandler()

def ftests.ftest_AdminProcessorDataHandler.testAdminProcessorDataHandler (   self)

Test method, creates request with 2 nodes and 4 commands So really we have 8 requests/responses.

Definition at line 29 of file ftest_AdminProcessorDataHandler.py.

30  nodes = [Node(F_CONSTANTS.TEST_LOCAL_HOST, 1120), Node(F_CONSTANTS.TEST_LOCAL_HOST, 2120)]
31  commands = []
32  params = ["param1", "param2"]
33 # Last param (10 value) is Command timeout, if it not specified, that we use timeout from Node
34  command = Command("PROPERTIES", params, ADMIN_HANDLERS.DATA_PROCESSOR_DATA)
35  commands.append(command)
36  command = Command("ECHO", params, ADMIN_HANDLERS.ADMIN)
37  commands.append(command)
38  command = Command("DRCE", params, ADMIN_HANDLERS.DATA_PROCESSOR_DATA)
39  commands.append(command)
40  command = Command("BAD_COMMAND", params, ADMIN_HANDLERS.ADMIN)
41  commands.append(command)
42 
43 # with self.assertRaises(AdminExceptions.AdminTimeoutException):
44 # list(self.nodeManager.execute(commands, nodes))
45 
46  nodes = [Node(F_CONSTANTS.TEST_REAL_HOST), Node(F_CONSTANTS.TEST_REAL_HOST, 5530, 20)]
47  self.nodeManager.execute(commands, nodes)
48  print("Responses count = " + str(len(self.nodeManager.getResponses())))
49  print("Responses Dict count = " + str(len(self.nodeManager.getResponsesDicts())))
50  for response in self.nodeManager.getResponses():
51  print(response[CONSTANTS.STRING_RESPONSE_MARKER].getBody())
52 
53  if len(self.nodeManager.getResponsesDicts()) >=5 and self.nodeManager.getResponsesDicts()[4] != None:
54  localDict = self.nodeManager.getResponsesDicts()[4]
55  print(localDict[CONSTANTS.RESPONSE_FIELDS_NAME])
56  if localDict[CONSTANTS.RESPONSE_CODE_NAME] == "OK":
57  print("fields count = " + str(len(localDict[CONSTANTS.RESPONSE_FIELDS_NAME])))
58  print("\"name\" field value = " + localDict[CONSTANTS.RESPONSE_FIELDS_NAME]["name"])
59  sleep(1)
60  '''
61  try:
62  raise AdminExceptions.AdminTimeoutException("WWWWWW")
63  except Exception, e:
64  print(e.__doc__ + ":")
65  '''
66 
def execute(self, commands, nodes)
execute method execute incoming commands on nodes, keepts reult in responses and responsesDicts field...
Definition: NodeManager.py:63
def testAdminProcessorDataHandler(self)
Test method, creates request with 2 nodes and 4 commands So really we have 8 requests/responses.