CTestManager Class Reference

class CTestManager : public CActive

Comments : Active object which launches all the tests which the TestController has discovered. Also, acts as an observer on each CComponentTester waiting for a Complete message to indicate the test has finished.

Inherits from

Constructor & Destructor Documentation

CTestManager(RPointerArray< CComponentInfo > *, CDataLogger &, MManagerObserver &, RTest *)

CTestManager ( RPointerArray < CComponentInfo > * aTestList,
CDataLogger & aDataLogger,
MManagerObserver & aObserver,
RTest * aRTest = NULL
) [protected]
Intended Usage : Constructor
Since
7.0

Parameters

RPointerArray < CComponentInfo > * aTestList The list of tests to be launched by this CTestManager
CDataLogger & aDataLogger The file logging capability
MManagerObserver & aObserver The class to inform when all the tests are complete
RTest * aRTest = NULL Optional RTest object to use in check unit test results

~CTestManager()

~CTestManager ( )
Intended Usage : Standard destructor
Since
7.0

Member Functions Documentation

Complete(CComponentTester *, TInt)

void Complete ( CComponentTester * aTester,
TInt aUnitTestId
)
Intended Usage : Callback from the CComponentTester being observed to indicate that it has completed a unit test
Since
7.0
Pre-condition
The specified unit test has been launched
Post-condition
If all unit tests are complete then the specified CComponentTester has been added to the Garbage list ready for deletion at the next opportunity, this will also unload the appropriate library. Otherwise launch the next unit test.

Parameters

CComponentTester * aTester The CComponentTester which is signalling
TInt aUnitTestId The Id of the completed unit test

ConstructL()

void ConstructL ( ) [protected]
Intended Usage : Second phase of safe two-phase construction method
Since
7.0
Pre-condition
First phase of construction is complete
Post-condition
Object is fully constructed and initialized

DoCancel()

void DoCancel ( ) [protected, virtual]
Intended Usage : Standard Active Object method used to cancel any outstanding requests Error Condition :
Since
7.0
Pre-condition
Object is fully constructed and initialised
Post-condition
Any outstanding requests have been cancelled.

NewL(RPointerArray< CComponentInfo > *, CDataLogger &, MManagerObserver &, RTest *)

CTestManager * NewL ( RPointerArray < CComponentInfo > * aTestList,
CDataLogger & aDataLogger,
MManagerObserver & aObserver,
RTest * aRTest = NULL
) [static]
Intended Usage : Standard two-phase construction which leaves nothing on the CleanupStack
Since
7.0
Pre-condition
None
Post-condition
Nothing is left on the CleanupStack

Parameters

RPointerArray < CComponentInfo > * aTestList List of tests available to be performed
CDataLogger & aDataLogger Provides the file logging functionality
MManagerObserver & aObserver The object to inform when all the tests are complete
RTest * aRTest = NULL Optional RTest object to use in check unit test results

RunError(TInt)

TInt RunError ( TInt aErrorCode ) [protected, virtual]
Intended Usage : Handles the situation where the RunL leaves. RunL will only leave through a leave from TestComponentL, this will occur if the test to be run fails to construct. Error Condition : None
Since
7.0
Pre-condition
This object is fully constructed and initialized
Post-condition
The test which failed to construct is cleaned up.

Parameters

TInt aErrorCode The error code which RunL left with.

RunL()

void RunL ( ) [protected, virtual]
Intended Usage : Used to launch each test, in turn, and then to stop the active scheduler when all tests have completed
Since
7.0
Pre-condition
None
Post-condition
Initially each run of RunL() will result in a ComponentTester being created and launched. Once all the tests have launched RunL() will only be called at completion to stop the active scheduler.

RunTests(RPointerArray< TTestInfo > *)

void RunTests ( RPointerArray < TTestInfo > * aTests )
Intended Usage : Prepare for the test run. Error Condition :
Since
7.0
Pre-condition
None
Post-condition
This is active and awaiting call to RunL() by the active scheduler

Parameters

RPointerArray < TTestInfo > * aTests The list of tests to run, 0 means all tests

StartedTests()

TBool StartedTests ( ) const
Intended Usage : Returns a flag indicating whether any tests have been started yet
Since
7.0
Pre-condition
This object is fully constructed

TestComponentL(TInt)

void TestComponentL ( TInt aComponentIndex ) [protected]
Intended Usage : Loads the appropriate library and test the specified component
Since
7.0
Pre-condition
Object is fully constructed and initialised
Post-condition
Specified component test has been activated to run

Parameters

TInt aComponentIndex The zero base index of the component to test

Member Data Documentation

TBool iAmStopping

TBool iAmStopping [protected]

Flag indicating that all tests have completed

TInt iCurrentTestLoad

TInt iCurrentTestLoad [protected]

The index (in iTestList) of the test which is to be loaded next

CComponentTester * iCurrentTester

CComponentTester * iCurrentTester [protected]

The test which is currently being run

CDataLogger & iDataLogger

CDataLogger & iDataLogger [protected]

The test logging mechanism

MManagerObserver & iObserver

MManagerObserver & iObserver [protected]

The observer to inform when all tests are complete

RTest * iRTest

RTest * iRTest [protected]

Optional reference to the RTest object used in the EXE test harness code which kicked off this test framework

RPointerArray< CComponentInfo > * iTestList

RPointerArray < CComponentInfo > * iTestList [protected]

List of all the test to be run

RPointerArray< TTestInfo > * iTestsToRun

RPointerArray < TTestInfo > * iTestsToRun [protected]

List of the tests to be run, NULL means run all tests