CTestModuleContainer Class Reference

class CTestModuleContainer : public CActive

Inherits from

Public Member Functions
~CTestModuleContainer ()
TInt & AllowedExitCode ()
CTestModuleIf::TExitReason & AllowedExitReason ()
TInt ChangeOperation (const TOperation , const TFileName &, const TInt )
void ChangeOperationNoError (const TOperation , const TInt )
void DoCancel ()
void DoErrorPrint ()
TInt EnumerateTestCases (const TFileName &)
TErrorNotification & ErrorNotification ()
TInt ErrorPrintSemHandle ()
TInt FreeEnumerationData ()
TRequestStatus * GetRequest ( TRequestType )
void GetTestCaseTitleL ( TDes &)
CTestModule * GetTestModule ()
TInt Initialize (const TFileName &, const TBool )
void KillTestMeasurement ()
void KillTestinterferenceThread ()
void KillThread (const TInt )
TInt & ModuleResult ()
CTestModuleContainer * NewL (const TDesC &, CTestModule *, const TDesC &)
TOperation Operation ()
TInt OperationChangeSemHandle ()
TInt & OperationErrorResult ()
TInt & OperationIntBuffer ()
const TDesC & OperationName ()
TInt OperationStartSemHandle ()
TDes & OperationText ()
TOperation OperationType ()
TInt PauseThread ()
TInt ResumeThread ()
TInt RunError ( TInt )
void RunL ()
void RunTestCase (const TFileName &, const TInt , const RMessage2 &)
TThreadId ServerThreadId ()
void SetExecutionSubSession ( CTestExecution *)
void SetThreadContainer ( CTestThreadContainer *)
const RPointerArray < TTestCaseInfo > * TestCases ()
CTestExecution * TestExecution ()
const TDesC & TestModuleIniFile ()
const TDesC & TestModuleName ()
Protected Member Functions
void ConstructL (const TDesC &, CTestModule *, const TDesC &)
Private Member Functions
CTestModuleContainer ()
void Complete (const TInt )
void DeleteTestModule ()
TInt EnumerateInThread ()
TInt ExecuteTestCaseInThread ()
TInt ExecutionThread ( TAny *)
void FreeEnumerationDataInThread ()
TInt GetTestModuleParams (const TDesC &, const TDesC &, TInt &, TInt &, TInt &)
TInt InitializeModuleInThread ( RLibrary &)
TInt ReadParametersFromScriptFileL (const TDesC &, TInt &, TInt &, TInt &)
TInt ReadParametersFromTestModule (const TDesC &, CTestModuleParam *&)
TInt ResolveCompletionCode ( TInt , TInt )
TInt StartAndWaitOperation ()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TOperation { EInitializeModule , EEnumerateInThread , EExecuteTestInThread , EFreeEnumerationData , EExit }
enum TRequestType { ERqTestCase , ERqErrorPrint }
Inherited Enumerations
CActive:TPriority
Private Attributes
TInt iAllowedExitCode
CTestModuleIf::TExitReason iAllowedExitReason
CTestExecution * iCTestExecution
CTestModule * iCTestModule
TErrorNotification iErrorPrint
CErrorPrintHandler * iErrorPrintHandler
RSemaphore iErrorPrintSem
TInt iErrorResult
TBool iIsPaused
RMessage2 iMessage
HBufC * iModuleNameBuffer
TInt iModuleResult
CActiveSchedulerWait * iNestedActiveScheduler
RSemaphore iOperationChangeSemaphore
TInt iOperationIntBuffer
TPtr iOperationName
RSemaphore iOperationStartSemaphore
TRequestStatus iOperationStatus
TBuf < 30 > iOperationText
TOperation iOperationType
TThreadId iServerThreadId
RThread iThread
CTestThreadContainer * iThreadContainer
CUnderTaker * iUnderTaker
TBool iUpAndRunning
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CTestModuleContainer()

CTestModuleContainer ( ) [private]

C++ default constructor.

~CTestModuleContainer()

~CTestModuleContainer ( ) [virtual]

Destructor of CTestModuleContainer .

Member Functions Documentation

AllowedExitCode()

TInt & AllowedExitCode ( ) [inline]

AllowedExitReason()

CTestModuleIf::TExitReason & AllowedExitReason ( ) [inline]

ChangeOperation(const TOperation, const TFileName &, const TInt)

TInt ChangeOperation ( const TOperation aOperation,
const TFileName & aNameBuffer,
const TInt aInt
)

Changes the operation, can fail

Parameters

const TOperation aOperation
const TFileName & aNameBuffer
const TInt aInt

ChangeOperationNoError(const TOperation, const TInt)

void ChangeOperationNoError ( const TOperation aOperation,
const TInt aInt
)

Changes the operation

Parameters

const TOperation aOperation
const TInt aInt

