TestCenter Reference
TestCenterAdvanced.TestCase.TestCase Class Reference

The superclass for the different test case categories. More...

Inheritance diagram for TestCenterAdvanced.TestCase.TestCase:
TestCenterAdvanced.TestCaseFunctional.FunctionalTestCase TestCenterAdvanced.TestCaseGeneric.GenericTestCase

Public Member Functions

 __init__ (self, testCaseName, isNewlyCreated=False)
 Default constructor for the test case.
 
 __del__ (self)
 The default destructor.
 
 destroyContext (self)
 
 activate (self)
 
 deactivate (self)
 
 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)
 Has test case loaded without syntax errors?
 
 hasNetwork (self)
 Check whether 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 of functional).
 
 getModule (self)
 Return the module, might be None.
 
 getName (self)
 Return the name of the test case.
 
 getListOfTestFuncs (self)
 Get a list of test functions this test has.
 
 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, 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

 _dataDirectory
 

Static Protected Attributes

 _ctx = None
 The TestCase's context.
 
 _testHelper = None
 The instance of the TestHelper singleton.
 
 _testCaseName = None
 The name of the current test case.
 
 _testCaseType = None
 The type of the test case.
 

Detailed Description

The superclass for the different test case categories.

Definition at line 88 of file TestCase.py.

Constructor & Destructor Documentation

◆ __init__()

TestCenterAdvanced.TestCase.TestCase.__init__ ( self,
testCaseName,
isNewlyCreated = False )

Default constructor for the test case.

Parameters
testCaseNameThe name of the test case.
isNewlyCreatedIndicates if the test case is newly created to suppress the warning that no test functions exist.

Reimplemented in TestCenterAdvanced.TestCaseFunctional.FunctionalTestCase, and TestCenterAdvanced.TestCaseGeneric.GenericTestCase.

Definition at line 119 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase.__collectedStartupErrorsState, TestCenterAdvanced.TestCase.TestCase.__collectedStartupLog, TestCenterAdvanced.TestCase.TestCase.__collectedStartupWarningsState, TestCenterAdvanced.TestCase.TestCase.__dummyTestSuite, TestCenterAdvanced.TestCase.TestCase.__functionDict, TestCenterAdvanced.TestCase.TestCase.__perFunctionResultDirectory, TestCenterAdvanced.TestCase.TestCase.__previousTestClass, TestCenterAdvanced.TestCase.TestCase.__setupTestCaseCalled, TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__valid, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot, TestCenterAdvanced.TestCase.TestCase._getTestCaseInfo(), TestCenterAdvanced.TestCase.TestCase._testCaseName, TestCenterAdvanced.TestCaseGeneric.GenericTestCase._testCaseName, TestCenterAdvanced.TestCase.TestCase._testCaseType, TestCenterAdvanced.TestCaseFunctional.FunctionalTestCase._testCaseType, TestCenterAdvanced.TestCaseGeneric.GenericTestCase._testCaseType, and TestCenterAdvanced.TestCase.TestCase._testHelper.

◆ __del__()

TestCenterAdvanced.TestCase.TestCase.__del__ ( self)

The default destructor.

Definition at line 206 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase.destroyContext().

Member Function Documentation

◆ _buildVirtualFunctions()

◆ _callableFunctions()

TestCenterAdvanced.TestCase.TestCase._callableFunctions ( self)
protected

◆ _callGroupFunction()

◆ _getTestCaseInfo()

TestCenterAdvanced.TestCase.TestCase._getTestCaseInfo ( self,
testCaseName )
protected

Definition at line 201 of file TestCase.py.

Referenced by TestCenterAdvanced.TestCase.TestCase.__init__().

◆ _getTestFunction()

◆ _loadScriptFile()

TestCenterAdvanced.TestCase.TestCase._loadScriptFile ( self,
filename )
protected

◆ activate()

◆ addExtraTestCaseResult()

◆ callFieldValueTestCase()

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.

Parameters
filenameThe field-value test case set.
testcaseThe test case to be executed.

Definition at line 354 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase.__getFunctionInfo(), and TestCenterAdvanced.TestCase.TestCase._ctx.

◆ deactivate()

TestCenterAdvanced.TestCase.TestCase.deactivate ( self)

◆ destroyContext()

TestCenterAdvanced.TestCase.TestCase.destroyContext ( self)

◆ getDocumentation()

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.

Parameters
functionNameThe function to gather documentation for.
Returns
The function's documentation.

Definition at line 1029 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase._ctx.

