CComponentTester Class Reference

class CComponentTester : public CActive

Comments : Abstract class from which developers can derive their own component testing classes. To write a derived class just implement a NewLC() and a ConstructL() from which ComponentTesterConstructL() should be the first thing called.

Inherits from

Constructor & Destructor Documentation

CComponentTester(CDataLogger &, MComponentTestObserver &)

IMPORT_C CComponentTester ( CDataLogger & aDataLogger,
MComponentTestObserver & aObserver
) [protected]
Intended Usage : Default Constructor
Since
7.0

Parameters

CDataLogger & aDataLogger Used for file logging capability
MComponentTestObserver & aObserver To inform of completion of all tests

~CComponentTester()

IMPORT_C ~CComponentTester ( )
Intended Usage : Standardized virtual destruction method
Since
7.0

Member Functions Documentation

AddParamUnitTestL(const CUnitTest *)

IMPORT_C void AddParamUnitTestL ( const CUnitTest * aUnitTest ) [protected]
Intended Usage : Used by derived classes to add UnitTests which can only be run when they are supplied with parameters from the UI. Error Condition :
Since
7.0
Pre-condition
None
Post-condition
The specified unit test is added to the list of test to be executed and is flagged as requiring parameters

Parameters

const CUnitTest * aUnitTest The unit test to add to the list

AddUnitTestL(const CUnitTest *)

IMPORT_C void AddUnitTestL ( const CUnitTest * aUnitTest ) [protected]
Intended Usage : Used by derived class to add UnitTests to the list Error Condition :
Since
7.0
Pre-condition
None
Post-condition
The specified unit test is added to the list of tests to be executed.

Parameters

const CUnitTest * aUnitTest The UnitTest to be added

Complete(CUnitTest *)

IMPORT_C void Complete ( CUnitTest * aUnitTest )
Intended Usage : Used, by the observed unit test, to indicate that the test has completed Error Condition :
Since
7.0
Pre-condition
None
Post-condition
If this was the last unit test then iObserver is informed that this component is complete.

Parameters

CUnitTest * aUnitTest The unit test which has completed.

ComponentTesterConstructL()

IMPORT_C void ComponentTesterConstructL ( ) [protected]
Intended Usage : Must be called by derived class ConstructL() to perform base class initialisation. Error Condition :
Since
7.0
Pre-condition
None
Post-condition
Object is fully constructed

ConstructL()

IMPORT_C void ConstructL ( ) [protected, pure virtual]
Intended Usage : Standard two-phase construction method. To be implemented in derived class Error Condition :
Since
7.0
Pre-condition
First phase of construction is complete
Post-condition
Object is fully constructed

DoCancel()

IMPORT_C void DoCancel ( ) [protected, virtual]
Intended Usage : Error Condition :
Since
7.0
Pre-condition
This CComponentTester is fully constructed.
Post-condition
Any outstanding asynchronous requests are cancelled.

RunL()

IMPORT_C void RunL ( ) [protected, virtual]
Intended Usage : Error Condition :
Since
7.0
Pre-condition
This CComponentTester is fully constructed
Post-condition
One of the CUnitTest contained in this CComponentTester has been run

SetRTest(RTest *)

IMPORT_C void SetRTest ( RTest * aRTest )

Parameters

RTest * aRTest

TestComponent(RPointerArray< TTestInfo > *)

IMPORT_C void TestComponent ( RPointerArray < TTestInfo > * aTests ) [virtual]
Intended Usage : Called to perform a full test of the component. Runs the listed tests or all unit tests if aTests == 0 Error Condition :
Since
7.0
Pre-condition
This CComponentTester is fully initialized
Post-condition
All unit tests will be set up to run

Parameters

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

TransitionSetsL()

IMPORT_C RPointerArray < CUnitTestInfo > * TransitionSetsL ( ) const
Intended Usage : Called to provide a list of the transition sets in this component test. Ownership of the array is passed to the calling object. Error Condition :
Since
7.0
Pre-condition
None

Member Data Documentation

TInt iCurrentUnitTest

TInt iCurrentUnitTest [protected]

The index of the unittest which is to be run next

CDataLogger & iDataLogger

CDataLogger & iDataLogger [protected]

The test logging mechanism

MComponentTestObserver & iObserver

MComponentTestObserver & iObserver [protected]

The observer to inform when we have completed the test

RArray< TInt > iParameterizedTests

RArray < TInt > iParameterizedTests [protected]

A list of the test which cannot run without a parameter set from the UI

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< CUnitTestInfo > * iTransitionSets

RPointerArray < CUnitTestInfo > * iTransitionSets [protected]

A placeholder which is only used to ensure correct object cleanup when TransitionSetsL() leaves

RPointerArray< CUnitTest > * iUnitTests

RPointerArray < CUnitTest > * iUnitTests [protected]

List of all the unit tests which make up this component test

RPointerArray< TTestInfo > * iUnitTestsToRun

RPointerArray < TTestInfo > * iUnitTestsToRun [protected]

The list of tests to run, NULL means run all tests. We take ownership of the list but not the items on it.