CTestEngine Class Reference

class CTestEngine : public CSession2

Inherits from

Public Member Functions
RPointerArray< TEventMsg > &ClientEvents()
voidCloseSession()
TInt CountResources()
CTestEventController *CtlEventL(const TEventIf &, TRequestStatus &)
voidEnumerationCompleted(TInt, TInt)
voidErrorPrint(const TInt, TPtrC)
voidErrorPrint(TErrorNotificationPckg)
voidExecuteCommandL(TCommand, TDesC8 &)
voidFlushAtsLogger()
TPtrC GetDeviceResetDllName()
CTestModuleController *GetFreeOrCreateModuleControllerL(TTestInfo &, CTestModuleController **)
TInt GetIndexForNewTestModuleController(void)
TBool IsStateEventAndSet(const TName &)
voidLeaveIfErrorWithNotify(TInt, const TDesC &)
voidLeaveIfErrorWithNotify(TInt)
voidLeaveWithNotifyL(TInt, const TDesC &)
voidLeaveWithNotifyL(TInt)
CStifLogger *Logger()
CTestEngine *NewL(CTestEngineServer *)
voidNumResources(const RMessage2 &)
voidPanicClient(TTestEnginePanic, const RMessage2 &)
voidPauseAllTestCases()
TInt ReadRebootParams(TTestInfo &, TDes &, TInt &)
voidServiceL(const RMessage2 &)
TInt StifMeasurement()
RPointerArray< CTestCase > &TestCaseArray()
voidTestModuleCrash(CTestModuleController *)
TInt WriteRebootParams(TTestInfo &, TInt &, TDesC &)
Private Member Functions
CTestEngine()
voidAddConfigFileL(const RMessage2 &)
TInt AddTestCaseToTestReport(const RMessage2 &)
voidAddTestModuleL(const RMessage2 &)
voidCancelAsyncRequest(const RMessage2 &)
voidCloseLoggerSettings()
voidCloseTestEngineL(TUint)
voidConstructL(CTestEngineServer *)
voidDeleteTestCase(TUint)
TInt DisableStifMeasurement(const TDesC &)
voidDispatchMessageL(const RMessage2 &)
TInt EnableStifMeasurement(const TDesC &)
voidEnumerateTestCasesL(const RMessage2 &)
voidEventControlL(const RMessage2 &)
voidGetTestCasesL(const RMessage2 &)
voidHandleErrorNotificationL(const RMessage2 &)
voidInitEngineL(const RMessage2 &)
voidInitTestReportAndLoggerVarL()
voidLoggerSettings(const RMessage2 &)
CTestModuleController *ModuleControllerByName(const TName &)
voidNewTestCaseL(const RMessage2 &)
TInt ParseRebootParamsL()
voidParseTestModulesL(CStifParser *, CTestModuleList *, const TDesC &, const TDesC &)
voidProcessErrorQueue()
voidReadEngineDefaultsL(CStifParser *, CSTIFTestFrameworkSettings *)
voidReadTestModulesL(CStifParser *)
voidRemoveConfigFileL(const RMessage2 &)
TInt RemoveTestModuleL(const RMessage2 &)
voidSetAttributeL(const RMessage2 &)
voidSetLoggerSettings(TLoggerSettings &)
CTestCase *TestCaseByHandle(TUint, const RMessage2 &)
voidTestModuleConfigFileL(CTestModuleController *, CStifSectionParser *, TDesC &)
voidUpdateEventL(const TEventIf &)
Inherited Functions
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()
CSession2::CSession2()
CSession2::Disconnect(const RMessage2 &)
CSession2::Extension_(TUint,TAny *&,TAny *)
CSession2::ResourceCountMarkEnd(const RMessage2 &)
CSession2::ResourceCountMarkStart()
CSession2::Server()const
CSession2::ServiceError(const RMessage2 &,TInt)
CSession2::SetServer(const CServer2 *)
CSession2::~CSession2()
Inherited Enumerations
CSession2:TPanicNo
Private Attributes
TInt iCaseCount
RPointerArray< TEventMsg >iClientEvents
TBool iComplete
CObjectCon *iContainer
TInt64 iDefaultTimeout
HBufC *iDeviceResetDllName
TInt iDisableMeasurement
TInt iEnumError
TInt iEnumerateModuleCount
RMessage2 iEnumerationMessage
RMessage2 iErrorMessage
TBool iErrorMessageAvailable
RArray< TErrorNotification >iErrorQueue
TInt iIndexTestModuleControllers
HBufC *iIniFile
TBool iIsTestReportGenerated
RPointerArray< CTestModuleController >iModules
TPtrC iRebootDefaultFilename
TPtrC iRebootDefaultPath
HBufC *iRebootFilename
CRebootParams *iRebootParams
HBufC *iRebootPath
TUint iReportMode
TUint iReportOutput
TInt iResourceCount
TInt iReturn
TBool iSeparateProcesses
RSettingServer iSettingServer
RPointerArray< HBufC >iStateEvents
RPointerArray< CTestCase >iTestCaseArray
CObjectIx *iTestCases
CTestEngineServer *iTestEngineServer
CObjectIx *iTestEngineSubSessions
RPointerArray< TTestModuleVersionInfo >iTestModulesVersionInfo
CTestReport *iTestReport
TBool iUITestingSupport