Complete(const TInt)

void Complete ( const TInt aCompletionCode ) [private]

Completes operation from test execution thread or from undertaker

Parameters

const TInt aCompletionCode

ConstructL(const TDesC &, CTestModule *, const TDesC &)

void ConstructL ( const TDesC & aName,
CTestModule * aSession,
const TDesC & aConfig
) [protected]

By default Symbian OS constructor is private.

Parameters

const TDesC & aName
CTestModule * aSession
const TDesC & aConfig

DeleteTestModule()

void DeleteTestModule ( ) [private]

Delete a test module instance

DoCancel()

void DoCancel ( ) [virtual]

DoCancel derived from CActive handles the Cancel

DoErrorPrint()

void DoErrorPrint ( )

Error print handler.

EnumerateInThread()

TInt EnumerateInThread ( ) [private]

Function that enumerates test cases in execution thread context.

EnumerateTestCases(const TFileName &)

TInt EnumerateTestCases ( const TFileName & aName )

Enumerate test cases

Parameters

const TFileName & aName

ErrorNotification()

TErrorNotification & ErrorNotification ( ) [inline]

ErrorPrintSemHandle()

TInt ErrorPrintSemHandle ( ) [inline]

ExecuteTestCaseInThread()

TInt ExecuteTestCaseInThread ( ) [private]

Function that executes test case in execution thread context.

ExecutionThread(TAny *)

TInt ExecutionThread ( TAny * aParams ) [private, static]

Test case execution thread thread function

Parameters

TAny * aParams

FreeEnumerationData()

TInt FreeEnumerationData ( )

Frees the enumeration data

FreeEnumerationDataInThread()

void FreeEnumerationDataInThread ( ) [private]

Function that frees the enumeration data in execution thread context.

GetRequest(TRequestType)

TRequestStatus * GetRequest ( TRequestType aType )

Parameters

TRequestType aType

GetTestCaseTitleL(TDes &)

void GetTestCaseTitleL ( TDes & aTestCaseTitle )

Get title of currently running test case

Parameters

TDes & aTestCaseTitle

GetTestModule()

CTestModule * GetTestModule ( )

Gets pointer to test module

GetTestModuleParams(const TDesC &, const TDesC &, TInt &, TInt &, TInt &)

TInt GetTestModuleParams ( const TDesC & aModuleName,
const TDesC & aConfig,
TInt & aStackSize,
TInt & aHeapMinSize,
TInt & aHeapMaxSize
) [private]

Load test module dynamically. If loading is done succesfully then get test module's parameters according to version. Verifies received parameters also.

Parameters

const TDesC & aModuleName
const TDesC & aConfig
TInt & aStackSize
TInt & aHeapMinSize
TInt & aHeapMaxSize

Initialize(const TFileName &, const TBool)

TInt Initialize ( const TFileName & aName,
const TBool aFirstTime
)

Initialize the test module

Parameters

const TFileName & aName
const TBool aFirstTime

InitializeModuleInThread(RLibrary &)

TInt InitializeModuleInThread ( RLibrary & aModule ) [private]

Function that initialise module in execution thread context.

Parameters

RLibrary & aModule

KillTestMeasurement()

void KillTestMeasurement ( )

Make sure that any of the test measurement process's won't stay to run if test case is crashed of test measurement object is not deleted.

KillTestinterferenceThread()

void KillTestinterferenceThread ( )

Make sure that any of the test interference thread's won't stay to run if test case is crashed of test interference object is not deleted.

KillThread(const TInt)

void KillThread ( const TInt aCode )

Kill the thread

Parameters

const TInt aCode

ModuleResult()

TInt & ModuleResult ( )

Returns error code from module

NewL(const TDesC &, CTestModule *, const TDesC &)

CTestModuleContainer * NewL ( const TDesC & aName,
CTestModule * aSession,
const TDesC & aConfig
) [static]

NewL is first phase of two-phased constructor.

Parameters

const TDesC & aName
CTestModule * aSession
const TDesC & aConfig

Operation()

TOperation Operation ( )

Return the operation

OperationChangeSemHandle()

TInt OperationChangeSemHandle ( ) [inline]

OperationErrorResult()

TInt & OperationErrorResult ( )

Returns error code from operation

OperationIntBuffer()

TInt & OperationIntBuffer ( ) [inline]

OperationName()

const TDesC & OperationName ( ) [inline]

OperationStartSemHandle()

TInt OperationStartSemHandle ( ) [inline]

Get semaphore handles.

OperationText()

TDes & OperationText ( ) [inline]

OperationType()

TOperation OperationType ( ) [inline]

PauseThread()

TInt PauseThread ( )

Pauses the thread

ReadParametersFromScriptFileL(const TDesC &, TInt &, TInt &, TInt &)

