|
TestCenter Reference
|
The superclass for the different test case categories. More...
Public Member Functions | |
| __init__ (self, testCaseName, isNewlyCreated=False) | |
| Initialize the test case. | |
| __del__ (self) | |
| destroyContext (self) | |
| activate (self) | |
| Registers the test case at the TestHelper. | |
| deactivate (self) | |
| Resets the test helper. | |
| setTestCaseListener (self, testCaseListener) | |
| addExtraTestCaseResult (self, extraTestCaseResult) | |
| callFieldValueTestCase (self, filename, testcase) | |
| Call the given field-value test case from the given field-value test case set. | |
| isValid (self) | |
| Return True if the loaded test case is syntactically valid and should be executable. | |
| hasNetwork (self) | |
| Return True if the test case has a network attached. | |
| networkFileName (self) | |
| Returns the absolute file name of the attached network or an empty string if no network is attached. | |
| openFiles (self) | |
| Open the files associated with the test case. | |
| openNetwork (self) | |
| Open the internal network of the test case. | |
| getType (self) | |
| Return the type of this test case (generic or functional). | |
| getModule (self) | |
| Return the module representing this test case, or None. | |
| getName (self) | |
| Return the name of the test case. | |
| getListOfTestFuncs (self) | |
| Get the list of test functions in this test. | |
| getPackage (self) | |
| Return the identifier of the package the test case is in. | |
| getTestCaseNode (self) | |
| Return the XML node with the test case's information. | |
| run (self, etree.Element resultNode) | |
| Run the test case and store results in the given xml data structure. | |
| getDocumentation (self, functionName) | |
| Get the documentation for the given test function. | |
Public Attributes | |
| futureDone | |
| callFieldValueTestCase | |
Protected Member Functions | |
| _getTestCaseInfo (self, testCaseName) | |
| _getTestFunction (self, funcName) | |
| _loadScriptFile (self, filename) | |
| Load the test cases script file. | |
| _callGroupFunction (self, groupFunctionName) | |
| _callableFunctions (self) | |
| _buildVirtualFunctions (self, isNewlyCreated) | |
| Build an XML node with the virtual functions. | |
Protected Attributes | |
| _ctx | |
| _testCaseName | |
| _testHelper | |
| _dataDirectory | |
The superclass for the different test case categories.
Definition at line 171 of file TestCase.py.
| TestCenterAdvanced.TestCase.TestCase.__init__ | ( | self, | |
| testCaseName, | |||
isNewlyCreated = False |
|||
| ) |
Initialize the test case.
| testCaseName | The name of the test case. |
| isNewlyCreated | Indicates if the test case is newly created to suppress the warning that no test functions exist. |
Reimplemented in TestCenterAdvanced.TestCaseGeneric.GenericTestCase.
Definition at line 174 of file TestCase.py.
| TestCenterAdvanced.TestCase.TestCase.__del__ | ( | self | ) |
Definition at line 316 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.destroyContext().
|
protected |
Build an XML node with the virtual functions.
The result is an XML node that contains information on all virtual functions including the information on hierarchy i.e. which nodes are aggregated in a group. Returns a Boolean value stating success.
Definition at line 831 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__createFieldValueTestNode(), TestCenterAdvanced.TestCase.TestCase.__createIterativeTestNode(), TestCenterAdvanced.TestCase.TestCase.__createNormalTestNode(), TestCenterAdvanced.TestCase.TestCase.__createTestGroupNode(), TestCenterAdvanced.TestCase.TestCase.__createUnitTestWrapperNode(), TestCenterAdvanced.TestCase.TestCase.__functionDict, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot, TestCenterAdvanced.TestCase.TestCase._callableFunctions(), TestCenterAdvanced.TestCase.TestCase._ctx, and TestCenterAdvanced.TestCase.TestCase.getDocumentation().
|
protected |
Definition at line 828 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx.
Referenced by TestCenterAdvanced.TestCase.TestCase._buildVirtualFunctions().
|
protected |
Definition at line 481 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__functionDict, TestCenterAdvanced.TestCase.TestCase.__getFunctionInfo(), TestCenterAdvanced.TestCase.TestCase._callGroupFunction(), TestCenterAdvanced.TestCase.TestCase._ctx, TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, TestCenterAdvanced.TestCase.TestCase._testHelper, and TestCenterAdvanced.TestCase.TestCase.getDocumentation().
Referenced by TestCenterAdvanced.TestCase.TestCase._callGroupFunction().
|
protected |
Definition at line 313 of file TestCase.py.
|
protected |
Definition at line 359 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__functionDict, TestCenterAdvanced.TestCase.TestCase._ctx, TestCenterAdvanced.TestCase.TestCase._getTestFunction(), TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, and TestCenterAdvanced.TestCase.TestCase._testHelper.
Referenced by TestCenterAdvanced.TestCase.TestCase._getTestFunction().
|
protected |
Load the test cases script file.
| filename | Name of the script file to be loaded. |
Definition at line 434 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx, TestCenterAdvanced.TestCase.TestCase._testCaseName, TestCenterAdvanced.TestCaseGeneric.GenericTestCase._testCaseName, TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, and TestCenterAdvanced.TestCase.TestCase._testHelper.
| TestCenterAdvanced.TestCase.TestCase.activate | ( | self | ) |
Registers the test case at the TestHelper.
Does not support recursive calls.
Definition at line 326 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx, TestCenterAdvanced.TestCase.TestCase._dataDirectory, TestCenterAdvanced.TestCase.TestCase._testCaseName, TestCenterAdvanced.TestCaseGeneric.GenericTestCase._testCaseName, TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, and TestCenterAdvanced.TestCase.TestCase._testHelper.
Referenced by TestCenterAdvanced.TestCase.TestCase.run().
| TestCenterAdvanced.TestCase.TestCase.addExtraTestCaseResult | ( | self, | |
| extraTestCaseResult | |||
| ) |
Definition at line 352 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__currentResultNode, TestCenterAdvanced.TestCase.TestCase.__extraTestCasesResults, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot.
Referenced by TestCenterAdvanced.TestCase.TestCase.run().
| TestCenterAdvanced.TestCase.TestCase.callFieldValueTestCase | ( | self, | |
| filename, | |||
| testcase | |||
| ) |
Call the given field-value test case from the given field-value test case set.
This method is required as the FIELDVALUETEST test methods don't have a valid counterpart in the script file itself.
| filename | The field-value test case set. |
| testcase | The test case to be executed. |
Definition at line 445 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__getFunctionInfo(), and TestCenterAdvanced.TestCase.TestCase._ctx.
| TestCenterAdvanced.TestCase.TestCase.deactivate | ( | self | ) |
Resets the test helper.
Does not support recursive calls.
Definition at line 338 of file TestCase.py.
References TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, and TestCenterAdvanced.TestCase.TestCase._testHelper.
Referenced by TestCenterAdvanced.TestCase.TestCase.run().
| TestCenterAdvanced.TestCase.TestCase.destroyContext | ( | self | ) |
Definition at line 319 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx.
Referenced by TestCenterAdvanced.TestCase.TestCase.__del__(), and TestCenterAdvanced.TestCase.TestCase.getTestCaseNode().
| TestCenterAdvanced.TestCase.TestCase.getDocumentation | ( | self, | |
| functionName | |||
| ) |
Get the documentation for the given test function.
The found string will be modified such that all trailing whitespace will be removed.
| functionName | The function to gather documentation for. |
Definition at line 1196 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx.
Referenced by TestCenterAdvanced.TestCase.TestCase._buildVirtualFunctions(), and TestCenterAdvanced.TestCase.TestCase._callGroupFunction().
| TestCenterAdvanced.TestCase.TestCase.getListOfTestFuncs | ( | self | ) |
Get the list of test functions in this test.
Definition at line 993 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__functionDict.
Referenced by TestCenterAdvanced.TestCase.TestCase.run().
| TestCenterAdvanced.TestCase.TestCase.getModule | ( | self | ) |
Return the module representing this test case, or None.
Definition at line 985 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx.
| TestCenterAdvanced.TestCase.TestCase.getName | ( | self | ) |
Return the name of the test case.
Reimplemented in TestCenterAdvanced.TestCaseGeneric.GenericTestCase.
Definition at line 989 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._testCaseName, and TestCenterAdvanced.TestCaseGeneric.GenericTestCase._testCaseName.
Referenced by TestCenterAdvanced.TestCase.TestCase.openFiles(), and TestCenterAdvanced.TestCase.TestCase.run().
| TestCenterAdvanced.TestCase.TestCase.getPackage | ( | self | ) |
Return the identifier of the package the test case is in.
Definition at line 997 of file TestCase.py.
References TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot.
| TestCenterAdvanced.TestCase.TestCase.getTestCaseNode | ( | self | ) |
Return the XML node with the test case's information.
Definition at line 1001 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__dummyTestSuite, TestCenterAdvanced.TestCase.TestCase.__hasSetUpError, TestCenterAdvanced.TestCase.TestCase.__previousTestClass, TestCenterAdvanced.TestCase.TestCase.__setupLogCollector, TestCenterAdvanced.TestCase.TestCase.__setUpTestCaseCalled, TestCenterAdvanced.TestCase.TestCase.__testLogger, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot, TestCenterAdvanced.TestCase.TestCase._ctx, and TestCenterAdvanced.TestCase.TestCase.destroyContext().
| TestCenterAdvanced.TestCase.TestCase.getType | ( | self | ) |
Return the type of this test case (generic or functional).
Reimplemented in TestCenterAdvanced.TestCaseFunctional.FunctionalTestCase, and TestCenterAdvanced.TestCaseGeneric.GenericTestCase.
Definition at line 981 of file TestCase.py.
Referenced by TestCenterAdvanced.TestCase.TestCase.run().
| TestCenterAdvanced.TestCase.TestCase.hasNetwork | ( | self | ) |
Return True if the test case has a network attached.
Definition at line 961 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.networkFileName().
| TestCenterAdvanced.TestCase.TestCase.isValid | ( | self | ) |
Return True if the loaded test case is syntactically valid and should be executable.
Definition at line 957 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__valid.
| TestCenterAdvanced.TestCase.TestCase.networkFileName | ( | self | ) |
Returns the absolute file name of the attached network or an empty string if no network is attached.
Definition at line 965 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx.
Referenced by TestCenterAdvanced.TestCase.TestCase.hasNetwork().
| TestCenterAdvanced.TestCase.TestCase.openFiles | ( | self | ) |
Open the files associated with the test case.
Definition at line 969 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx, TestCenterAdvanced.TestCase.TestCase.getName(), TestCenterAdvanced.TestCaseGeneric.GenericTestCase.getName(), and TestSupport.FieldValueTests.FieldValueTestCase.getName().
| TestCenterAdvanced.TestCase.TestCase.openNetwork | ( | self | ) |
Open the internal network of the test case.
Definition at line 975 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase._ctx.
| TestCenterAdvanced.TestCase.TestCase.run | ( | self, | |
| etree.Element | resultNode | ||
| ) |
Run the test case and store results in the given xml data structure.
| resultNode | The node taking the results (call by reference). |
Reimplemented in TestCenterAdvanced.TestCaseGeneric.GenericTestCase.
Definition at line 1053 of file TestCase.py.
References TestCenterAdvanced.TestCase.TestCase.__callSetUp(), TestCenterAdvanced.TestCase.TestCase.__callSetUpTestCase(), TestCenterAdvanced.TestCase.TestCase.__callTearDown(), TestCenterAdvanced.TestCase.TestCase.__callTearDownTestCase(), TestCenterAdvanced.TestCase.TestCase.__callTestFunction(), TestCenterAdvanced.TestCase.TestCase.__currentResultNode, TestCenterAdvanced.TestCase.TestCase.__finishRunTestFunction(), TestCenterAdvanced.TestCase.TestCase.__hasSetUpError, TestCenterAdvanced.TestCase.TestCase.__loadLogCollector, TestCenterAdvanced.TestCase.TestCase.__perFunctionResultDirectory, TestCenterAdvanced.TestCase.TestCase.__prepareRunTestFunction(), TestCenterAdvanced.TestCase.TestCase.__runTestFunction(), TestCenterAdvanced.TestCase.TestCase.__setupLogCollector, TestCenterAdvanced.TestCase.TestCase.__setupTestCaseAndRunTestFunction(), TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testLogger, TestCenterAdvanced.TestCase.TestCase.__unloadTestCase(), TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, TestCenterAdvanced.TestCase.TestCase._testHelper, TestCenterAdvanced.TestCase.TestCase.activate(), TestCenterAdvanced.TestCase.TestCase.addExtraTestCaseResult(), TestSupport.TestHelper.TestHelper.addExtraTestCaseResult(), TestCenterAdvanced.TestCase.TestCase.deactivate(), TestCenterAdvanced.TestCase.TestCase.getListOfTestFuncs(), TestCenterAdvanced.TestCase.TestCase.getName(), TestCenterAdvanced.TestCaseGeneric.GenericTestCase.getName(), TestSupport.FieldValueTests.FieldValueTestCase.getName(), TestCenterAdvanced.TestCase.TestCase.getType(), TestCenterAdvanced.TestCaseFunctional.FunctionalTestCase.getType(), TestCenterAdvanced.TestCaseGeneric.GenericTestCase.getType(), and TestSupport.Logging.setStopped().
| TestCenterAdvanced.TestCase.TestCase.setTestCaseListener | ( | self, | |
| testCaseListener | |||
| ) |
Definition at line 348 of file TestCase.py.
References TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, and TestCenterAdvanced.TestCase.TestCase.__testCaseListener.
Referenced by TestCenterAdvanced.Slave.Slave.runCommand().
|
protected |
Definition at line 181 of file TestCase.py.
Referenced by TestCenterAdvanced.TestCase.TestCase._buildVirtualFunctions(), TestCenterAdvanced.TestCase.TestCase._callableFunctions(), TestCenterAdvanced.TestCase.TestCase._callGroupFunction(), TestCenterAdvanced.TestCase.TestCase._getTestFunction(), TestCenterAdvanced.TestCase.TestCase._loadScriptFile(), TestCenterAdvanced.TestCase.TestCase.activate(), TestCenterAdvanced.TestCase.TestCase.callFieldValueTestCase(), TestCenterAdvanced.TestCase.TestCase.destroyContext(), TestCenterAdvanced.TestCase.TestCase.getDocumentation(), TestCenterAdvanced.TestCase.TestCase.getModule(), TestCenterAdvanced.TestCase.TestCase.getTestCaseNode(), TestCenterAdvanced.TestCase.TestCase.networkFileName(), TestCenterAdvanced.TestCase.TestCase.openFiles(), and TestCenterAdvanced.TestCase.TestCase.openNetwork().
|
protected |
Definition at line 241 of file TestCase.py.
Referenced by TestCenterAdvanced.TestCase.TestCase.activate().
|
protected |
|
protected |
Definition at line 183 of file TestCase.py.
Referenced by TestCenterAdvanced.TestCase.TestCase._callGroupFunction(), TestCenterAdvanced.TestCase.TestCase._getTestFunction(), TestCenterAdvanced.TestCase.TestCase._loadScriptFile(), TestCenterAdvanced.TestCase.TestCase.activate(), TestCenterAdvanced.TestCase.TestCase.deactivate(), TestCenterAdvanced.TestCase.LogCollectorBase.logHandler(), and TestCenterAdvanced.TestCase.TestCase.run().
| TestCenterAdvanced.TestCase.TestCase.callFieldValueTestCase |
Definition at line 612 of file TestCase.py.
| TestCenterAdvanced.TestCase.TestCase.futureDone |
Definition at line 402 of file TestCase.py.