stif/inc/TestModuleInfo.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 * CTestModuleInfo class. The class was created to keep module names, 
       
    16 * ini files and test case configuration files.
       
    17 *
       
    18 */
       
    19 
       
    20 #ifndef TESTMODULEINFO_H
       
    21 #define TESTMODULEINFO_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <StifLogger.h>
       
    26 
       
    27 // CONSTANTS
       
    28 // None
       
    29 
       
    30 // MACROS
       
    31 // None
       
    32 
       
    33 // DATA TYPES
       
    34 // None
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 // None
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 // None
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 // DESCRIPTION
       
    45 // Class with information about configuration (test case) file.
       
    46 class CTestCaseFileInfo
       
    47     :public CBase
       
    48     {
       
    49     public: // Enumerations
       
    50 
       
    51     private: // Enumerations
       
    52 
       
    53     public:  // Constructors and destructor
       
    54         /**
       
    55         * NewL.
       
    56         */
       
    57         static CTestCaseFileInfo* NewL(TDesC& aCfgFileName, CStifLogger* aLogger);
       
    58 
       
    59         /**
       
    60         * C++ destructor.
       
    61         */
       
    62         virtual ~CTestCaseFileInfo();
       
    63 
       
    64     private: // Constructors and destructor
       
    65         /**
       
    66         * C++ constructor.
       
    67         */
       
    68         CTestCaseFileInfo();
       
    69 
       
    70         /**
       
    71         * By default Symbian OS constructor is private.
       
    72         */
       
    73         void ConstructL(TDesC& aCfgFileName, CStifLogger* aLogger);
       
    74 
       
    75     public: // New functions
       
    76         /**
       
    77         * Set configuration file as already checked.
       
    78         */
       
    79         IMPORT_C void SetChecked(void);
       
    80 
       
    81         /**
       
    82         * Return if config file has been checked.
       
    83         */
       
    84         TBool IsChecked(void);
       
    85 
       
    86         /**
       
    87         * Get module name.
       
    88         */
       
    89         IMPORT_C TInt GetCfgFileName(TDes& aCfgFileName);
       
    90 
       
    91     protected:  // New functions
       
    92 
       
    93     private:    // New functions
       
    94 
       
    95     public:     // Data
       
    96 
       
    97     protected:  // Data
       
    98 
       
    99     private:    // Data
       
   100         //Config file name
       
   101         HBufC* iCfgFileName;
       
   102 
       
   103         //Was checked
       
   104         TBool iChecked;
       
   105 
       
   106         // Logger instance
       
   107         CStifLogger* iLogger;
       
   108 
       
   109     public:     // Friend classes
       
   110 
       
   111     protected:  // Friend classes
       
   112 
       
   113     private:    // Friend classes
       
   114     };
       
   115 
       
   116 // DESCRIPTION
       
   117 // Class with information about test modules.
       
   118 class CTestModuleInfo
       
   119     :public CBase
       
   120     {
       
   121     public: // Enumerations
       
   122 
       
   123     private: // Enumerations
       
   124 
       
   125     public:  // Constructors and destructor
       
   126         /**
       
   127         * NewL.
       
   128         */
       
   129         static CTestModuleInfo* NewL(TDesC& aModuleName, CStifLogger* aLogger);
       
   130 
       
   131         /**
       
   132         * C++ destructor.
       
   133         */
       
   134         virtual ~CTestModuleInfo();
       
   135 
       
   136     private: // Constructors and destructor
       
   137         /**
       
   138         * C++ constructor.
       
   139         */
       
   140         CTestModuleInfo();
       
   141 
       
   142         /**
       
   143         * By default Symbian OS constructor is private.
       
   144         */
       
   145         void ConstructL(TDesC& aModuleName, CStifLogger* aLogger);
       
   146 
       
   147     public: // New functions
       
   148         /**
       
   149         * Set initialization file name.
       
   150         */
       
   151         IMPORT_C TInt SetIniFile(TDesC& aIniFileName);
       
   152 
       
   153         /**
       
   154         * Add configuration (test case) file name to array.
       
   155         */
       
   156         IMPORT_C TInt AddCfgFile(TDesC& aCfgFileName);
       
   157 
       
   158         /**
       
   159         * Get number of test case files.
       
   160         */
       
   161         IMPORT_C TInt CountCfgFiles(void);
       
   162 
       
   163         /**
       
   164         * Get module name.
       
   165         */
       
   166         IMPORT_C TInt GetModuleName(TDes& aModuleName);
       
   167 
       
   168         /**
       
   169         * Get ini file.
       
   170         */
       
   171         IMPORT_C TInt GetIniFileName(TDes& aIniFileName);
       
   172 
       
   173         /**
       
   174         * Get cfg file.
       
   175         */
       
   176         IMPORT_C TInt GetCfgFileName(TInt aIndex, TDes& aCfgFileName);
       
   177 
       
   178         /**
       
   179         * Get first unchecked config file.
       
   180         */
       
   181         CTestCaseFileInfo* GetUncheckedCfgFile(void);
       
   182 
       
   183     protected:  // New functions
       
   184 
       
   185     private:    // New functions
       
   186 
       
   187     public:     // Data
       
   188 
       
   189     protected:  // Data
       
   190 
       
   191     private:    // Data
       
   192         //Module name
       
   193         HBufC* iModuleName;
       
   194 
       
   195         //Initialization file
       
   196         HBufC* iIniFileName;
       
   197 
       
   198         //Array of cfg files
       
   199         RPointerArray<CTestCaseFileInfo> iCfgFiles;
       
   200 
       
   201         // Logger instance
       
   202         CStifLogger* iLogger;
       
   203 
       
   204     public:     // Friend classes
       
   205 
       
   206     protected:  // Friend classes
       
   207 
       
   208     private:    // Friend classes
       
   209     };
       
   210 
       
   211 // DESCRIPTION
       
   212 // Class with list of test modules.
       
   213 class CTestModuleList
       
   214     :public CBase
       
   215     {
       
   216     public: // Enumerations
       
   217 
       
   218     private: // Enumerations
       
   219 
       
   220     public:  // Constructors and destructor
       
   221         /**
       
   222         * NewL.
       
   223         */
       
   224         IMPORT_C static CTestModuleList* NewL(CStifLogger* aLogger);
       
   225 
       
   226         /**
       
   227         * C++ destructor.
       
   228         */
       
   229         IMPORT_C virtual ~CTestModuleList();
       
   230 
       
   231     private: // Constructors and destructor
       
   232         /**
       
   233         * C++ constructor.
       
   234         */
       
   235         CTestModuleList();
       
   236 
       
   237         /**
       
   238         * By default Symbian OS constructor is private.
       
   239         */
       
   240         void ConstructL(CStifLogger* aLogger);
       
   241 
       
   242     public: // New functions
       
   243         /**
       
   244         * Add test module to list.
       
   245         */
       
   246         IMPORT_C TInt AddTestModule(TDesC& aModuleName);
       
   247 
       
   248         /**
       
   249         * Get number of test modules.
       
   250         */
       
   251         IMPORT_C TInt Count(void);
       
   252 
       
   253         /**
       
   254         * Get module.
       
   255         */
       
   256         IMPORT_C CTestModuleInfo* GetModule(TDesC& aModuleName);
       
   257 
       
   258         /**
       
   259         * Get module.
       
   260         */
       
   261         IMPORT_C CTestModuleInfo* GetModule(TInt aIndex);
       
   262 
       
   263         /**
       
   264         * Get first unchecked test case file (module: testscripter and testcombiner).
       
   265         */
       
   266         IMPORT_C CTestCaseFileInfo* GetUncheckedCfgFile(void);
       
   267 
       
   268     protected:  // New functions
       
   269 
       
   270     private:    // New functions
       
   271 
       
   272     public:     // Data
       
   273 
       
   274     protected:  // Data
       
   275 
       
   276     private:    // Data
       
   277         //Array of test modules
       
   278         RPointerArray<CTestModuleInfo> iTestModules;
       
   279 
       
   280         // Logger instance
       
   281         CStifLogger* iLogger;
       
   282 
       
   283     public:     // Friend classes
       
   284 
       
   285     protected:  // Friend classes
       
   286 
       
   287     private:    // Friend classes
       
   288     };
       
   289 
       
   290 #endif      // TESTMODULEINFO_H
       
   291 
       
   292 // End of File