TInt ReadParametersFromScriptFileL ( const TDesC & aConfig,
TInt & aStackSize,
TInt & aHeapMinSize,
TInt & aHeapMaxSize
) [private]

Parse stack and heap information for TestScripter's test case (config) file.

Parameters

const TDesC & aConfig
TInt & aStackSize
TInt & aHeapMinSize
TInt & aHeapMaxSize

ReadParametersFromTestModule(const TDesC &, CTestModuleParam *&)

TInt ReadParametersFromTestModule ( const TDesC & aModuleName,
CTestModuleParam *& aTestModuleParam
) [private]

Loads dynamically testmodule and calls SetRequirements()- method for test module parameter handling.

Parameters

const TDesC & aModuleName
CTestModuleParam *& aTestModuleParam

ResolveCompletionCode(TInt, TInt)

TInt ResolveCompletionCode ( TInt aLeaveCode,
TInt aErrorCode
) [private]

Function that resolves test case completion code

Parameters

TInt aLeaveCode
TInt aErrorCode

ResumeThread()

TInt ResumeThread ( )

Resumes the thread

RunError(TInt)

TInt RunError ( TInt aError ) [virtual]

RunError derived from CActive handles errors from active handler.

Parameters

TInt aError

RunL()

void RunL ( ) [virtual]

RunL derived from CActive handles the completed requests.

RunTestCase(const TFileName &, const TInt, const RMessage2 &)

void RunTestCase ( const TFileName & aName,
const TInt aCaseNumber,
const RMessage2 & aMessage
)

Run a test case

Parameters

const TFileName & aName
const TInt aCaseNumber
const RMessage2 & aMessage

ServerThreadId()

TThreadId ServerThreadId ( ) [inline]

SetExecutionSubSession(CTestExecution *)

void SetExecutionSubSession ( CTestExecution * aExecution )

Set a new execution subsession

Parameters

CTestExecution * aExecution

SetThreadContainer(CTestThreadContainer *)

void SetThreadContainer ( CTestThreadContainer * aThread ) [inline]

Access to "shared" memory. Called from test thread'

Parameters

CTestThreadContainer * aThread

StartAndWaitOperation()

TInt StartAndWaitOperation ( ) [private]

Start and wait until operation is completed.

TestCases()

const RPointerArray < TTestCaseInfo > * TestCases ( ) const

Returns pointer to test cases

TestExecution()

CTestExecution * TestExecution ( ) [inline]

TestModuleIniFile()

const TDesC & TestModuleIniFile ( )

TestModuleName()

const TDesC & TestModuleName ( )

Member Enumerations Documentation

Enum TOperation

Enumerators

EInitializeModule
EEnumerateInThread
EExecuteTestInThread
EFreeEnumerationData
EExit

Enum TRequestType

Enumerators

ERqTestCase
ERqErrorPrint

Member Data Documentation

TInt iAllowedExitCode

TInt iAllowedExitCode [private]

CTestModuleIf::TExitReason iAllowedExitReason

CTestModuleIf::TExitReason iAllowedExitReason [private]

CTestExecution * iCTestExecution

CTestExecution * iCTestExecution [private]

CTestModule * iCTestModule

CTestModule * iCTestModule [private]

TErrorNotification iErrorPrint

TErrorNotification iErrorPrint [private]

CErrorPrintHandler * iErrorPrintHandler

CErrorPrintHandler * iErrorPrintHandler [private]

RSemaphore iErrorPrintSem

RSemaphore iErrorPrintSem [private]

TInt iErrorResult

TInt iErrorResult [private]

TBool iIsPaused

TBool iIsPaused [private]

RMessage2 iMessage

RMessage2 iMessage [private]

HBufC * iModuleNameBuffer

HBufC * iModuleNameBuffer [private]

TInt iModuleResult

TInt iModuleResult [private]

CActiveSchedulerWait * iNestedActiveScheduler

CActiveSchedulerWait * iNestedActiveScheduler [private]

RSemaphore iOperationChangeSemaphore

RSemaphore iOperationChangeSemaphore [private]

TInt iOperationIntBuffer

TInt iOperationIntBuffer [private]

TPtr iOperationName

TPtr iOperationName [private]

RSemaphore iOperationStartSemaphore

RSemaphore iOperationStartSemaphore [private]

TRequestStatus iOperationStatus

TRequestStatus iOperationStatus [private]

TBuf< 30 > iOperationText

TBuf < 30 > iOperationText [private]

TOperation iOperationType

TOperation iOperationType [private]

TThreadId iServerThreadId

TThreadId iServerThreadId [private]

RThread iThread

RThread iThread [private]

CTestThreadContainer * iThreadContainer

CTestThreadContainer * iThreadContainer [private]

CUnderTaker * iUnderTaker

CUnderTaker * iUnderTaker [private]

TBool iUpAndRunning

TBool iUpAndRunning [private]