Constructor & Destructor Documentation

CTestEngine()

CTestEngine()[private]

C++ default constructor.

Member Functions Documentation

AddConfigFileL(const RMessage2 &)

voidAddConfigFileL(const RMessage2 &aMessage)[private]

Adds new config file to Test Module

Parameters

const RMessage2 & aMessage

AddTestCaseToTestReport(const RMessage2 &)

TInt AddTestCaseToTestReport(const RMessage2 &aMessage)[private]

Add test case info to test report.

Parameters

const RMessage2 & aMessage

AddTestModuleL(const RMessage2 &)

voidAddTestModuleL(const RMessage2 &aMessage)[private]

Adds new Test Module

Parameters

const RMessage2 & aMessage

CancelAsyncRequest(const RMessage2 &)

voidCancelAsyncRequest(const RMessage2 &aMessage)[private]

Cancel outstanding asynchronous request

Parameters

const RMessage2 & aMessage

ClientEvents()

RPointerArray< TEventMsg > &ClientEvents()[inline]

Return client events.

CloseLoggerSettings()

voidCloseLoggerSettings()[private]

Close logger settings

CloseSession()

voidCloseSession()

Close the session to CTestEngineServer.

CloseTestEngineL(TUint)

voidCloseTestEngineL(TUintaHandle)[private]

Close Test Engine

Parameters

TUint aHandle

ConstructL(CTestEngineServer *)

voidConstructL(CTestEngineServer *aServer)[private]

By default Symbian OS constructor is private.

Parameters

CTestEngineServer * aServer

CountResources()

TInt CountResources()[virtual]

Return the number of resources owned by the session. Required by CSession if derived class implements resource mark-start and mark-end protocol.

CtlEventL(const TEventIf &, TRequestStatus &)

CTestEventController *CtlEventL(const TEventIf &aEvent,
TRequestStatus &aStatus
)

Callback to control events.

Parameters

const TEventIf & aEvent
TRequestStatus & aStatus

DeleteTestCase(TUint)

voidDeleteTestCase(TUintaHandle)[private]

Destroy the created CTestCase subsession. Cannot fail - can panic client.

Parameters

TUint aHandle

DisableStifMeasurement(const TDesC &)

TInt DisableStifMeasurement(const TDesC &aInfoType)[private]

Set measurements related information, disable measurement.

Parameters

const TDesC & aInfoType

DispatchMessageL(const RMessage2 &)

voidDispatchMessageL(const RMessage2 &aMessage)[private]

DispatchMessageL handles the messages to CTestEngineServer

Parameters

const RMessage2 & aMessage

EnableStifMeasurement(const TDesC &)

TInt EnableStifMeasurement(const TDesC &aInfoType)[private]

Set measurements related information, enable measurement.

Parameters

const TDesC & aInfoType

EnumerateTestCasesL(const RMessage2 &)

