class CTransition : public CActive |
Comments : Base class from which test developers can derive their own transitions for both synchronous and asynchronous methods on the test class.
The default behaviour is to log its activity, and claim that the pre and post conditions are true. The TransitMethodL implementation does nothing. To write a complete test class method transition override:
1. The c'tor, (To obtain the test class reference, (or pointer reference for a NewL transit), and any parameters for the TransitMethodL).
2. SetStartStateL() to set the test class state, Using the TStateAccessor provided in the c'tor.
3. ValidatePreConditions() to test the test class state is valid.
4. TransitMethodL() to define the transition behaviour, calling the method to test with the appropriate parameters.
5. ValidatePostConditions(), to check the end state is valid.
The simplest case of implementation is to derive an empty class, that relies entirely upon the default behaviour, and implement the remaining methods as appropriate. (See the the EXAMPLE implementation.)
Public Member Functions | |
---|---|
~CTransition() | |
IMPORT_C TInt | GetErrorCode() |
IMPORT_C TBool | IsBlockingTransition() |
IMPORT_C void | RepeatOnce() |
IMPORT_C void | RunTransition(TRequestStatus *) |
IMPORT_C void | SetBlockingTransition(TBool) |
IMPORT_C void | SetStartStateL() |
IMPORT_C const TDesC & | TransitionId() |
IMPORT_C const TTransitionInfo & | TransitionInfo() |
Protected Member Functions | |
---|---|
CTransition(const TDesC &, CUnitTestContext &, TTransitionValidator &) | |
IMPORT_C void | DoCancel() |
IMPORT_C void | PostTransitionCleanup() |
IMPORT_C TInt | RunError(TInt) |
IMPORT_C void | RunL() |
IMPORT_C void | TransitMethodL() |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Inherited Attributes | |
---|---|
CActive::iStatus |
IMPORT_C | CTransition | ( | const TDesC & | aTransitionId, |
CUnitTestContext & | aUTContext, | |||
TTransitionValidator & | aValidator | |||
) | [protected] |
const TDesC & aTransitionId | The identifier of this transition |
CUnitTestContext & aUTContext | The context within which this transition should run |
TTransitionValidator & aValidator | Provides Pre & Post condition validation |
IMPORT_C | ~CTransition | ( | ) |
IMPORT_C void | DoCancel | ( | ) | [protected, virtual] |
IMPORT_C TInt | GetErrorCode | ( | ) | const |
IMPORT_C TBool | IsBlockingTransition | ( | ) | const |
IMPORT_C void | PostTransitionCleanup | ( | ) | [protected, virtual] |
IMPORT_C void | RepeatOnce | ( | ) |
IMPORT_C TInt | RunError | ( | TInt | aErrorCode | ) | [protected, virtual] |
TInt aErrorCode | The error code which RunL left with |
IMPORT_C void | RunL | ( | ) | [protected, virtual] |
IMPORT_C void | RunTransition | ( | TRequestStatus * | aUnitTestStatus | ) | [virtual] |
TRequestStatus * aUnitTestStatus | Status word of the calling CUnitTest |
IMPORT_C void | SetBlockingTransition | ( | TBool | aBlocking | ) |
TBool aBlocking | Pass ETrue to set this as a blocking transition |
IMPORT_C void | SetStartStateL | ( | ) | [virtual] |
IMPORT_C void | TransitMethodL | ( | ) | [protected, pure virtual] |
IMPORT_C const TDesC & | TransitionId | ( | ) | const |
IMPORT_C const TTransitionInfo & | TransitionInfo | ( | ) | const |
TBool | iAsyncTransition | [protected] |
Indicates that this transition is an asynchronous transition
TBool | iBlockingTransition | [protected] |
Indicates that this transition should not execute until all previous async transitions have finished
TInt | iLeaveError | [protected] |
indicates the code that the RunL left with when completing with a KErrTestBedLeft
TBool | iRepeatThis | [protected] |
Indicates that this transition should be re-run after the current run
TBool | iTransitionFinished | [protected] |
Indicates that the transition has executed and can be completed
TTransitionInfo | iTransitionInfo | [protected] |
Information on this transition including its ID, its iteration number and the data logger it is currently using
CUnitTestContext & | iUTContext | [protected] |
The context in which this transition is running (logging, state accessor & observer)
TRequestStatus * | iUnitTestStatus | [protected] |
The iStatus of the UnitTest which owns me so that I can complete it
TTransitionValidator & | iValidator | [protected] |
Used for checking the state of the test object - provides pre and post condition validation functions
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.