Referenced by TestCenterAdvanced.TestCase.TestCase._buildVirtualFunctions(), and TestCenterAdvanced.TestCase.TestCase._callGroupFunction().

◆ getListOfTestFuncs()

TestCenterAdvanced.TestCase.TestCase.getListOfTestFuncs ( self)

Get a list of test functions this test has.

Definition at line 819 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase.__functionDict.

Referenced by TestCenterAdvanced.TestCase.TestCase.run().

◆ getModule()

TestCenterAdvanced.TestCase.TestCase.getModule ( self)

Return the module, might be None.

Definition at line 807 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase._ctx.

◆ getName()

◆ getPackage()

TestCenterAdvanced.TestCase.TestCase.getPackage ( self)

Return the identifier of the package the test case is in.

Definition at line 825 of file TestCase.py.

References TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot.

◆ getTestCaseNode()

◆ getType()

TestCenterAdvanced.TestCase.TestCase.getType ( self)

◆ hasNetwork()

TestCenterAdvanced.TestCase.TestCase.hasNetwork ( self)

Check whether the test case has a network attached.

Definition at line 773 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase.networkFileName().

◆ isValid()

TestCenterAdvanced.TestCase.TestCase.isValid ( self)

Has test case loaded without syntax errors?

Returns
Whether the loaded test case is valid and should be executable.

Definition at line 767 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase.__valid.

◆ networkFileName()

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 779 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase._ctx.

Referenced by TestCenterAdvanced.TestCase.TestCase.hasNetwork().

◆ openFiles()

TestCenterAdvanced.TestCase.TestCase.openFiles ( self)

◆ openNetwork()

TestCenterAdvanced.TestCase.TestCase.openNetwork ( self)

Open the internal network of the test case.

Definition at line 793 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase._ctx.

◆ run()

TestCenterAdvanced.TestCase.TestCase.run ( self,
resultNode )

Run the test case and store results in the given xml data structure.

Parameters
resultNodeThe node taking the results (call by reference).

Reimplemented in TestCenterAdvanced.TestCaseGeneric.GenericTestCase.

Definition at line 871 of file TestCase.py.

References TestCenterAdvanced.TestCase.TestCase.__appendCollectedStartupLog(), TestCenterAdvanced.TestCase.TestCase.__callSetUpTestCase(), TestCenterAdvanced.TestCase.TestCase.__callTestFunction(), TestCenterAdvanced.TestCase.TestCase.__collectedStartupErrorsState, TestCenterAdvanced.TestCase.TestCase.__collectedStartupLog, TestCenterAdvanced.TestCase.TestCase.__collectedStartupWarningsState, TestCenterAdvanced.TestCase.TestCase.__currentResultNode, TestCenterAdvanced.TestCase.TestCase.__finishRunTestFunction(), TestCenterAdvanced.TestCase.TestCase.__perFunctionResultDirectory, TestCenterAdvanced.TestCase.TestCase.__prepareRunTestFunction(), TestCenterAdvanced.TestCase.TestCase.__runTestFunction(), TestCenterAdvanced.TestCase.TestCase.__setupTestCaseAndRunTestFunction(), TestCenterAdvanced.TestCase.TestCase.__setupTestCaseCalled, TestCenterAdvanced.TestCase.TestCase.__tearDown(), TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testCaseListener, 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(), and TestCenterAdvanced.TestCase.TestCase.getType().

◆ setTestCaseListener()

TestCenterAdvanced.TestCase.TestCase.setTestCaseListener ( self,
testCaseListener )

Member Data Documentation

◆ _ctx

◆ _dataDirectory

TestCenterAdvanced.TestCase.TestCase._dataDirectory
protected

Definition at line 161 of file TestCase.py.

Referenced by TestCenterAdvanced.TestCase.TestCase.activate().

◆ _testCaseName

◆ _testCaseType

TestCenterAdvanced.TestCase.TestCase._testCaseType = None
staticprotected

The type of the test case.

Definition at line 98 of file TestCase.py.

Referenced by TestCenterAdvanced.TestCase.TestCase.__init__(), and TestCenterAdvanced.TestCase.TestCase.getType().

◆ _testHelper

◆ callFieldValueTestCase

TestCenterAdvanced.TestCase.TestCase.callFieldValueTestCase

Definition at line 493 of file TestCase.py.

◆ futureDone

TestCenterAdvanced.TestCase.TestCase.futureDone

Definition at line 294 of file TestCase.py.


The documentation for this class was generated from the following file: