stif/TestServer/inc/TestServer.h
changeset 0 a03f92240627
child 10 381827f66490
equal deleted inserted replaced
-1:000000000000 0:a03f92240627
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: This file contains the header file of the 
       
    15 * CTestServer.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef TEST_SERVER_H
       
    20 #define TEST_SERVER_H
       
    21 
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 #include "PrintQueue.h"
       
    27 #include <StifLogger.h>
       
    28 #include "Logging.h"
       
    29 #include <StifTestModule.h>
       
    30 #include <StifTestInterface.h>
       
    31 
       
    32 // CONSTANTS
       
    33 
       
    34 // KDefaultHeapSize needed for creating server thread.
       
    35 const TUint KDefaultHeapSize = 0x10000;
       
    36 const TUint KMaxHeapSize     = 0x20000;
       
    37 
       
    38 // MACROS
       
    39 
       
    40 // FUNCTION PROTOTYPES
       
    41 typedef CTestModuleBase*( *CTestInterfaceFactory )();
       
    42 
       
    43 // DATA TYPES
       
    44 
       
    45 // Panic reasons
       
    46 enum TTestServerPanic
       
    47     {
       
    48     EBadRequest,
       
    49     EBadDescriptor,
       
    50     EDescriptorNonNumeric,
       
    51     EMainSchedulerError,
       
    52     ESvrCreateServer,
       
    53     ECreateTrapCleanup,
       
    54     EBadRemove, 
       
    55     EBadSubsessionHandle,
       
    56     ENoStartupInformation,
       
    57     EEnumerateHasNotBeenCalled,
       
    58     EClosingWhileTestRunning,
       
    59     EPrintMutexNotFreed,
       
    60     EThreadMutexNotFreed,
       
    61     EEventMutexNotFreed,
       
    62     EEventArrayMutexNotFreed,
       
    63     ETestModuleMutexNotFreed,
       
    64     EInvalidCTestExecution,
       
    65     EPrintQueueBroken,
       
    66     EInvalidRequestCancel,
       
    67     EWrongEventQueueDeleteContext,
       
    68     EReInitializingTestModule,
       
    69     ETestModuleNotInitialized,
       
    70     EInvalidTestModuleOperation,
       
    71     EWrongHeapInUse,
       
    72     ENullTestModuleFunction,
       
    73     ENullTestModuleContainer,
       
    74     ENullTestModule,
       
    75     ECannotCreateEventArray,
       
    76     EPreviousRequestStillOngoing,
       
    77     ECannotOpenServerThread,
       
    78     ENullModuleSession,
       
    79     EInvalidThreadState,
       
    80     EUnknownEventCmd,
       
    81     EUnknownRemoteCmd,
       
    82     ENullTestThreadContainer,
       
    83     ENullExecution,
       
    84     EAlreadyActive,
       
    85     };
       
    86 
       
    87 
       
    88 // FUNCTION PROTOTYPES
       
    89 
       
    90 // FORWARD DECLARATIONS
       
    91 class TEvent;
       
    92 class CTestModule;
       
    93 class CTestModuleContainer;
       
    94 class CTestExecution;
       
    95 class CTestThreadContainer;
       
    96 class CErrorPrintHandler;
       
    97 class CTestThreadContainerRunnerFactory;
       
    98 
       
    99 // CLASS DECLARATION
       
   100 
       
   101 // DESCRIPTION
       
   102 // CUnderTaker class is an active object that handles thread death
       
   103 // notifications.
       
   104 class CUnderTaker 
       
   105         :public CActive
       
   106     {
       
   107 
       
   108     public:  // Enumerations
       
   109 
       
   110     private: // Enumerations
       
   111 
       
   112     public:  // Constructors and destructor
       
   113 
       
   114         /**
       
   115         * NewL is first phase of two-phased constructor.
       
   116         */
       
   117         static CUnderTaker* NewL( CTestModuleContainer* aContainer );
       
   118 
       
   119         /**
       
   120         * Destructor of CUnderTaker.
       
   121         */
       
   122         virtual ~CUnderTaker();
       
   123 
       
   124     public: // New functions
       
   125 
       
   126         /**
       
   127         * Start monitoring
       
   128         */
       
   129         TInt StartL();
       
   130 
       
   131         /**
       
   132         * Is undertaker completed?
       
   133         */
       
   134         TBool Completed();
       
   135 
       
   136 		/**
       
   137         * Sets or unsets local processing mode
       
   138         */
       
   139         void SetSynchronousMode(const TBool aMode);
       
   140 
       
   141     public: // Functions from base classes
       
   142 
       
   143         /**
       
   144         * RunL derived from CActive handles the completed requests.
       
   145         */
       
   146         void RunL();
       
   147 
       
   148         /**
       
   149         * DoCancel derived from CActive handles the Cancel
       
   150         */
       
   151         void DoCancel();
       
   152 
       
   153         /**
       
   154         * RunError derived from CActive handles errors from active handler.
       
   155         */
       
   156         TInt RunError( TInt aError );
       
   157 
       
   158     protected:  // New functions
       
   159         // None
       
   160 
       
   161     protected:  // Functions from base classes
       
   162         // None
       
   163 
       
   164     private:
       
   165 
       
   166         /** 
       
   167         * C++ default constructor.
       
   168         */
       
   169         CUnderTaker();
       
   170        
       
   171         /**
       
   172         * By default Symbian OS constructor is private.
       
   173         */
       
   174         void ConstructL( CTestModuleContainer* aContainer );
       
   175 
       
   176     public:   //Data
       
   177         // None
       
   178     
       
   179     protected:  // Data
       
   180         // None
       
   181 
       
   182     private:    // Data
       
   183          CTestModuleContainer* iModuleContainer;           // Pointer to parent
       
   184          TBool iCancelNeeded;                              // Is cancel needed?
       
   185 		 TBool iSynchronousMode;                           // In synchronous mode
       
   186         
       
   187     public:     // Friend classes
       
   188         // None
       
   189 
       
   190     protected:  // Friend classes
       
   191         // None
       
   192 
       
   193     private:    // Friend classes
       
   194         // None
       
   195 
       
   196     };
       
   197 
       
   198 
       
   199 
       
   200 
       
   201 // DESCRIPTION
       
   202 // CTestModuleContainer is a class, which contains the test execution thread
       
   203 // and interface functions to do operations in that thread context.
       
   204 class CTestModuleContainer 
       
   205        :public CActive  
       
   206     {
       
   207 
       
   208     public: // Enumerations
       
   209         enum TOperation
       
   210             {
       
   211             EInitializeModule,
       
   212             EEnumerateInThread,
       
   213             EExecuteTestInThread,
       
   214             EFreeEnumerationData,
       
   215             EExit,
       
   216             };
       
   217         
       
   218         enum TRequestType
       
   219             {
       
   220             ERqTestCase,
       
   221             ERqErrorPrint,
       
   222             };
       
   223 
       
   224     private: // Enumerations
       
   225 
       
   226     public:  // Constructors and destructor
       
   227 
       
   228         /**
       
   229         * NewL is first phase of two-phased constructor.
       
   230         */
       
   231         static CTestModuleContainer* NewL( const TDesC& aName, 
       
   232                                            CTestModule* aSession,
       
   233                                            const TDesC& aConfig );
       
   234 
       
   235         /**
       
   236         * Destructor of CTestModuleContainer.
       
   237         */
       
   238         virtual ~CTestModuleContainer();
       
   239 
       
   240 
       
   241     public: // New functions
       
   242 
       
   243         /**
       
   244         * Initialize the test module
       
   245         */
       
   246         TInt Initialize( const TFileName& aName,
       
   247                          const TBool aFirstTime );
       
   248 
       
   249         /**
       
   250         * Enumerate test cases
       
   251         */
       
   252         TInt EnumerateTestCases( const TFileName& aName );
       
   253 
       
   254 
       
   255         /**
       
   256         * Frees the enumeration data
       
   257         */
       
   258         TInt FreeEnumerationData();
       
   259 
       
   260         /**
       
   261         * Run a test case
       
   262         */
       
   263         void RunTestCase( const TFileName& aName,
       
   264                           const TInt aCaseNumber,
       
   265                           const RMessage2& aMessage );
       
   266 
       
   267 
       
   268         /**
       
   269         * Changes the operation, can fail
       
   270         */
       
   271         TInt ChangeOperation( const TOperation aOperation, 
       
   272                               const TFileName& aNameBuffer,
       
   273                               const TInt aInt );
       
   274 
       
   275         /**
       
   276         * Changes the operation
       
   277         */
       
   278 		void ChangeOperationNoError( const TOperation aOperation,
       
   279                                      const TInt aInt );
       
   280 
       
   281         /**
       
   282         * Return the operation
       
   283         */
       
   284         //@spe const TOperation Operation();
       
   285         TOperation Operation();
       
   286 
       
   287         /**
       
   288         * Set a new execution subsession
       
   289         */
       
   290         void SetExecutionSubSession( CTestExecution* aExecution );
       
   291 
       
   292         /**
       
   293         * Pauses the thread
       
   294         */
       
   295         TInt PauseThread();
       
   296 
       
   297         /**
       
   298         * Resumes the thread
       
   299         */
       
   300         TInt ResumeThread();
       
   301 
       
   302         /**
       
   303         * Returns pointer to test cases
       
   304         */
       
   305         const RPointerArray<TTestCaseInfo>* TestCases() const;
       
   306 
       
   307         /**
       
   308         * Returns error code from operation
       
   309         */
       
   310         TInt& OperationErrorResult();
       
   311 
       
   312         /**
       
   313         * Returns error code from module
       
   314         */
       
   315         TInt& ModuleResult();
       
   316 
       
   317         /**
       
   318         * Kill the thread
       
   319         */
       
   320         void KillThread( const TInt aCode );
       
   321         
       
   322         /**
       
   323         * Error print handler.
       
   324         */
       
   325         void DoErrorPrint();
       
   326 
       
   327         /**
       
   328         * Make sure that any of the test interference thread's won't stay
       
   329         * to run if test case is crashed of test interference object is not
       
   330         * deleted.
       
   331         */ 
       
   332         void KillTestinterferenceThread();
       
   333 
       
   334         /**
       
   335         * Make sure that any of the test measurement process's won't stay
       
   336         * to run if test case is crashed of test measurement object is not
       
   337         * deleted.
       
   338         */
       
   339         void KillTestMeasurement();
       
   340 
       
   341     public: 
       
   342     
       
   343         /**
       
   344         * Get semaphore handles.
       
   345         */
       
   346         TInt OperationStartSemHandle(){ return iOperationStartSemaphore.Handle(); };
       
   347         TInt OperationChangeSemHandle(){ return iOperationChangeSemaphore.Handle(); };
       
   348     
       
   349         /** 
       
   350         * Access to "shared" memory.
       
   351         * Called from test thread'
       
   352         */
       
   353         void SetThreadContainer( CTestThreadContainer* aThread )
       
   354             { iThreadContainer = aThread; };
       
   355         
       
   356         const TDesC& OperationName(){ return iOperationName; };
       
   357 
       
   358         TDes& OperationText(){ return iOperationText; };
       
   359         
       
   360         TInt& OperationIntBuffer(){ return iOperationIntBuffer; };
       
   361         
       
   362         TOperation OperationType(){ return iOperationType; };
       
   363         
       
   364         const TDesC& TestModuleName();
       
   365         const TDesC& TestModuleIniFile();
       
   366         
       
   367         CTestModuleIf::TExitReason& AllowedExitReason()
       
   368             { return iAllowedExitReason; };   
       
   369 
       
   370         TInt& AllowedExitCode(){ return iAllowedExitCode; };        
       
   371       
       
   372         TThreadId ServerThreadId(){ return iServerThreadId; };
       
   373         
       
   374         CTestExecution* TestExecution()
       
   375             { return iCTestExecution; };
       
   376 
       
   377         TRequestStatus* GetRequest( TRequestType aType );
       
   378         
       
   379         TErrorNotification& ErrorNotification(){ return iErrorPrint; };
       
   380         
       
   381         TInt ErrorPrintSemHandle(){ return iErrorPrintSem.Handle(); };
       
   382         
       
   383         /**
       
   384         * Get title of currently running test case
       
   385         */ 
       
   386         void GetTestCaseTitleL(TDes& aTestCaseTitle);
       
   387 
       
   388         /**
       
   389          * Gets pointer to test module
       
   390          */
       
   391         CTestModule* GetTestModule();        
       
   392         
       
   393     public: // Functions from base classes
       
   394 
       
   395         /**
       
   396         * RunL derived from CActive handles the completed requests.
       
   397         */
       
   398         void RunL();
       
   399 
       
   400         /**
       
   401         * DoCancel derived from CActive handles the Cancel
       
   402         */
       
   403         void DoCancel();
       
   404 
       
   405         /**
       
   406         * RunError derived from CActive handles errors from active handler.
       
   407         */
       
   408         TInt RunError( TInt aError );
       
   409 
       
   410     protected:  // New functions
       
   411 
       
   412         /**
       
   413         * By default Symbian OS constructor is private.
       
   414         */
       
   415         void ConstructL( const TDesC& aName, 
       
   416                          CTestModule* aSession,
       
   417                          const TDesC& aConfig );
       
   418 
       
   419 	private:  // New functions
       
   420 
       
   421 		/**
       
   422         * Start and wait until operation is completed.
       
   423         */
       
   424         TInt StartAndWaitOperation();
       
   425 
       
   426         /**
       
   427         * Completes operation from test execution thread or from undertaker
       
   428         */
       
   429         void Complete(  const TInt aCompletionCode );
       
   430 
       
   431         /**
       
   432         * Function that initialise module in execution thread context.
       
   433         */
       
   434         TInt InitializeModuleInThread( RLibrary& aModule );
       
   435 
       
   436         /**
       
   437         * Function that enumerates test cases in execution thread context.
       
   438         */
       
   439         TInt EnumerateInThread();
       
   440 
       
   441         /**
       
   442         * Function that frees the enumeration data in execution thread context.
       
   443         */
       
   444         void FreeEnumerationDataInThread();
       
   445 
       
   446         /**
       
   447         * Function that executes test case in execution thread context.
       
   448         */
       
   449         TInt ExecuteTestCaseInThread();
       
   450 
       
   451 		
       
   452         /**
       
   453         * Delete a test module instance
       
   454         */
       
   455 		void DeleteTestModule();
       
   456 
       
   457         /**
       
   458         * Function that resolves test case completion code
       
   459         */
       
   460         TInt ResolveCompletionCode( TInt aLeaveCode,
       
   461                                     TInt aErrorCode );
       
   462 
       
   463         /**
       
   464         * Test case execution thread thread function
       
   465         */
       
   466         static TInt ExecutionThread( TAny* aParams );
       
   467 
       
   468         /**
       
   469         * Parse stack and heap information for TestScripter's
       
   470         * test case (config) file.
       
   471         */
       
   472 		TInt ReadParametersFromScriptFileL( const TDesC& aConfig,
       
   473                                             TInt& aStackSize,
       
   474 											TInt& aHeapMinSize,
       
   475 											TInt& aHeapMaxSize );
       
   476 
       
   477         /**
       
   478         * Loads dynamically testmodule and calls SetRequirements()-
       
   479 		* method for test module parameter handling.
       
   480         */
       
   481         TInt ReadParametersFromTestModule( const TDesC& aModuleName,
       
   482 										CTestModuleParam*& aTestModuleParam );
       
   483 
       
   484         /**
       
   485         * Load test module dynamically. If loading is done succesfully
       
   486 		* then get test module's parameters according to version.
       
   487         * Verifies received parameters also.
       
   488         */
       
   489         TInt GetTestModuleParams( const TDesC& aModuleName,
       
   490                                     const TDesC& aConfig,
       
   491 									TInt& aStackSize,
       
   492 									TInt& aHeapMinSize,
       
   493 									TInt& aHeapMaxSize );
       
   494 
       
   495     protected:  // Functions from base classes
       
   496         // None
       
   497 
       
   498     private:
       
   499 
       
   500         /** 
       
   501         * C++ default constructor.
       
   502         */
       
   503         CTestModuleContainer();
       
   504 
       
   505     public:     // Data
       
   506 
       
   507     protected:  // Data
       
   508         // None
       
   509 
       
   510     private:    // Data     
       
   511         CTestExecution* iCTestExecution;         // Handle to "parent" test execution
       
   512         CTestModule* iCTestModule;               // Handle to "parent"  module
       
   513         CUnderTaker* iUnderTaker;                // Pointer to thread undertaker
       
   514         CTestThreadContainer*   iThreadContainer;// Pointer thread container
       
   515 
       
   516         RThread iThread;                         // Thread where test module lives in
       
   517         TBool iUpAndRunning;                     // Is the thread running
       
   518         TOperation iOperationType;               // What to do?
       
   519 
       
   520         RSemaphore iOperationStartSemaphore;     // Used to wait until something to do
       
   521         RSemaphore iOperationChangeSemaphore;    // Protects the operation changes
       
   522 
       
   523         TPtr iOperationName;                     // Operation descriptor buffer
       
   524         HBufC* iModuleNameBuffer;                // HBuffer for module name file;
       
   525      
       
   526         TInt iOperationIntBuffer;                // Transfers operation int to thread
       
   527 
       
   528         RMessage2 iMessage;                      // Message to complete, used in RunTestCase
       
   529 
       
   530         // Results from test module
       
   531         TInt iModuleResult;                      // Low priority result from test module
       
   532         TInt iErrorResult;                       // High priority error from operation
       
   533         TRequestStatus iOperationStatus;         // Operation ongoing?
       
   534         TThreadId iServerThreadId;               // Server thread Id. Used in completion
       
   535 		TBuf<30> iOperationText;                 // Human readable current operation for
       
   536 		
       
   537         CTestModuleIf::TExitReason iAllowedExitReason;          // Allowed exit reason
       
   538         TInt iAllowedExitCode;                   // Allowed exit code
       
   539         
       
   540         // Error print handler	    
       
   541         CErrorPrintHandler*         iErrorPrintHandler;
       
   542         
       
   543         RSemaphore      iErrorPrintSem;          // Synchonize error messages
       
   544         TErrorNotification  iErrorPrint;
       
   545 
       
   546         // Indicates is pause operation executed. This value will be checked
       
   547         // when test case is executed. Resume operation will be reset this
       
   548         // value.
       
   549         TBool  iIsPaused;
       
   550 
       
   551 		// This active scheduler is uses as a nested one        
       
   552         CActiveSchedulerWait*       iNestedActiveScheduler;
       
   553     
       
   554     public:     // Friend classes
       
   555         friend class CUnderTaker;                // Handles the thread deaths
       
   556         friend class CErrorPrintHandler;
       
   557 
       
   558     protected:  // Friend classes
       
   559         // None
       
   560 
       
   561     private:    // Friend classes
       
   562         // None
       
   563     };
       
   564 
       
   565 
       
   566 // DESCRIPTION
       
   567 // CTestServer is a server class.
       
   568 // Contains an object container index which provides subsessions with object containers.
       
   569 class CTestServer
       
   570         :public CServer2
       
   571     {
       
   572     public: // Enumerations
       
   573         enum { ETestServerPriority = CActive::EPriorityHigh };
       
   574 
       
   575     private: // Enumerations
       
   576 
       
   577     public:  // Constructors and destructor
       
   578 
       
   579         /**
       
   580         * NewL is first phase of two-phased constructor.
       
   581         */
       
   582         static CTestServer* NewL( const TFileName& aName );
       
   583 
       
   584         /**
       
   585         * Destructor of CTestServer.
       
   586         */
       
   587         ~CTestServer();
       
   588 
       
   589     public: // New functions
       
   590 
       
   591         /**
       
   592         * ThreadFunction is used to create new thread.
       
   593         */
       
   594         static TInt ThreadFunction( TAny* aStarted );
       
   595 
       
   596         /**
       
   597         * Return object container, guaranteed to produce object containers with
       
   598         * unique ids within the server.
       
   599         */
       
   600         CObjectCon* NewContainerL();
       
   601 
       
   602         /**
       
   603         * Removes a container. Needed to close session properly.
       
   604         */
       
   605         void DeleteContainer( CObjectCon* aContainer );
       
   606                     
       
   607         /**
       
   608         * Inform Server that session is closed.
       
   609         */
       
   610         void SessionClosed();
       
   611         
       
   612         /**
       
   613         * Returns module name
       
   614         */
       
   615         const TDesC& ModuleName() const;
       
   616 
       
   617         /**
       
   618         * Is module inside this server already initialised?
       
   619         */
       
   620         //@spe const TBool FirstTime() const;
       
   621         TBool FirstTime() const;
       
   622 
       
   623         /**
       
   624         * Clears the module first time flag.
       
   625         */
       
   626         void ClearFirstTime();
       
   627 
       
   628         /**
       
   629         * PanicServer panics the CTestServer
       
   630         */
       
   631         static void PanicServer( const TTestServerPanic aPanic );
       
   632 
       
   633         /**
       
   634         * GetServerThreadId for ServerStateHandler Active object usage
       
   635         */
       
   636         TInt GetServerThreadId ();
       
   637         
       
   638         /**
       
   639          * Gets CTestThreadContainerRunner pointer which is used in UI testing
       
   640          */
       
   641         CTestThreadContainerRunnerFactory* GetTestThreadContainerRunnerFactory();
       
   642                 
       
   643         /**
       
   644          * Gets information that testserver supports UI testing or not
       
   645          */
       
   646         TBool UiTesting();
       
   647         
       
   648         /**
       
   649          * Gets pointer to UiEnvProxy.
       
   650          */
       
   651         CUiEnvProxy* GetUiEnvProxy();
       
   652     public: // Functions from base classes
       
   653 
       
   654         /**
       
   655         * NewSessionL creates new CTestServer session.
       
   656         */
       
   657         CSession2* NewSessionL( const TVersion &aVersion,
       
   658                                 const RMessage2& aMessage ) const;
       
   659 
       
   660     protected:  // New functions
       
   661         // None
       
   662 
       
   663     protected:  // Functions from base classes
       
   664         // None
       
   665 
       
   666     private:
       
   667 
       
   668         /** 
       
   669         * C++ default constructor.
       
   670         */
       
   671         CTestServer();
       
   672 
       
   673         /**
       
   674         * By default Symbian OS constructor is private.
       
   675         */
       
   676         void ConstructL( const TFileName& aName );
       
   677 
       
   678     public:   //Data
       
   679         // None
       
   680     
       
   681     protected:  // Data
       
   682         // None
       
   683 
       
   684     private:    // Data
       
   685         CObjectConIx* iContainerIndex;           // Pointer to container
       
   686         TPtr iModuleName;                        // Server name
       
   687         HBufC* iModuleNameBuffer;                // HBuffer for module name file;
       
   688         TBool iFirstTime;                        // Is module previously initialized?
       
   689 
       
   690         // Container count
       
   691         TInt                    iSessionCount;
       
   692 
       
   693         TBool iUiTesting;						 // Indicates if it is testserver which supports UI testing
       
   694         CTestThreadContainerRunnerFactory* iTestThreadContainerRunnerFactory; // Pointer to CTestThreadContainerRunnerFactory
       
   695     public:     // Friend classes
       
   696         // None
       
   697 
       
   698     protected:  // Friend classes
       
   699         // None
       
   700 
       
   701     private:    // Friend classes
       
   702         // None
       
   703 
       
   704     };
       
   705 
       
   706 
       
   707 // DESCRIPTION
       
   708 // CTestModule is a session class.
       
   709 // Session for the CTestServer server, to a single client-side session
       
   710 // a session may own any number of CCounter objects
       
   711 class CTestModule
       
   712         :public CSession2
       
   713     {    
       
   714     public:
       
   715         // None
       
   716 
       
   717     private: // Enumerations
       
   718         // None
       
   719 
       
   720     public:  // Constructors and destructor
       
   721 
       
   722         /**
       
   723         * Construct a test module object.
       
   724         */
       
   725         static CTestModule* NewL( CTestServer* aServer );
       
   726 
       
   727         /**
       
   728         * Destructor
       
   729         */
       
   730         virtual ~CTestModule();
       
   731 
       
   732     public: // New functions
       
   733 
       
   734         /**
       
   735         * Dispatch message
       
   736         */
       
   737         TInt DispatchMessageL( const RMessage2& aMessage );
       
   738 
       
   739         /**
       
   740         * Create Module Session
       
   741         */
       
   742         TInt CreateModuleSessionL( const RMessage2& aMessage );
       
   743 
       
   744         /**
       
   745         * Close the session to CTestServer.
       
   746         */
       
   747         TInt CloseSession( const RMessage2& aMessage );
       
   748 
       
   749 
       
   750         /**
       
   751         * Create CTestExecution subsession.
       
   752         */
       
   753         TInt NewTestExecutionL( const RMessage2& aMessage );
       
   754 
       
   755         /**
       
   756         * Destroy the created CTestExecution subsession.
       
   757         * Cannot fail - can panic client.
       
   758         */
       
   759         void DeleteTestExecution( const TUint aHandle, const RMessage2& aMessage );
       
   760 
       
   761         /**
       
   762         * NumResources is used to provide reserver resources to client.
       
   763         */
       
   764         void NumResources( const RMessage2& aMessage );
       
   765 
       
   766         /**
       
   767         * Return the number of resources owned by the session.
       
   768         */
       
   769         TInt CountResources();
       
   770 
       
   771         /**
       
   772         * Enumerates test cases
       
   773         */
       
   774         TInt EnumerateTestCasesL( const RMessage2& aMessage );
       
   775 
       
   776         /**
       
   777         * Get test cases
       
   778         */
       
   779         TInt GetTestCasesL( const RMessage2& aMessage );
       
   780 
       
   781         /**
       
   782         * Handles error notifications
       
   783         */
       
   784         TInt HandleErrorNotificationL( const RMessage2& aMessage );
       
   785 
       
   786         /**
       
   787         * Get Server Thread Id
       
   788         */
       
   789         TInt GetServerThreadIdL( const RMessage2& aMessage );
       
   790 
       
   791 
       
   792         /**
       
   793         * Prints error notification
       
   794         */
       
   795         void ErrorPrint( const TInt aPriority, 
       
   796                          TPtrC aError );
       
   797 
       
   798         /**
       
   799         * Cancels asynchronous request
       
   800         */
       
   801         TInt CancelAsyncRequestL( const RMessage2& aMessage );
       
   802 
       
   803         /**
       
   804         * Frees a test case specific data owned by module( i.e enumeration data )
       
   805         */
       
   806         TInt FreeCaseData();
       
   807 
       
   808         /**
       
   809         * Returns case corresponding handle
       
   810         */
       
   811         CTestExecution* CaseFromHandle( const TUint aHandle, const RMessage2& aMessage ) const;
       
   812 
       
   813         /**
       
   814         * Returns module initialisation file name
       
   815         */
       
   816         const TDesC& IniName() const;
       
   817 
       
   818 		/**
       
   819         * Returns module name
       
   820         */
       
   821 		const TDesC& Name() const;
       
   822 
       
   823         /**
       
   824         * Returns a test module.
       
   825         */
       
   826         TInt GetTestModule( CTestModuleContainer*& aContainer,
       
   827                             const TDesC& aConfig );
       
   828 
       
   829         /**
       
   830         * Frees a test module.
       
   831         */
       
   832         TInt FreeTestModule( CTestModuleContainer* aModule );
       
   833 
       
   834         /**
       
   835         * Write is utility method.
       
   836         */
       
   837         void Write( const TAny* aPtr, const TDesC8& aDes, TInt anOffset = 0 );
       
   838 
       
   839         /**
       
   840         * PanicClient panics the user of CTestModule( RTestModule user )
       
   841         */
       
   842         void PanicClient( TInt aPanic, const RMessage2& aMessage ) const;
       
   843 
       
   844         /**
       
   845         * Get title of currently running test case
       
   846         */ 
       
   847         void GetTestCaseTitleL(TInt aTestCaseNumber, TDes& aTestCaseTitle);
       
   848 
       
   849         /**
       
   850          * Get pointer to test server
       
   851          */ 
       
   852          CTestServer* GetTestServer();        
       
   853         
       
   854     public: // Functions from base classes
       
   855 
       
   856         /**
       
   857         * ServiceL handles the messages to CTestServer
       
   858         */
       
   859         virtual void ServiceL( const RMessage2& aMessage );
       
   860 
       
   861 
       
   862     protected:  // New functions
       
   863         // None
       
   864 
       
   865     protected:  // Functions from base classes
       
   866         // None
       
   867 
       
   868     private:
       
   869 
       
   870         /** 
       
   871         * C++ default constructor.
       
   872         */
       
   873         CTestModule();
       
   874 
       
   875         /**
       
   876         * By default Symbian OS constructor is private.
       
   877         */
       
   878         void ConstructL( CTestServer* aServer );
       
   879 
       
   880     public:   //Data
       
   881         // None
       
   882 
       
   883     
       
   884     protected:  // Data
       
   885         // None
       
   886 
       
   887     private:    // Data
       
   888         RPointerArray<CTestModuleContainer>* iTestModuleInstances; // List of FREE test modules
       
   889         CTestServer* iTestServer;                    // Pointer to "parent"
       
   890         CObjectCon* iContainer;                  // Object container for this session
       
   891         CObjectIx* iTestExecutionHandle;         // Object index( stores CTestExecutions,
       
   892                                                  // (Unclosed)subsession handle )
       
   893 
       
   894         TInt iResourceCount;                     // Total number of resources allocated
       
   895         TPtr iIni;                               // Module initialisation( file ) name
       
   896         HBufC* iIniBuffer;                       // HBuffer for ini name file;
       
   897 
       
   898         CTestModuleContainer* iEnumerateModule;  // Module used in enumeration
       
   899 
       
   900         RMessage2 iErrorMessage;                 // Error message
       
   901 
       
   902         TBool iErrorMessageAvailable;            // Error message available?
       
   903         
       
   904         RPointerArray<TDesC> iTestCaseTitles;    //Test case titles
       
   905         
       
   906     public:     // Friend classes
       
   907         // None
       
   908 
       
   909     protected:  // Friend classes
       
   910         // None
       
   911 
       
   912     private:    // Friend classes
       
   913         // None
       
   914 
       
   915     };
       
   916 
       
   917 
       
   918 // CLASS DECLARATION
       
   919 
       
   920 // DESCRIPTION
       
   921 // CPrintHandler class is an active object that handles print
       
   922 // indication from test thread.
       
   923 class CPrintHandler 
       
   924     : public CActive
       
   925     {
       
   926 
       
   927     public:  // Enumerations
       
   928 
       
   929     private: // Enumerations
       
   930 
       
   931     public:  // Constructors and destructor
       
   932 
       
   933         /**
       
   934         * NewL is first phase of two-phased constructor.
       
   935         */
       
   936         static CPrintHandler* NewL( CTestExecution& aExecution );
       
   937 
       
   938         /**
       
   939         * Destructor of CPrintHandler.
       
   940         */
       
   941         virtual ~CPrintHandler();
       
   942 
       
   943     public: // New functions
       
   944 
       
   945         /**
       
   946         * Start monitoring
       
   947         */
       
   948         void StartL();
       
   949 
       
   950     public: // Functions from base classes
       
   951 
       
   952         /**
       
   953         * RunL derived from CActive handles the completed requests.
       
   954         */
       
   955         void RunL();
       
   956 
       
   957         /**
       
   958         * DoCancel derived from CActive handles the Cancel
       
   959         */
       
   960         void DoCancel();
       
   961 
       
   962         /**
       
   963         * RunError derived from CActive handles errors from active handler.
       
   964         */
       
   965         TInt RunError( TInt aError );
       
   966 
       
   967     protected:  // New functions
       
   968         // None
       
   969 
       
   970     protected:  // Functions from base classes
       
   971         // None
       
   972 
       
   973     private:
       
   974 
       
   975         /** 
       
   976         * C++ default constructor.
       
   977         */
       
   978         CPrintHandler( CTestExecution& aExecution );
       
   979        
       
   980         /**
       
   981         * By default Symbian OS constructor is private.
       
   982         */
       
   983         void ConstructL();
       
   984 
       
   985     public:   //Data
       
   986         // None
       
   987     
       
   988     protected:  // Data
       
   989         // None
       
   990 
       
   991     private:    // Data
       
   992          CTestExecution&        iExecution;     // Pointer to parent
       
   993         
       
   994     public:     // Friend classes
       
   995         // None
       
   996 
       
   997     protected:  // Friend classes
       
   998         // None
       
   999 
       
  1000     private:    // Friend classes
       
  1001         // None
       
  1002 
       
  1003     };
       
  1004 
       
  1005 // CLASS DECLARATION
       
  1006 
       
  1007 // DESCRIPTION
       
  1008 // CEventHandler class is an active object that handles print
       
  1009 // indication from test thread.
       
  1010 class CEventHandler 
       
  1011     : public CActive
       
  1012     {
       
  1013 
       
  1014     public:  // Enumerations
       
  1015 
       
  1016     private: // Enumerations
       
  1017 
       
  1018     public:  // Constructors and destructor
       
  1019 
       
  1020         /**
       
  1021         * NewL is first phase of two-phased constructor.
       
  1022         */
       
  1023         static CEventHandler* NewL( CTestExecution& aExecution );
       
  1024 
       
  1025         /**
       
  1026         * Destructor of CEventHandler.
       
  1027         */
       
  1028         virtual ~CEventHandler();
       
  1029 
       
  1030     public: // New functions
       
  1031 
       
  1032         /**
       
  1033         * Start monitoring
       
  1034         */
       
  1035         void StartL();
       
  1036 
       
  1037     public: // Functions from base classes
       
  1038 
       
  1039         /**
       
  1040         * RunL derived from CActive handles the completed requests.
       
  1041         */
       
  1042         void RunL();
       
  1043 
       
  1044         /**
       
  1045         * DoCancel derived from CActive handles the Cancel
       
  1046         */
       
  1047         void DoCancel();
       
  1048 
       
  1049         /**
       
  1050         * RunError derived from CActive handles errors from active handler.
       
  1051         */
       
  1052         TInt RunError( TInt aError );
       
  1053 
       
  1054     protected:  // New functions
       
  1055         // None
       
  1056 
       
  1057     protected:  // Functions from base classes
       
  1058         // None
       
  1059 
       
  1060     private:
       
  1061 
       
  1062         /** 
       
  1063         * C++ default constructor.
       
  1064         */
       
  1065         CEventHandler( CTestExecution& aExecution );
       
  1066        
       
  1067         /**
       
  1068         * By default Symbian OS constructor is private.
       
  1069         */
       
  1070         void ConstructL();
       
  1071 
       
  1072     public:   //Data
       
  1073         // None
       
  1074     
       
  1075     protected:  // Data
       
  1076         // None
       
  1077 
       
  1078     private:    // Data
       
  1079          CTestExecution&        iExecution;     // Pointer to parent
       
  1080         
       
  1081     public:     // Friend classes
       
  1082         // None
       
  1083 
       
  1084     protected:  // Friend classes
       
  1085         // None
       
  1086 
       
  1087     private:    // Friend classes
       
  1088         // None
       
  1089 
       
  1090     };
       
  1091 
       
  1092 // CLASS DECLARATION
       
  1093 
       
  1094 // DESCRIPTION
       
  1095 // CSndHandler class is an active object that handles print
       
  1096 // indication from test thread.
       
  1097 class CSndHandler 
       
  1098     : public CActive
       
  1099     {
       
  1100 
       
  1101     public:  // Enumerations
       
  1102 
       
  1103     private: // Enumerations
       
  1104 
       
  1105     public:  // Constructors and destructor
       
  1106 
       
  1107         /**
       
  1108         * NewL is first phase of two-phased constructor.
       
  1109         */
       
  1110         static CSndHandler* NewL( CTestExecution& aExecution );
       
  1111 
       
  1112         /**
       
  1113         * Destructor of CSndHandler.
       
  1114         */
       
  1115         virtual ~CSndHandler();
       
  1116 
       
  1117     public: // New functions
       
  1118 
       
  1119         /**
       
  1120         * Start monitoring
       
  1121         */
       
  1122         void StartL();
       
  1123 
       
  1124     public: // Functions from base classes
       
  1125 
       
  1126         /**
       
  1127         * RunL derived from CActive handles the completed requests.
       
  1128         */
       
  1129         void RunL();
       
  1130 
       
  1131         /**
       
  1132         * DoCancel derived from CActive handles the Cancel
       
  1133         */
       
  1134         void DoCancel();
       
  1135 
       
  1136         /**
       
  1137         * RunError derived from CActive handles errors from active handler.
       
  1138         */
       
  1139         TInt RunError( TInt aError );
       
  1140 
       
  1141     protected:  // New functions
       
  1142         // None
       
  1143 
       
  1144     protected:  // Functions from base classes
       
  1145         // None
       
  1146 
       
  1147     private:
       
  1148 
       
  1149         /** 
       
  1150         * C++ default constructor.
       
  1151         */
       
  1152         CSndHandler( CTestExecution& aExecution );
       
  1153        
       
  1154         /**
       
  1155         * By default Symbian OS constructor is private.
       
  1156         */
       
  1157         void ConstructL();
       
  1158 
       
  1159     public:   //Data
       
  1160         // None
       
  1161     
       
  1162     protected:  // Data
       
  1163         // None
       
  1164 
       
  1165     private:    // Data
       
  1166          CTestExecution&        iExecution;     // Pointer to parent
       
  1167         
       
  1168     public:     // Friend classes
       
  1169         // None
       
  1170 
       
  1171     protected:  // Friend classes
       
  1172         // None
       
  1173 
       
  1174     private:    // Friend classes
       
  1175         // None
       
  1176 
       
  1177     };
       
  1178 
       
  1179 // CLASS DECLARATION
       
  1180 
       
  1181 // DESCRIPTION
       
  1182 // CRcvHandler class is an active object that handles print
       
  1183 // indication from test thread.
       
  1184 class CRcvHandler 
       
  1185     : public CActive
       
  1186     {
       
  1187 
       
  1188     public:  // Enumerations
       
  1189 
       
  1190     private: // Enumerations
       
  1191 
       
  1192     public:  // Constructors and destructor
       
  1193 
       
  1194         /**
       
  1195         * NewL is first phase of two-phased constructor.
       
  1196         */
       
  1197         static CRcvHandler* NewL( CTestExecution& aExecution );
       
  1198 
       
  1199         /**
       
  1200         * Destructor of CRcvHandler.
       
  1201         */
       
  1202         virtual ~CRcvHandler();
       
  1203 
       
  1204     public: // New functions
       
  1205 
       
  1206         /**
       
  1207         * Start monitoring
       
  1208         */
       
  1209         void StartL();
       
  1210 
       
  1211     public: // Functions from base classes
       
  1212 
       
  1213         /**
       
  1214         * RunL derived from CActive handles the completed requests.
       
  1215         */
       
  1216         void RunL();
       
  1217 
       
  1218         /**
       
  1219         * DoCancel derived from CActive handles the Cancel
       
  1220         */
       
  1221         void DoCancel();
       
  1222 
       
  1223         /**
       
  1224         * RunError derived from CActive handles errors from active handler.
       
  1225         */
       
  1226         TInt RunError( TInt aError );
       
  1227 
       
  1228     protected:  // New functions
       
  1229         // None
       
  1230 
       
  1231     protected:  // Functions from base classes
       
  1232         // None
       
  1233 
       
  1234     private:
       
  1235 
       
  1236         /** 
       
  1237         * C++ default constructor.
       
  1238         */
       
  1239         CRcvHandler( CTestExecution& aExecution );
       
  1240        
       
  1241         /**
       
  1242         * By default Symbian OS constructor is private.
       
  1243         */
       
  1244         void ConstructL();
       
  1245 
       
  1246     public:   //Data
       
  1247         // None
       
  1248     
       
  1249     protected:  // Data
       
  1250         // None
       
  1251 
       
  1252     private:    // Data
       
  1253          CTestExecution&        iExecution;     // Pointer to parent
       
  1254         
       
  1255     public:     // Friend classes
       
  1256         // None
       
  1257 
       
  1258     protected:  // Friend classes
       
  1259         // None
       
  1260 
       
  1261     private:    // Friend classes
       
  1262         // None
       
  1263 
       
  1264     };
       
  1265         
       
  1266 // CLASS DECLARATION
       
  1267 
       
  1268 // DESCRIPTION
       
  1269 // CErrorPrintHandler class is an active object that handles print
       
  1270 // indication from test thread.
       
  1271 class CErrorPrintHandler 
       
  1272     : public CActive
       
  1273     {
       
  1274 
       
  1275     public:  // Enumerations
       
  1276 
       
  1277     private: // Enumerations
       
  1278 
       
  1279     public:  // Constructors and destructor
       
  1280 
       
  1281         /**
       
  1282         * NewL is first phase of two-phased constructor.
       
  1283         */
       
  1284         static CErrorPrintHandler* NewL( CTestModuleContainer& aContainer );
       
  1285 
       
  1286         /**
       
  1287         * Destructor of CErrorPrintHandler.
       
  1288         */
       
  1289         virtual ~CErrorPrintHandler();
       
  1290 
       
  1291     public: // New functions
       
  1292 
       
  1293         /**
       
  1294         * Start monitoring
       
  1295         */
       
  1296         void StartL();
       
  1297 
       
  1298     public: // Functions from base classes
       
  1299 
       
  1300         /**
       
  1301         * RunL derived from CActive handles the completed requests.
       
  1302         */
       
  1303         void RunL();
       
  1304 
       
  1305         /**
       
  1306         * DoCancel derived from CActive handles the Cancel
       
  1307         */
       
  1308         void DoCancel();
       
  1309 
       
  1310         /**
       
  1311         * RunError derived from CActive handles errors from active handler.
       
  1312         */
       
  1313         TInt RunError( TInt aError );
       
  1314 
       
  1315     protected:  // New functions
       
  1316         // None
       
  1317 
       
  1318     protected:  // Functions from base classes
       
  1319         // None
       
  1320 
       
  1321     private:
       
  1322 
       
  1323         /** 
       
  1324         * C++ default constructor.
       
  1325         */
       
  1326         CErrorPrintHandler( CTestModuleContainer& aContainer );
       
  1327        
       
  1328         /**
       
  1329         * By default Symbian OS constructor is private.
       
  1330         */
       
  1331         void ConstructL();
       
  1332 
       
  1333     public:   //Data
       
  1334         // None
       
  1335     
       
  1336     protected:  // Data
       
  1337         // None
       
  1338 
       
  1339     private:    // Data
       
  1340          CTestModuleContainer&      iContainer;     // Pointer to parent
       
  1341         
       
  1342     public:     // Friend classes
       
  1343         // None
       
  1344 
       
  1345     protected:  // Friend classes
       
  1346         // None
       
  1347 
       
  1348     private:    // Friend classes
       
  1349         // None
       
  1350 
       
  1351     };
       
  1352 
       
  1353 // CLASS DECLARATION
       
  1354 
       
  1355 // DESCRIPTION
       
  1356 // CTestInterferenceHandler class is an active object that handles test
       
  1357 // interference
       
  1358 NONSHARABLE_CLASS( CInterferenceHandler ) 
       
  1359     : public CActive
       
  1360     {
       
  1361 
       
  1362     public:  // Enumerations
       
  1363 
       
  1364     private: // Enumerations
       
  1365 
       
  1366     public:  // Constructors and destructor
       
  1367 
       
  1368         /**
       
  1369         * NewL is first phase of two-phased constructor.
       
  1370         */
       
  1371         static CInterferenceHandler* NewL( CTestExecution& aExecution );
       
  1372 
       
  1373         /**
       
  1374         * Destructor of CInterferenceHandler.
       
  1375         */
       
  1376         virtual ~CInterferenceHandler();
       
  1377 
       
  1378     public: // New functions
       
  1379 
       
  1380         /**
       
  1381         * Start monitoring
       
  1382         */
       
  1383         void StartL();
       
  1384 
       
  1385     public: // Functions from base classes
       
  1386 
       
  1387         /**
       
  1388         * RunL derived from CActive handles the completed requests.
       
  1389         */
       
  1390         void RunL();
       
  1391 
       
  1392         /**
       
  1393         * DoCancel derived from CActive handles the Cancel
       
  1394         */
       
  1395         void DoCancel();
       
  1396 
       
  1397         /**
       
  1398         * RunError derived from CActive handles errors from active handler.
       
  1399         */
       
  1400         TInt RunError( TInt aError );
       
  1401 
       
  1402     protected:  // New functions
       
  1403         // None
       
  1404 
       
  1405     protected:  // Functions from base classes
       
  1406         // None
       
  1407 
       
  1408     private:
       
  1409 
       
  1410         /** 
       
  1411         * C++ default constructor.
       
  1412         */
       
  1413         CInterferenceHandler( CTestExecution& aExecution );
       
  1414        
       
  1415         /**
       
  1416         * By default Symbian OS constructor is private.
       
  1417         */
       
  1418         void ConstructL();
       
  1419 
       
  1420     public:   //Data
       
  1421         // None
       
  1422     
       
  1423     protected:  // Data
       
  1424         // None
       
  1425 
       
  1426     private:    // Data
       
  1427          CTestExecution&        iExecution;     // Pointer to parent
       
  1428         
       
  1429     public:     // Friend classes
       
  1430         // None
       
  1431 
       
  1432     protected:  // Friend classes
       
  1433         // None
       
  1434 
       
  1435     private:    // Friend classes
       
  1436         // None
       
  1437 
       
  1438     };
       
  1439 
       
  1440 
       
  1441 // DESCRIPTION
       
  1442 // CMeasurementHandler class is an active object that handles test
       
  1443 // measurement
       
  1444 NONSHARABLE_CLASS( CMeasurementHandler ) 
       
  1445     : public CActive
       
  1446     {
       
  1447 
       
  1448     public:  // Enumerations
       
  1449 
       
  1450     private: // Enumerations
       
  1451 
       
  1452     public:  // Constructors and destructor
       
  1453 
       
  1454         /**
       
  1455         * NewL is first phase of two-phased constructor.
       
  1456         */
       
  1457         static CMeasurementHandler* NewL( CTestExecution& aExecution );
       
  1458 
       
  1459         /**
       
  1460         * Destructor of CMeasurementHandler.
       
  1461         */
       
  1462         virtual ~CMeasurementHandler();
       
  1463 
       
  1464     public: // New functions
       
  1465 
       
  1466         /**
       
  1467         * Start monitoring
       
  1468         */
       
  1469         void StartL();
       
  1470 
       
  1471     public: // Functions from base classes
       
  1472 
       
  1473         /**
       
  1474         * RunL derived from CActive handles the completed requests.
       
  1475         */
       
  1476         void RunL();
       
  1477 
       
  1478         /**
       
  1479         * DoCancel derived from CActive handles the Cancel
       
  1480         */
       
  1481         void DoCancel();
       
  1482 
       
  1483         /**
       
  1484         * RunError derived from CActive handles errors from active handler.
       
  1485         */
       
  1486         TInt RunError( TInt aError );
       
  1487 
       
  1488     protected:  // New functions
       
  1489         // None
       
  1490 
       
  1491     protected:  // Functions from base classes
       
  1492         // None
       
  1493 
       
  1494     private:
       
  1495 
       
  1496         /** 
       
  1497         * C++ default constructor.
       
  1498         */
       
  1499         CMeasurementHandler( CTestExecution& aExecution );
       
  1500 
       
  1501         /**
       
  1502         * By default Symbian OS constructor is private.
       
  1503         */
       
  1504         void ConstructL();
       
  1505 
       
  1506     public:   //Data
       
  1507         // None
       
  1508 
       
  1509     protected:  // Data
       
  1510         // None
       
  1511 
       
  1512     private:    // Data
       
  1513 
       
  1514         // Pointer to test execution side
       
  1515         CTestExecution&        iExecution;
       
  1516 
       
  1517     public:     // Friend classes
       
  1518         // None
       
  1519 
       
  1520     protected:  // Friend classes
       
  1521         // None
       
  1522 
       
  1523     private:    // Friend classes
       
  1524         // None
       
  1525 
       
  1526     };
       
  1527 
       
  1528 /**
       
  1529 * Check is module TestScripter. Does parsing and returns new module name and
       
  1530 * error codes(Needed operations when creating server sessions to TestScripter).
       
  1531 */
       
  1532 TInt CheckModuleName( TFileName aModuleName, TFileName& aNewModuleName );
       
  1533 
       
  1534 /**
       
  1535 * Remove optional index appended to module name.
       
  1536 * If it is found (@ char) then set new module name without it.
       
  1537 * This feature is used when iSeparateProcesses is set in TestEngine.
       
  1538 */
       
  1539 void RemoveOptionalIndex(const TDesC& aModuleName, TDes& aNewModuleName);
       
  1540 
       
  1541 // DESCRIPTION
       
  1542 // CEventHandler class is an active object that handles print
       
  1543 // indication from test thread.
       
  1544 NONSHARABLE_CLASS(CCommandHandler)
       
  1545     : public CActive
       
  1546     {
       
  1547 
       
  1548     public:  // Enumerations
       
  1549 
       
  1550     private: // Enumerations
       
  1551 
       
  1552     public:  // Constructors and destructor
       
  1553 
       
  1554         /**
       
  1555         * NewL is first phase of two-phased constructor.
       
  1556         */
       
  1557         static CCommandHandler* NewL(CTestExecution& aExecution);
       
  1558 
       
  1559         /**
       
  1560         * Destructor of CCommandHandler.
       
  1561         */
       
  1562         virtual ~CCommandHandler();
       
  1563 
       
  1564     public: // New functions
       
  1565 
       
  1566         /**
       
  1567         * Start monitoring
       
  1568         */
       
  1569         void StartL();
       
  1570 
       
  1571     public: // Functions from base classes
       
  1572 
       
  1573         /**
       
  1574         * RunL derived from CActive handles the completed requests.
       
  1575         */
       
  1576         void RunL();
       
  1577 
       
  1578         /**
       
  1579         * DoCancel derived from CActive handles the Cancel
       
  1580         */
       
  1581         void DoCancel();
       
  1582 
       
  1583         /**
       
  1584         * RunError derived from CActive handles errors from active handler.
       
  1585         */
       
  1586         TInt RunError(TInt aError);
       
  1587 
       
  1588     protected:  // New functions
       
  1589         // None
       
  1590 
       
  1591     protected:  // Functions from base classes
       
  1592         // None
       
  1593 
       
  1594     private:
       
  1595 
       
  1596         /**
       
  1597         * C++ default constructor.
       
  1598         */
       
  1599         CCommandHandler(CTestExecution& aExecution);
       
  1600 
       
  1601         /**
       
  1602         * By default Symbian OS constructor is private.
       
  1603         */
       
  1604         void ConstructL();
       
  1605 
       
  1606     public:   //Data
       
  1607         // None
       
  1608 
       
  1609     protected:  // Data
       
  1610         // None
       
  1611 
       
  1612     private:    // Data
       
  1613          CTestExecution&        iExecution;     // Pointer to parent
       
  1614 
       
  1615     public:     // Friend classes
       
  1616         // None
       
  1617 
       
  1618     protected:  // Friend classes
       
  1619         // None
       
  1620 
       
  1621     private:    // Friend classes
       
  1622         // None
       
  1623 
       
  1624     };
       
  1625 
       
  1626 #endif // TEST_SERVER_H
       
  1627     
       
  1628 // End of File