voidEnumerateTestCasesL(const RMessage2 &aMessage)[private]

Enumerates test cases

Parameters

const RMessage2 & aMessage

EnumerationCompleted(TInt, TInt)

voidEnumerationCompleted(TIntaCount,
TIntaError =  KErrNone
)

Callback to inform that enumeration of test cases is completed

Parameters

TInt aCount
TInt aError =  KErrNone

ErrorPrint(const TInt, TPtrC)

voidErrorPrint(const TIntaPriority,
TPtrCaError
)

ErrorPrint print errors. This version is used to print engine own errors.

Parameters

const TInt aPriority
TPtrC aError

ErrorPrint(TErrorNotificationPckg)

voidErrorPrint(TErrorNotificationPckgaError)

ErrorPrint print errors. This version is used to forward errors.

Parameters

TErrorNotificationPckg aError

EventControlL(const RMessage2 &)

voidEventControlL(const RMessage2 &aMessage)[private]

Event system control.

Parameters

const RMessage2 & aMessage

ExecuteCommandL(TCommand, TDesC8 &)

voidExecuteCommandL(TCommandaCommand,
TDesC8 &aParamsPckg
)

Executes command received from test case. It was created to allow test case to kill itself.

Parameters

TCommand aCommand
TDesC8 & aParamsPckg

FlushAtsLogger()

voidFlushAtsLogger()

Flush ATS logger buffers.

GetDeviceResetDllName()

TPtrC GetDeviceResetDllName()

Get device reset module's DLL name.

GetFreeOrCreateModuleControllerL(TTestInfo &, CTestModuleController **)

CTestModuleController *GetFreeOrCreateModuleControllerL(TTestInfo &aTestInfo,
CTestModuleController **aRealModuleController
)

Return free module controller specified by given parameter. If it can't be found, new one will be created.

Parameters

TTestInfo & aTestInfo
CTestModuleController ** aRealModuleController

GetIndexForNewTestModuleController(void)

TInt GetIndexForNewTestModuleController(void)

Returns new index for test module controller. This number is appended to module controller name. This method is used when option to run every test case in separate process is set to on.

Parameters

void

GetTestCasesL(const RMessage2 &)

voidGetTestCasesL(const RMessage2 &aMessage)[private]

Get test cases

Parameters

const RMessage2 & aMessage

HandleErrorNotificationL(const RMessage2 &)

voidHandleErrorNotificationL(const RMessage2 &iMessage)[private]

Handles error notifications

Parameters

const RMessage2 & iMessage

InitEngineL(const RMessage2 &)

voidInitEngineL(const RMessage2 &aMessage)[private]

Initialize the Test Engine.

Parameters

const RMessage2 & aMessage

InitTestReportAndLoggerVarL()

voidInitTestReportAndLoggerVarL()[private]

Initialize test report and logger's overwrite variables

IsStateEventAndSet(const TName &)

TBool IsStateEventAndSet(const TName &aEventName)

Callback to check state event status.

Parameters

const TName & aEventName

LeaveIfErrorWithNotify(TInt, const TDesC &)

voidLeaveIfErrorWithNotify(TIntaCode,
const TDesC &aText
)

If error leave with notify

Parameters

TInt aCode
const TDesC & aText

LeaveIfErrorWithNotify(TInt)

voidLeaveIfErrorWithNotify(TIntaCode)

If error leave with notify

Parameters

TInt aCode

LeaveWithNotifyL(TInt, const TDesC &)

voidLeaveWithNotifyL(TIntaCode,
const TDesC &aText
)

Leave with notify

Parameters

TInt aCode
const TDesC & aText

LeaveWithNotifyL(TInt)

voidLeaveWithNotifyL(TIntaCode)

Leave with notify

Parameters

TInt aCode

Logger()

CStifLogger *Logger()

Return the pointer to CStifLogger owned by CTestEngineServer

LoggerSettings(const RMessage2 &)

voidLoggerSettings(const RMessage2 &iMessage)[private]

Get Logger's overwrite parameters

Parameters

const RMessage2 & iMessage

ModuleControllerByName(const TName &)

CTestModuleController *ModuleControllerByName(const TName &aModuleName)[private]

Get module controller by name

Parameters

const TName & aModuleName

NewL(CTestEngineServer *)

CTestEngine *NewL(CTestEngineServer *aServer)[static]

NewL is two-phased constructor.

Parameters

CTestEngineServer * aServer

NewTestCaseL(const RMessage2 &)

voidNewTestCaseL(const RMessage2 &aMessage)[private]

Create CTestCase subsession.

Parameters

const RMessage2 & aMessage

NumResources(const RMessage2 &)

voidNumResources(const RMessage2 &aMessage)

NumResources is used to provide reserver resources to client.

Parameters

const RMessage2 & aMessage

PanicClient(TTestEnginePanic, const RMessage2 &)

voidPanicClient(TTestEnginePanicaPanic,
const RMessage2 &aMessage
)const

PanicClient panics the user of CTestEngine ( RTestEngine user )

Parameters

TTestEnginePanic aPanic
const RMessage2 & aMessage

ParseRebootParamsL()

TInt ParseRebootParamsL()[private]

Parse the Reboot related information from the file.

ParseTestModulesL(CStifParser *, CTestModuleList *, const TDesC &, const TDesC &)

voidParseTestModulesL(CStifParser *aParser,
CTestModuleList *aModuleList,
const TDesC &aSectionStart,
const TDesC &aSectionEnd
)[private]

Parse and search for module info and fill list of modules.

Parameters

CStifParser * aParser
CTestModuleList * aModuleList
const TDesC & aSectionStart
const TDesC & aSectionEnd

PauseAllTestCases()

voidPauseAllTestCases()

Pause all test case(s) which are/is running.

ProcessErrorQueue()

voidProcessErrorQueue()[private]

Process error queue.

ReadEngineDefaultsL(CStifParser *, CSTIFTestFrameworkSettings *)

voidReadEngineDefaultsL(CStifParser *aParser,
CSTIFTestFrameworkSettings *aSettings
)[private]

Parse Test Engine defaults from STIF initialization file.

Parameters

CStifParser * aParser
CSTIFTestFrameworkSettings * aSettings

ReadRebootParams(TTestInfo &, TDes &, TInt &)

TInt ReadRebootParams(TTestInfo &aTestInfo,
TDes &aStateDes,
TInt &aState
)

Read the Reboot related information from the file.

Parameters

TTestInfo & aTestInfo
TDes & aStateDes
TInt & aState

ReadTestModulesL(CStifParser *)

voidReadTestModulesL(CStifParser *aParser)[private]

Parse Test modules and module information from STIFTestFramework initialization file.

Parameters

CStifParser * aParser

RemoveConfigFileL(const RMessage2 &)

voidRemoveConfigFileL(const RMessage2 &aMessage)[private]

Removes config file from test module

Parameters

const RMessage2 & aMessage

RemoveTestModuleL(const RMessage2 &)

TInt RemoveTestModuleL(const RMessage2 &aMessage)[private]

Removes Test Module

Parameters

const RMessage2 & aMessage

ServiceL(const RMessage2 &)

voidServiceL(const RMessage2 &aMessage)[virtual]

ServiceL handles the messages to CTestEngineServer

Parameters

const RMessage2 & aMessage

SetAttributeL(const RMessage2 &)

voidSetAttributeL(const RMessage2 &aMessage)[private]

Sets attributes to Test Framework

Parameters

const RMessage2 & aMessage

SetLoggerSettings(TLoggerSettings &)

voidSetLoggerSettings(TLoggerSettings &aLoggerSettings)[private]

Set parsed logger's settings to TestEngine side.

Parameters

TLoggerSettings & aLoggerSettings

StifMeasurement()

TInt StifMeasurement()

Get measurements related information. Returns is measurement disable.

TestCaseArray()

RPointerArray< CTestCase > &TestCaseArray()[inline]

Return testcases.

TestCaseByHandle(TUint, const RMessage2 &)

CTestCase *TestCaseByHandle(TUintaHandle,
const RMessage2 &aMessage
)[private]

Resolve the correct CTestCase object

Parameters

