testexecfw/stf/stfui/atsui/inc/ATSInterfaceRunner.h
changeset 2 8bb370ba6d1d
equal deleted inserted replaced
1:bbd31066657e 2:8bb370ba6d1d
       
     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
       
   137         RTestEngine                     iTestEngine;
       
   138 
       
   139         // Handle to Test Case
       
   140         RTestCase                       iTestCase;
       
   141 
       
   142         // Test info and package
       
   143         TTestInfo                       iTestInfo;
       
   144         TTestInfoPckg                   iTestInfoPckg;
       
   145 
       
   146         // Test result and package
       
   147         TFullTestResult                 iFullTestResult;
       
   148         TFullTestResultPckg             iFullTestResultPckg;
       
   149 
       
   150     public: // Friend classes
       
   151         // None
       
   152 
       
   153     protected: // Friend classes
       
   154         // None
       
   155 
       
   156     private: // Friend classes
       
   157         // None
       
   158 
       
   159     };
       
   160 
       
   161 
       
   162 // DESCRIPTION
       
   163 // CActiveTimer is used to print running seconds to Console window
       
   164 class CActiveTimer
       
   165         : public CTimer
       
   166     {
       
   167     public: // Enumerations
       
   168         // None
       
   169 
       
   170     private: // Enumerations
       
   171         // None
       
   172 
       
   173     public: // Constructors and destructor
       
   174 
       
   175         /**
       
   176         * NewL is two-phased constructor.
       
   177         */
       
   178         static CActiveTimer* NewL( CConsoleBase* aConsole );
       
   179 
       
   180         /**
       
   181         * Destructor of CActiveTimer.
       
   182         */
       
   183         ~CActiveTimer();
       
   184 
       
   185     public: // New functions
       
   186 
       
   187         /**
       
   188         * Start timer.
       
   189         */
       
   190         void StartL();
       
   191 
       
   192     public: // Functions from base classes
       
   193 
       
   194         /**
       
   195         * From CActive RunL handles request completion.
       
   196         */
       
   197         void RunL();
       
   198 
       
   199         /**
       
   200         * From CActive DoCancel handles request cancellation.
       
   201         */
       
   202         void DoCancel();
       
   203 
       
   204     protected: // New functions
       
   205         // None
       
   206 
       
   207     protected: // Functions from base classes
       
   208         // None
       
   209 
       
   210     private: // New functions
       
   211 
       
   212         /** 
       
   213         * C++ default constructor.
       
   214         */
       
   215         CActiveTimer( CConsoleBase* aConsole );
       
   216 
       
   217         /**
       
   218         * By default Symbian OS constructor is private.
       
   219         */
       
   220         void ConstructL();
       
   221 
       
   222 
       
   223     public: // Data
       
   224         // None
       
   225     
       
   226     protected: // Data
       
   227         // None
       
   228 
       
   229     private: // Data
       
   230         
       
   231         // Pointer to Console
       
   232         CConsoleBase*                   iConsole;
       
   233 
       
   234         // Start Time
       
   235         TTime                           iStartTime;
       
   236 
       
   237         // Console position
       
   238         TInt                            iXPos;
       
   239         TInt                            iYPos;
       
   240 
       
   241     public: // Friend classes
       
   242         // None
       
   243 
       
   244     protected: // Friend classes
       
   245         // None
       
   246 
       
   247     private: // Friend classes
       
   248         // None
       
   249 
       
   250     };
       
   251 
       
   252 #endif // ATS_INTERFACE_RUNNER_H
       
   253     
       
   254 // End of File