stif/TestEngine/inc/TestCaseController.h
changeset 0 a03f92240627
child 16 8f8df8006c40
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 * CTestCaseController, the CTestProgressNotifier and the 
       
    16 * CTestEventNotifier.
       
    17 *
       
    18 */
       
    19 
       
    20 #ifndef TEST_CASE_CONTROLLER_H
       
    21 #define TEST_CASE_CONTROLLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 #include <stifinternal/TestServerClient.h>
       
    27 #include <atslogger.h>
       
    28 #include "TestEngine.h"
       
    29 #include "TestCallBack.h"
       
    30 
       
    31 #include "StifHWReset.h"
       
    32 
       
    33 // CONSTANTS
       
    34 // None
       
    35 
       
    36 // MACROS
       
    37 // None
       
    38 
       
    39 // DATA TYPES
       
    40 // None
       
    41 
       
    42 // FUNCTION PROTOTYPES
       
    43 // None
       
    44 typedef CStifHWReset*( *CTestInterfaceFactory )();
       
    45 
       
    46 // FORWARD DECLARATIONS
       
    47 class CTestModuleController;
       
    48 class CTestReport;
       
    49 class CTestCaseTimeout;
       
    50 
       
    51 // CLASS DECLARATION
       
    52 
       
    53 // DESCRIPTION
       
    54 // CTestCaseController is an active object used for running the test case
       
    55 // using the RTestExecution API.
       
    56 class CTestCaseController
       
    57         : public CActive
       
    58     {
       
    59     public:     // Enumerations
       
    60         // None
       
    61 
       
    62     private:    // Enumerations
       
    63 
       
    64         // TTestCaseStatus defines the status of test case
       
    65         enum TTestCaseStatus
       
    66             {
       
    67             ETestCaseIdle,
       
    68             ETestCaseRunning,
       
    69             ETestCaseCompleted,
       
    70             ETestCaseTimeout,
       
    71             ETestCaseSuicided, //test case has killed itself
       
    72             };
       
    73 
       
    74     public:     // Constructors and destructor
       
    75 
       
    76         /**
       
    77         * Two-phased constructor.
       
    78         */
       
    79         static CTestCaseController* NewL( CTestEngine* aEngine,
       
    80             CTestReport* aTestReport,
       
    81             CAtsLogger& aAtsLogger,
       
    82             RTestExecution aTestExecution, 
       
    83             const TTestInfo& aTestInfo );
       
    84 
       
    85         /**
       
    86         * Destructor.
       
    87         */
       
    88         ~CTestCaseController();
       
    89 
       
    90     public:     // New functions
       
    91 
       
    92         /**
       
    93         * StartL starts the CTestCaseController active object.
       
    94         */
       
    95         void StartL( const RMessage2& aMessage );
       
    96 
       
    97         /**
       
    98         * Timeouts a testcase
       
    99         */
       
   100         void Timeout();
       
   101 
       
   102         /**
       
   103         * Kills a testcase
       
   104         */
       
   105         void Suicide(TStopExecutionType aType, TInt aCode);
       
   106 
       
   107     public:     // Functions from base classes
       
   108 
       
   109         /**
       
   110         * RunL derived from CActive handles the completed requests.
       
   111         */
       
   112         void RunL();
       
   113 
       
   114         /**
       
   115         * DoCancel derived from CActive handles the Cancel
       
   116         */
       
   117         void DoCancel();
       
   118 
       
   119         /**
       
   120         * RunError derived from CActive handles errors from active handler.
       
   121         */
       
   122         TInt RunError( TInt aError );
       
   123         
       
   124         /**
       
   125         * Get testcase info(test module, config file, test case, etc).
       
   126         */
       
   127         void GetTestCaseInfo( TTestInfo& aTestInfo );
       
   128 
       
   129     protected:  // New functions
       
   130         // None
       
   131 
       
   132     protected:  // Functions from base classes
       
   133         // None
       
   134 
       
   135     private:
       
   136 
       
   137         /**
       
   138         * By default Symbian OS constructor is private.
       
   139         */
       
   140         void ConstructL();
       
   141 
       
   142         /**
       
   143         * Parametric C++ constructor.
       
   144         */
       
   145         CTestCaseController( CTestEngine* aEngine, 
       
   146                              CTestReport* aTestReport,
       
   147                              CAtsLogger& aAtsLogger,
       
   148                              RTestExecution aTestExecution,
       
   149                              const TTestInfo& aTestInfo );
       
   150         
       
   151         /**
       
   152         * Generates XML log about the test case.
       
   153         */
       
   154         void GenerateXmlLogL();
       
   155 
       
   156     public:     // Data
       
   157         // None
       
   158     
       
   159     protected:  // Data
       
   160         // None
       
   161 
       
   162     private:    // Data
       
   163 
       
   164         // Pointer to CTestEngine
       
   165         CTestEngine*        iEngine;
       
   166 
       
   167         // Pointer to Test Report
       
   168         CTestReport*        iTestReport;
       
   169 
       
   170         // Handle to RTestExecution
       
   171         RTestExecution      iTestExecution;
       
   172 
       
   173         // Pointer to timeout handler
       
   174         CTestCaseTimeout*    iTimeout;
       
   175 
       
   176         // Test Info
       
   177         TTestInfo           iTestInfo;
       
   178 
       
   179         // Internal state
       
   180         TTestCaseStatus     iState;
       
   181 
       
   182         // Test Result
       
   183         TFullTestResult     iResult;
       
   184         TFullTestResultPckg iResultPckg;
       
   185 
       
   186         // Message to be completed when case is finished
       
   187         RMessage2            iMessage;
       
   188 
       
   189         // AtsLogger
       
   190         CAtsLogger&         iAtsLogger;
       
   191 
       
   192         // RDebug logging for testcase status
       
   193         CStifLogger*        iRDebugLogger;
       
   194 
       
   195         // Stop execution type
       
   196         TStopExecutionType  iStopExecutionType;
       
   197 
       
   198     public:     // Friend classes
       
   199         // None
       
   200 
       
   201     protected:  // Friend classes
       
   202         // None
       
   203 
       
   204     private:    // Friend classes
       
   205 
       
   206         friend class CTestRemoteCmdNotifier;
       
   207 
       
   208     };
       
   209 
       
   210 // DESCRIPTION
       
   211 // CTestProgressNotifier is an active object used for notifications called from
       
   212 // Test Module using the RTestExecution API.
       
   213 class CTestProgressNotifier
       
   214         : public CActive
       
   215     {
       
   216     public:     // Enumerations
       
   217         // None
       
   218 
       
   219     private:    // Enumerations
       
   220 
       
   221         // TTestProgressStatus defines the status of notification
       
   222         enum TTestProgressStatus
       
   223             {
       
   224             ETestProgressIdle,
       
   225             ETestProgressPending,
       
   226             ETestProgressCompleted
       
   227             };
       
   228 
       
   229     public:     // Constructors and destructor
       
   230 
       
   231         /**
       
   232         * Two-phased constructor.
       
   233         */
       
   234         static CTestProgressNotifier* NewL( CTestEngine* aEngine, 
       
   235                              RTestExecution aTestExecution );
       
   236 
       
   237         /**
       
   238         * Destructor.
       
   239         */
       
   240         ~CTestProgressNotifier();
       
   241 
       
   242     public:     // New functions
       
   243 
       
   244         /**
       
   245         * StartL starts the CTestProgressNotifier active object.
       
   246         */
       
   247         void StartL( const RMessage2& aMessage );
       
   248 
       
   249     public:     // Functions from base classes
       
   250 
       
   251         /**
       
   252         * RunL derived from CActive handles the completed requests.
       
   253         */
       
   254         void RunL();
       
   255 
       
   256         /**
       
   257         * DoCancel derived from CActive handles the Cancel
       
   258         */
       
   259         void DoCancel();
       
   260 
       
   261         /**
       
   262         * RunError derived from CActive handles errors from active handler.
       
   263         */
       
   264         TInt RunError( TInt aError );
       
   265 
       
   266     protected:  // New functions
       
   267         // None
       
   268 
       
   269     protected:  // Functions from base classes
       
   270         // None
       
   271 
       
   272     private:
       
   273 
       
   274         /**
       
   275         * By default Symbian OS constructor is private.
       
   276         */
       
   277         void ConstructL();
       
   278 
       
   279         /**
       
   280         * Parametric C++ constructor.
       
   281         */
       
   282         CTestProgressNotifier( CTestEngine* aEngine, 
       
   283                                RTestExecution aTestExecution );
       
   284 
       
   285     public:     // Data
       
   286         // None
       
   287 
       
   288     protected:  // Data
       
   289         // None
       
   290 
       
   291     private:    // Data
       
   292 
       
   293         // Pointer to CTestEngine
       
   294         CTestEngine*        iEngine;
       
   295 
       
   296         // Handle to RTestExecution
       
   297         RTestExecution      iTestExecution;
       
   298 
       
   299         // Internal state
       
   300         TTestProgressStatus iState;
       
   301 
       
   302         // Test Progress
       
   303         TTestProgress       iProgress;
       
   304         TTestProgressPckg   iProgressPckg;
       
   305 
       
   306         // Message to be completed when notification is completed
       
   307         RMessage2           iMessage;
       
   308         
       
   309     public:     // Friend classes
       
   310         // None
       
   311 
       
   312     protected:  // Friend classes
       
   313         // None
       
   314 
       
   315     private:    // Friend classes
       
   316         // None
       
   317 
       
   318     };
       
   319 
       
   320 // DESCRIPTION
       
   321 // CTestEventNotifier is an active object used for event notify from
       
   322 // Test Module using the RTestExecution API.
       
   323 class CTestEventNotifier
       
   324         : public CActive
       
   325     {
       
   326     public:     // Enumerations
       
   327         // None
       
   328 
       
   329     private:    // Enumerations
       
   330 
       
   331         // TTestEventStatus defines the status of notification
       
   332         enum TTestEventStatus
       
   333             {
       
   334             ETestEventIdle,
       
   335             ETestEventPending,
       
   336             ETestEventCompleted
       
   337             };
       
   338 
       
   339     public:     // Constructors and destructor
       
   340 
       
   341         /**
       
   342         * Two-phased constructor.
       
   343         */
       
   344         static CTestEventNotifier* NewL( CTestEngine* aEngine,  
       
   345             RTestExecution aTestExecution );
       
   346 
       
   347         /**
       
   348         * Destructor.
       
   349         */
       
   350         ~CTestEventNotifier();
       
   351         
       
   352     public:     // New functions
       
   353 
       
   354         /**
       
   355         * StartL starts the CTestEventNotifier active object.
       
   356         */
       
   357         void Start();
       
   358 
       
   359         /**
       
   360         * For event control.
       
   361         */
       
   362         void CtlEvent( const TEventIf& aEvent, TRequestStatus& aStatus );
       
   363 
       
   364 		/**
       
   365 		* Check if CtlEvent should be called
       
   366 		*/
       
   367         TBool CheckCtlEvent( const TEventIf& aEvent );
       
   368 
       
   369     public:     // Functions from base classes
       
   370 
       
   371         /**
       
   372         * RunL derived from CActive handles the completed requests.
       
   373         */
       
   374         void RunL();
       
   375 
       
   376         /**
       
   377         * DoCancel derived from CActive handles the cancel
       
   378         */
       
   379         void DoCancel();
       
   380 
       
   381         /**
       
   382         * RunError derived from CActive handles errors from active handler.
       
   383         */
       
   384         TInt RunError( TInt aError );
       
   385 
       
   386     protected:      // New functions
       
   387         // None
       
   388 
       
   389     protected:  // Functions from base classes
       
   390         // None
       
   391 
       
   392     private:
       
   393 
       
   394         /**
       
   395         * By default Symbian OS constructor is private.
       
   396         */
       
   397         void ConstructL();
       
   398 
       
   399         /**
       
   400         * Parametric C++ constructor.
       
   401         */
       
   402         CTestEventNotifier( CTestEngine* aEngine,
       
   403              RTestExecution aTestExecution);
       
   404 
       
   405     public:     // Data
       
   406         // None
       
   407 
       
   408     protected:  // Data
       
   409         // None
       
   410 
       
   411     private:    // Data
       
   412 
       
   413         // Pointer to CTestEngine
       
   414         CTestEngine* iEngine;
       
   415 
       
   416         // Handle to RTestExecution
       
   417         RTestExecution iTestExecution;
       
   418 
       
   419         // Internal state
       
   420         TTestEventStatus iState;
       
   421 
       
   422         // Event interface
       
   423         TEventIf iEvent;
       
   424         TEventIfPckg iEventPckg;
       
   425         TEventIf iEventNotify;
       
   426         TEventIfPckg iEventNotifyPckg;
       
   427 
       
   428         // Event array
       
   429         RPointerArray<HBufC> iEventArray;
       
   430 
       
   431         // Associated event controller
       
   432         CTestEventController* iController;
       
   433 
       
   434     public:     // Friend classes
       
   435         // None
       
   436 
       
   437     protected:  // Friend classes
       
   438         // None
       
   439 
       
   440     private:    // Friend classes
       
   441         // None
       
   442 
       
   443     };
       
   444 
       
   445 // DESCRIPTION
       
   446 // CTestEventController is used for event controlling from
       
   447 // TestEngine.
       
   448 class CTestEventController
       
   449         : public CBase
       
   450     {
       
   451     public:     // Enumerations
       
   452         // None
       
   453 
       
   454     private:    // Enumerations
       
   455 
       
   456     public:     // Constructors and destructor
       
   457 
       
   458         /**
       
   459         * Two-phased constructor.
       
   460         */
       
   461         static CTestEventController* NewL( CTestEngine* aEngine,
       
   462                                            const TEventIf& aEvent,
       
   463                                            TRequestStatus* aStatus );
       
   464   
       
   465         static CTestEventController* NewL( CTestEngine* aEngine,
       
   466                                            const TEventIf& aEvent,
       
   467                                            RMessage2& aMessage );
       
   468 
       
   469         /**
       
   470         * Destructor.
       
   471         */
       
   472         ~CTestEventController();
       
   473 
       
   474     public:     // New functions
       
   475         /**
       
   476         * Event complete.
       
   477         */ 
       
   478         void EventComplete();
       
   479 
       
   480     public:     // Functions from base classes
       
   481 
       
   482     protected:  // New functions
       
   483         // None
       
   484 
       
   485     protected:  // Functions from base classes
       
   486         // None
       
   487 
       
   488     private:
       
   489 
       
   490         /**
       
   491         * By default Symbian OS constructor is private.
       
   492         */
       
   493         void ConstructL( TRequestStatus* aStatus );
       
   494 
       
   495         /**
       
   496         * By default Symbian OS constructor is private.
       
   497         */
       
   498         void ConstructL( RMessage2& aMessage );
       
   499 
       
   500         /**
       
   501         * Parametric C++ constructor.
       
   502         */
       
   503         CTestEventController( CTestEngine* aEngine, const TEventIf& aEvent );
       
   504 
       
   505         /**
       
   506         * Check all events.
       
   507         */ 
       
   508         TBool CheckEventsL();
       
   509 
       
   510         /**
       
   511         * Check client events.
       
   512         */ 
       
   513         TBool CheckClientEventsL();
       
   514 
       
   515         /**
       
   516         * Check testcase events.
       
   517         */ 
       
   518         TBool CheckTestcaseEventsL(); 
       
   519 
       
   520         /**
       
   521         * Callback for event controller.
       
   522         */ 
       
   523         static TInt EventCallBack( TAny* aTestEventController );
       
   524 
       
   525     public:     // Data
       
   526         // None
       
   527     
       
   528     protected:  // Data
       
   529         // None
       
   530 
       
   531     private:    // Data
       
   532 
       
   533         // Pointer to CTestEngine
       
   534         CTestEngine*    iEngine;
       
   535 
       
   536         // Either of these is completed when ready
       
   537         // If aRequestStatus exists, it is completed,
       
   538         // otherwise aMessage is completed.
       
   539         TRequestStatus* iRequestStatus;
       
   540         RMessage2        iMessage;
       
   541 
       
   542         // Event interface
       
   543         TEventIf iEvent;
       
   544         TEventIfPckg iEventPckg;
       
   545 
       
   546         // Number of active event commands
       
   547         TInt iActiveEventCmds;
       
   548         
       
   549         RPointerArray<CCallBack> iEventCallBacks;
       
   550 
       
   551     public:     // Friend classes
       
   552         // None
       
   553 
       
   554     protected:  // Friend classes
       
   555         // None
       
   556 
       
   557     private:    // Friend classes
       
   558         // None
       
   559 
       
   560     };
       
   561 
       
   562 // DESCRIPTION
       
   563 // CTestCaseTimeout is used for time controlling
       
   564 class CTestCaseTimeout
       
   565         : public CActive
       
   566     {
       
   567     public:     // Enumerations
       
   568         // None
       
   569 
       
   570     private:    // Enumerations
       
   571         // None
       
   572          
       
   573     public:     // Constructors and destructor
       
   574         
       
   575         /**
       
   576         * Two-phased constructor.
       
   577         */
       
   578         static CTestCaseTimeout* NewL( CTestCaseController* aCase,
       
   579                      TTimeIntervalMicroSeconds aTimeout );
       
   580 
       
   581         /**
       
   582         * Destructor.
       
   583         */
       
   584         ~CTestCaseTimeout();
       
   585         
       
   586     public:     // New functions
       
   587         
       
   588         /**
       
   589         * Starts timeout counting
       
   590         */
       
   591         void Start();
       
   592 
       
   593     public:     // Functions from base classes
       
   594 
       
   595         /**
       
   596         * RunL derived from CActive handles the completed requests.
       
   597         */
       
   598         void RunL();
       
   599 
       
   600         /**
       
   601         * DoCancel derived from CActive handles the cancel
       
   602         */
       
   603         void DoCancel();
       
   604 
       
   605         /**
       
   606         * RunError derived from CActive handles errors from active handler.
       
   607         */
       
   608         TInt RunError( TInt aError );
       
   609 
       
   610     protected:  // New functions
       
   611         // None
       
   612 
       
   613     protected:  // Functions from base classes
       
   614         // None
       
   615 
       
   616     private:
       
   617 
       
   618         /**
       
   619         * By default Symbian OS constructor is private.
       
   620         */
       
   621         void ConstructL(CTestCaseController* aCase,
       
   622                TTimeIntervalMicroSeconds aTimeout );
       
   623 
       
   624         /**
       
   625         * C++ constructor.
       
   626         */
       
   627         CTestCaseTimeout();
       
   628 
       
   629     public:     // Data
       
   630         // None
       
   631     
       
   632     protected:  // Data
       
   633         // None
       
   634 
       
   635     private:    // Data
       
   636         CTestCaseController* iCase;
       
   637         TTimeIntervalMicroSeconds iTimeout;
       
   638         RTimer iTimer;
       
   639         
       
   640         // Storage for testcase timeout.
       
   641         TTime iTestCaseTimeout;
       
   642 
       
   643     public:     // Friend classes
       
   644         // None
       
   645 
       
   646     protected:  // Friend classes
       
   647         // None
       
   648 
       
   649     private:    // Friend classes
       
   650         // None
       
   651 
       
   652     };
       
   653     
       
   654 // DESCRIPTION
       
   655 // CTestProgressNotifier is an active object used for notifications called from
       
   656 // Test Module using the RTestExecution API.
       
   657 class CTestRemoteCmdNotifier
       
   658         : public CActive
       
   659     {
       
   660     public:     // Enumerations
       
   661         // None
       
   662 
       
   663     private:    // Enumerations
       
   664 
       
   665         // TTestProgressStatus defines the status of notification
       
   666         enum TTestProgressStatus
       
   667             {
       
   668             ETestProgressIdle,
       
   669             ETestProgressPending,
       
   670             ETestProgressCompleted
       
   671             };
       
   672 
       
   673     public:     // Constructors and destructor
       
   674 
       
   675         /**
       
   676         * Two-phased constructor.
       
   677         */
       
   678         static CTestRemoteCmdNotifier* NewL( CTestEngine* aEngine, 
       
   679                              RTestExecution aTestExecution ,
       
   680                              CTestCaseController* aTestCaseController,
       
   681                              CAtsLogger& aAtsLogger );
       
   682 
       
   683         /**
       
   684         * Destructor.
       
   685         */
       
   686         ~CTestRemoteCmdNotifier();
       
   687 
       
   688     public:     // New functions
       
   689 
       
   690         /**
       
   691         * StartL starts the CTestRemoteCmdNotifier active object.
       
   692         */
       
   693         //void StartL( const RMessage& aMessage );
       
   694 
       
   695         /**
       
   696         * EnableReceive prepares to start active object
       
   697         */
       
   698         void EnableReceive( const RMessage2& aMessage );
       
   699 
       
   700         /**
       
   701         * GetReceivedMsg get received message.
       
   702         */
       
   703         void GetReceivedMsg( const RMessage2& aMessage );
       
   704 
       
   705         /**
       
   706         * Start starts the CTestCaseController active object.
       
   707         */
       
   708         void Start( const RMessage2& aMessage );
       
   709 
       
   710         /**
       
   711         * CancelReq cancels the request.
       
   712         */
       
   713         void CancelReq();
       
   714 
       
   715     public:     // Functions from base classes
       
   716 
       
   717         /**
       
   718         * RunL derived from CActive handles the completed requests.
       
   719         */
       
   720         void RunL();
       
   721 
       
   722         /**
       
   723         * DoCancel derived from CActive handles the Cancel
       
   724         */
       
   725         void DoCancel();
       
   726 
       
   727         /**
       
   728         * RunError derived from CActive handles errors from active handler.
       
   729         */
       
   730         TInt RunError( TInt aError );
       
   731 
       
   732     protected:  // New functions
       
   733         // None
       
   734 
       
   735     protected:  // Functions from base classes
       
   736         // None
       
   737 
       
   738     private:
       
   739 
       
   740         /**
       
   741         * By default Symbian OS constructor is private.
       
   742         */
       
   743         void ConstructL();
       
   744 
       
   745         /**
       
   746         * Parametric C++ constructor.
       
   747         */
       
   748         CTestRemoteCmdNotifier( CTestEngine* aEngine, 
       
   749                                RTestExecution aTestExecution,
       
   750                                CTestCaseController* aTestCaseController,
       
   751                                CAtsLogger& aAtsLogger );
       
   752 
       
   753         /**
       
   754         * Loads dynamically reset module.
       
   755         */
       
   756         TInt DynamicResetModule( CTestModuleIf::TRebootType aResetType );
       
   757 
       
   758     public:     // Data
       
   759         // None
       
   760 
       
   761     protected:  // Data
       
   762         // None
       
   763 
       
   764     private:    // Data
       
   765 
       
   766         // Pointer to CTestEngine
       
   767         CTestEngine*        iEngine;
       
   768 
       
   769         // Handle to RTestExecution
       
   770         RTestExecution      iTestExecution;
       
   771 
       
   772         // Internal state
       
   773         TTestProgressStatus iState;
       
   774 
       
   775         // Remote command's definition
       
   776         TStifCommand          iRemoteType;
       
   777         TStifCommandPckg      iRemoteTypePckg;
       
   778                 
       
   779         TInt                    iMsgSize;              
       
   780         TPckg<TInt>             iMsgSizePckg;              
       
   781 
       
   782         // Message to be completed when notification is completed
       
   783         RMessage2           iMessage;
       
   784         
       
   785         HBufC8*             iReceivedMsg;
       
   786 
       
   787         TInt                iRebootCode;
       
   788         TName               iRebootName;
       
   789 
       
   790         // Pointer to CTestCaseController
       
   791         CTestCaseController* iTestCaseController;
       
   792 
       
   793         TBool               iMessageAvail;
       
   794         
       
   795         CAtsLogger&         iAtsLogger;
       
   796 
       
   797     public:     // Friend classes
       
   798         // None
       
   799 
       
   800     protected:  // Friend classes
       
   801         // None
       
   802 
       
   803     private:    // Friend classes
       
   804         // None
       
   805 
       
   806     };
       
   807 
       
   808 // DESCRIPTION
       
   809 // CTestCommandNotifier is an active object used for command notify from
       
   810 // Test Module using the RTestExecution API.
       
   811 // It was created to allow test case to kill itself.
       
   812 class CTestCommandNotifier: public CActive
       
   813     {
       
   814     public:     // Enumerations
       
   815         // None
       
   816 
       
   817     private:    // Enumerations
       
   818         // None
       
   819 
       
   820     public:     // Constructors and destructor
       
   821 
       
   822         /**
       
   823         * Two-phased constructor.
       
   824         */
       
   825         static CTestCommandNotifier* NewL(CTestEngine* aEngine, RTestExecution aTestExecution);
       
   826 
       
   827         /**
       
   828         * Destructor.
       
   829         */
       
   830         ~CTestCommandNotifier();
       
   831 
       
   832     public:     // New functions
       
   833 
       
   834         /**
       
   835         * StartL starts the CTestCommandNotifier active object.
       
   836         */
       
   837         void Start();
       
   838 
       
   839     public:     // Functions from base classes
       
   840 
       
   841         /**
       
   842         * RunL derived from CActive handles the completed requests.
       
   843         */
       
   844         void RunL();
       
   845 
       
   846         /**
       
   847         * DoCancel derived from CActive handles the cancel
       
   848         */
       
   849         void DoCancel();
       
   850 
       
   851         /**
       
   852         * RunError derived from CActive handles errors from active handler.
       
   853         */
       
   854         TInt RunError(TInt aError);
       
   855 
       
   856     protected:      // New functions
       
   857         // None
       
   858 
       
   859     protected:  // Functions from base classes
       
   860         // None
       
   861 
       
   862     private:
       
   863 
       
   864         /**
       
   865         * By default Symbian OS constructor is private.
       
   866         */
       
   867         void ConstructL();
       
   868 
       
   869         /**
       
   870         * Parametric C++ constructor.
       
   871         */
       
   872         CTestCommandNotifier(CTestEngine* aEngine, RTestExecution aTestExecution);
       
   873 
       
   874     public:     // Data
       
   875         // None
       
   876 
       
   877     protected:  // Data
       
   878         // None
       
   879 
       
   880     private:    // Data
       
   881 
       
   882         // Pointer to CTestEngine
       
   883         CTestEngine*     iEngine;
       
   884 
       
   885         // Handle to RTestExecution
       
   886         RTestExecution   iTestExecution;
       
   887 
       
   888         // Command to be sent
       
   889         TCommand                        iCommand;
       
   890         TCommandPckg                    iCommandPckg;
       
   891         TBuf8<KMaxCommandParamsLength2>  iParamsPckg;
       
   892 
       
   893     public:     // Friend classes
       
   894         // None
       
   895 
       
   896     protected:  // Friend classes
       
   897         // None
       
   898 
       
   899     private:    // Friend classes
       
   900         // None
       
   901 
       
   902     };
       
   903 
       
   904 
       
   905 #endif // TEST_CASE_CONTROLLER_H
       
   906 
       
   907 // End of File