stif/ATSInterface/inc/ATSInterfaceRunner.h
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     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 * CATSInterfaceRunner.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef ATS_INTERFACE_RUNNER_H
       
    20 #define ATS_INTERFACE_RUNNER_H
       
    21 
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 #include "ATSInterface.h"
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // Interval for timer printing
       
    31 const TInt KPrintInterval = 1000000;
       
    32 
       
    33 // MACROS
       
    34 // None
       
    35 
       
    36 // DATA TYPES
       
    37 // None
       
    38 
       
    39 // FUNCTION PROTOTYPES
       
    40 // None
       
    41 
       
    42 
       
    43 // FORWARD DECLARATIONS
       
    44 // None
       
    45 
       
    46 
       
    47 // CLASS DECLARATION
       
    48 
       
    49 
       
    50 // DESCRIPTION
       
    51 // CATSInterfaceRunner is a class that is used to run test cases using
       
    52 // STIF Test Framework.
       
    53 
       
    54 class CATSInterfaceRunner
       
    55         : public CActive
       
    56     {
       
    57     public: // Enumerations
       
    58         // None
       
    59 
       
    60     private: // Enumerations
       
    61         // None
       
    62 
       
    63     public: // Constructors and destructor
       
    64 
       
    65         /**
       
    66         * NewL is two-phased constructor.
       
    67         */
       
    68         static CATSInterfaceRunner* NewL( CATSInterface* aATSInterface,
       
    69              TTestInfo& aTestInfo );
       
    70 
       
    71         /**
       
    72         * Destructor of CATSInterfaceRunner.
       
    73         */
       
    74         ~CATSInterfaceRunner();
       
    75 
       
    76     public: // New functions
       
    77 
       
    78         /**
       
    79         * Run Tests.
       
    80         */
       
    81         TInt RunTestsL();
       
    82 
       
    83         /**
       
    84         * Start testing.
       
    85         */
       
    86         void StartTestL();
       
    87 
       
    88     public: // Functions from base classes
       
    89 
       
    90         /**
       
    91         * From CActive RunL handles request completion.
       
    92         */
       
    93         void RunL();
       
    94 
       
    95         /**
       
    96         * From CActive DoCancel handles request cancellation.
       
    97         */
       
    98         void DoCancel();
       
    99 
       
   100         /**
       
   101         * From CActive RunError handles error situations.
       
   102         */
       
   103         TInt RunError( TInt aError );
       
   104 
       
   105     protected: // New functions
       
   106         // None
       
   107 
       
   108     protected: // Functions from base classes
       
   109         // None
       
   110 
       
   111     private: // New functions
       
   112 
       
   113         /** 
       
   114         * C++ default constructor.
       
   115         */
       
   116         CATSInterfaceRunner( CATSInterface* aATSInterface,
       
   117             TTestInfo& aTestInfo );
       
   118 
       
   119         /**
       
   120         * By default Symbian OS constructor is private.
       
   121         */
       
   122         void ConstructL();
       
   123 
       
   124 
       
   125     public: //Data
       
   126         // None
       
   127     
       
   128     protected: // Data
       
   129         // None
       
   130 
       
   131     private: // Data
       
   132         
       
   133         // Pointer to ATSInterface
       
   134         CATSInterface*                  iATSInterface;
       
   135 
       
   136         // Handle to Test Engine Server
       
   137         RTestEngineServer               iTestEngineServ;
       
   138 
       
   139         // Handle to Test Engine
       
   140         RTestEngine                     iTestEngine;
       
   141 
       
   142         // Handle to Test Case
       
   143         RTestCase                       iTestCase;
       
   144 
       
   145         // Test info and package
       
   146         TTestInfo                       iTestInfo;
       
   147         TTestInfoPckg                   iTestInfoPckg;
       
   148 
       
   149         // Test result and package
       
   150         TFullTestResult                 iFullTestResult;
       
   151         TFullTestResultPckg             iFullTestResultPckg;
       
   152 
       
   153     public: // Friend classes
       
   154         // None
       
   155 
       
   156     protected: // Friend classes
       
   157         // None
       
   158 
       
   159     private: // Friend classes
       
   160         // None
       
   161 
       
   162     };
       
   163 
       
   164 
       
   165 // DESCRIPTION
       
   166 // CActiveTimer is used to print running seconds to Console window
       
   167 class CActiveTimer
       
   168         : public CTimer
       
   169     {
       
   170     public: // Enumerations
       
   171         // None
       
   172 
       
   173     private: // Enumerations
       
   174         // None
       
   175 
       
   176     public: // Constructors and destructor
       
   177 
       
   178         /**
       
   179         * NewL is two-phased constructor.
       
   180         */
       
   181         static CActiveTimer* NewL( CConsoleBase* aConsole );
       
   182 
       
   183         /**
       
   184         * Destructor of CActiveTimer.
       
   185         */
       
   186         ~CActiveTimer();
       
   187 
       
   188     public: // New functions
       
   189 
       
   190         /**
       
   191         * Start timer.
       
   192         */
       
   193         void StartL();
       
   194 
       
   195     public: // Functions from base classes
       
   196 
       
   197         /**
       
   198         * From CActive RunL handles request completion.
       
   199         */
       
   200         void RunL();
       
   201 
       
   202         /**
       
   203         * From CActive DoCancel handles request cancellation.
       
   204         */
       
   205         void DoCancel();
       
   206 
       
   207     protected: // New functions
       
   208         // None
       
   209 
       
   210     protected: // Functions from base classes
       
   211         // None
       
   212 
       
   213     private: // New functions
       
   214 
       
   215         /** 
       
   216         * C++ default constructor.
       
   217         */
       
   218         CActiveTimer( CConsoleBase* aConsole );
       
   219 
       
   220         /**
       
   221         * By default Symbian OS constructor is private.
       
   222         */
       
   223         void ConstructL();
       
   224 
       
   225 
       
   226     public: // Data
       
   227         // None
       
   228     
       
   229     protected: // Data
       
   230         // None
       
   231 
       
   232     private: // Data
       
   233         
       
   234         // Pointer to Console
       
   235         CConsoleBase*                   iConsole;
       
   236 
       
   237         // Start Time
       
   238         TTime                           iStartTime;
       
   239 
       
   240         // Console position
       
   241         TInt                            iXPos;
       
   242         TInt                            iYPos;
       
   243 
       
   244     public: // Friend classes
       
   245         // None
       
   246 
       
   247     protected: // Friend classes
       
   248         // None
       
   249 
       
   250     private: // Friend classes
       
   251         // None
       
   252 
       
   253     };
       
   254 
       
   255 #endif // ATS_INTERFACE_RUNNER_H
       
   256 
       
   257 // End of File