TUint aHandle
const RMessage2 & aMessage

TestModuleConfigFileL(CTestModuleController *, CStifSectionParser *, TDesC &)

voidTestModuleConfigFileL(CTestModuleController *aModule,
CStifSectionParser *aSectionParser,
TDesC &aTag
)[private]

Parameters

CTestModuleController * aModule
CStifSectionParser * aSectionParser
TDesC & aTag

TestModuleCrash(CTestModuleController *)

voidTestModuleCrash(CTestModuleController *aTestModuleController)

For Recovering from serious testmodulecrash situations (KErrserverTerminated (-15)) Clones TestModuleController

Parameters

CTestModuleController * aTestModuleController

UpdateEventL(const TEventIf &)

voidUpdateEventL(const TEventIf &aEvent)[private]

Update state event list.

Parameters

const TEventIf & aEvent

WriteRebootParams(TTestInfo &, TInt &, TDesC &)

TInt WriteRebootParams(TTestInfo &aTestInfo,
TInt &aCode,
TDesC &aName
)

Write the Reboot related information to file.

Parameters

TTestInfo & aTestInfo
TInt & aCode
TDesC & aName

Member Data Documentation

TInt iCaseCount

TInt iCaseCount[private]

RPointerArray< TEventMsg > iClientEvents

RPointerArray< TEventMsg >iClientEvents[private]

TBool iComplete

TBool iComplete[private]

CObjectCon * iContainer

CObjectCon *iContainer[private]

TInt64 iDefaultTimeout

TInt64 iDefaultTimeout[private]

HBufC * iDeviceResetDllName

HBufC *iDeviceResetDllName[private]

TInt iDisableMeasurement

TInt iDisableMeasurement[private]

TInt iEnumError

TInt iEnumError[private]

TInt iEnumerateModuleCount

TInt iEnumerateModuleCount[private]

RMessage2 iEnumerationMessage

RMessage2 iEnumerationMessage[private]

RMessage2 iErrorMessage

RMessage2 iErrorMessage[private]

TBool iErrorMessageAvailable

TBool iErrorMessageAvailable[private]

RArray< TErrorNotification > iErrorQueue

RArray< TErrorNotification >iErrorQueue[private]

TInt iIndexTestModuleControllers

TInt iIndexTestModuleControllers[private]

HBufC * iIniFile

HBufC *iIniFile[private]

TBool iIsTestReportGenerated

TBool iIsTestReportGenerated[private]

RPointerArray< CTestModuleController > iModules

RPointerArray< CTestModuleController >iModules[private]

TPtrC iRebootDefaultFilename

TPtrC iRebootDefaultFilename[private]

TPtrC iRebootDefaultPath

TPtrC iRebootDefaultPath[private]

HBufC * iRebootFilename

HBufC *iRebootFilename[private]

CRebootParams * iRebootParams

CRebootParams *iRebootParams[private]

HBufC * iRebootPath

HBufC *iRebootPath[private]

TUint iReportMode

TUint iReportMode[private]

TUint iReportOutput

TUint iReportOutput[private]

TInt iResourceCount

TInt iResourceCount[private]

TInt iReturn

TInt iReturn[private]

TBool iSeparateProcesses

TBool iSeparateProcesses[private]

RSettingServer iSettingServer

RSettingServer iSettingServer[private]

RPointerArray< HBufC > iStateEvents

RPointerArray< HBufC >iStateEvents[private]

RPointerArray< CTestCase > iTestCaseArray

RPointerArray< CTestCase >iTestCaseArray[private]

CObjectIx * iTestCases

CObjectIx *iTestCases[private]

CTestEngineServer * iTestEngineServer

CTestEngineServer *iTestEngineServer[private]

CObjectIx * iTestEngineSubSessions

CObjectIx *iTestEngineSubSessions[private]

RPointerArray< TTestModuleVersionInfo > iTestModulesVersionInfo

RPointerArray< TTestModuleVersionInfo >iTestModulesVersionInfo[private]

CTestReport * iTestReport

CTestReport *iTestReport[private]

TBool iUITestingSupport

TBool iUITestingSupport[private]