serviceapifw_plat/liw_criteria_api/tsrc/inc/liwtestcases.h
changeset 57 61b27eec6533
parent 45 7aa6007702af
equal deleted inserted replaced
45:7aa6007702af 57:61b27eec6533
     1 /*
       
     2 * Copyright (c) 2002 - 2007 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 the License "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:       ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef LIWTESTCASES_H
       
    26 #define LIWTESTCASES_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include <StifLogger.h>
       
    30 #include <TestScripterInternal.h>
       
    31 #include <StifTestModule.h>
       
    32 #include <TestclassAssert.h>
       
    33 #include <liwservicehandler.h>
       
    34 #include <rtsecmgrscriptsession.h>
       
    35 
       
    36 #include <eikapp.h>
       
    37 #include <eikdoc.h>
       
    38 #include <e32std.h>
       
    39 #include <coeccntx.h>
       
    40 #include <aknViewAppUi.h>
       
    41 #include <akntabgrp.h>
       
    42 #include <aknnavide.h>
       
    43 #include <AknTabObserver.h>
       
    44 
       
    45 #include  "liw_async_testcase.h"
       
    46 
       
    47 
       
    48 // CONSTANTS
       
    49 //const ?type ?constant_var = ?constant;
       
    50 
       
    51 // MACROS
       
    52 //#define ?macro ?macro_def
       
    53 #define TEST_CLASS_VERSION_MAJOR 0
       
    54 #define TEST_CLASS_VERSION_MINOR 0
       
    55 #define TEST_CLASS_VERSION_BUILD 0
       
    56 
       
    57 // Logging path
       
    58 _LIT( KliwtestcasesLogPath, "\\logs\\testframework\\liwtestcases\\" ); 
       
    59 // Log file
       
    60 _LIT( KliwtestcasesLogFile, "liwtestcases.txt" ); 
       
    61 _LIT( KliwtestcasesLogFileWithTitle, "liwtestcases_[%S].txt" );
       
    62 
       
    63 // FUNCTION PROTOTYPES
       
    64 //?type ?function_name(?arg_list);
       
    65 
       
    66 // FORWARD DECLARATIONS
       
    67 //class ?FORWARD_CLASSNAME;
       
    68 class Cliwtestcases;
       
    69 
       
    70 // DATA TYPES
       
    71 //enum ?declaration
       
    72 //typedef ?declaration
       
    73 //extern ?data_type;
       
    74 
       
    75 // CLASS DECLARATION
       
    76 
       
    77 /**
       
    78 *  Cliwtestcases test class for STIF Test Framework TestScripter.
       
    79 *  ?other_description_lines
       
    80 *
       
    81 *  @lib ?library
       
    82 *  @since ?Series60_version
       
    83 */
       
    84 NONSHARABLE_CLASS(Cliwtestcases) : public CScriptBase, public MLiwNotifyCallback, public MSecMgrPromptHandler
       
    85     {
       
    86     public:  // Constructors and destructor
       
    87 
       
    88         /**
       
    89         * Two-phased constructor.
       
    90         */
       
    91         static Cliwtestcases* NewL( CTestModuleIf& aTestModuleIf );
       
    92 
       
    93         /**
       
    94         * Destructor.
       
    95         */
       
    96         virtual ~Cliwtestcases();
       
    97 
       
    98     public: // New functions
       
    99 
       
   100         /**
       
   101         * ?member_description.
       
   102         * @since ?Series60_version
       
   103         * @param ?arg1 ?description
       
   104         * @return ?description
       
   105         */
       
   106         //?type ?member_function( ?type ?arg1 );
       
   107         
       
   108     public: // Functions from base classes
       
   109 
       
   110         /**
       
   111         * From CScriptBase Runs a script line.
       
   112         * @since ?Series60_version
       
   113         * @param aItem Script line containing method name and parameters
       
   114         * @return Symbian OS error code
       
   115         */
       
   116         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   117         
       
   118     public: // Functions from base classes
       
   119 
       
   120         TInt Prompt(const RCapabilityArray& /*aCapsToCheck*/,CScript& /*aScript*/)
       
   121         {
       
   122             return EAccessNok;
       
   123         }
       
   124     
       
   125         TInt Prompt(const RCapabilityArray& /*aCapsToCheck*/,RCapabilityArray& /*aCapsNotMatching*/, CScript& /*aScript*/)
       
   126         {
       
   127             return EAccessNok;
       
   128         }
       
   129         
       
   130         TInt Prompt(RPromptDataList& aPromptDataList , TExecutableID /*aExecID = KAnonymousScript*/)
       
   131         {
       
   132            // CEikonEnv::Static()->InfoMsg(_L("Custom Prompt"));
       
   133             
       
   134             for(TInt i(0);i!=aPromptDataList.Count();++i)
       
   135             {
       
   136                 aPromptDataList[i]->SetUserSelection(RTUserPrompt_OneShot);
       
   137                 //aPromptDataList[i]->iUserSelection = RTUserPrompt_OneShot;
       
   138             }
       
   139             
       
   140             return EAccessOk;
       
   141         }
       
   142        
       
   143        void SetPromptOption(TSecMgrPromptUIOption)
       
   144         {
       
   145             
       
   146         }
       
   147        
       
   148        TSecMgrPromptUIOption PromptOption() const
       
   149         {
       
   150             return RTPROMPTUI_DEFAULT;
       
   151         }
       
   152         
       
   153        TInt HandleNotifyL(
       
   154            TInt aCmdId,
       
   155            TInt aEventId,
       
   156            CLiwGenericParamList& aEventParamList,
       
   157            const CLiwGenericParamList& aInParamList);
       
   158 
       
   159     protected:  // New functions
       
   160 
       
   161         /**
       
   162         * ?member_description.
       
   163         * @since ?Series60_version
       
   164         * @param ?arg1 ?description
       
   165         * @return ?description
       
   166         */
       
   167         //?type ?member_function( ?type ?arg1 );
       
   168 
       
   169     protected:  // Functions from base classes
       
   170 
       
   171         /**
       
   172         * From ?base_class ?member_description
       
   173         */
       
   174         //?type ?member_function();
       
   175 
       
   176     private:
       
   177 
       
   178         /**
       
   179         * C++ default constructor.
       
   180         */
       
   181         Cliwtestcases( CTestModuleIf& aTestModuleIf );
       
   182 
       
   183         /**
       
   184         * By default Symbian 2nd phase constructor is private.
       
   185         */
       
   186         void ConstructL();
       
   187 
       
   188         // Prohibit copy constructor if not deriving from CBase.
       
   189         // ?classname( const ?classname& );
       
   190         // Prohibit assigment operator if not deriving from CBase.
       
   191         // ?classname& operator=( const ?classname& );
       
   192 
       
   193         /**
       
   194         * Frees all resources allocated from test methods.
       
   195         * @since ?Series60_version
       
   196         */
       
   197         void Delete();
       
   198 
       
   199         /**
       
   200         * Test methods are listed below. 
       
   201         */
       
   202 
       
   203         /**
       
   204         * Example test method.
       
   205         * @since ?Series60_version
       
   206         * @param aItem Script line containing parameters.
       
   207         * @return Symbian OS error code.
       
   208         */
       
   209         virtual TInt ExampleL( CStifItemParser& aItem );
       
   210 		virtual TBool LIW_DATA_TYPES_001();
       
   211 		virtual TBool LIW_DATA_TYPES_002();
       
   212 		virtual TBool LIW_DATA_TYPES_003();
       
   213 		virtual TBool LIW_DATA_TYPES_004();
       
   214 		virtual TBool LIW_DATA_TYPES_005();
       
   215 		virtual TBool LIW_DATA_TYPES_006();
       
   216         virtual TBool LIW_DATA_TYPES_007();
       
   217         virtual TBool LIW_DATA_TYPES_008();
       
   218         virtual TBool LIW_DATA_TYPES_009();
       
   219         virtual TBool LIW_DATA_TYPES_010();
       
   220 		
       
   221         virtual TBool LIW_DATA_TYPES_011();
       
   222        virtual TBool LIW_DATA_TYPES_012();
       
   223        
       
   224        //List comparision
       
   225        virtual TBool LIW_DATA_TYPES_013();
       
   226        
       
   227        //Map comparison
       
   228        virtual TBool LIW_DATA_TYPES_014();
       
   229        
       
   230        //Negative case for TLiwVariant::Get
       
   231        virtual TBool LIW_DATA_TYPES_015();
       
   232        
       
   233        //Negative case for TLiwVariant::AsXYZ interfaces
       
   234        virtual TBool LIW_DATA_TYPES_016();
       
   235        
       
   236        //ServiceCmdStr on integeral service commmand ID
       
   237        virtual TBool LIW_DATA_TYPES_017();
       
   238        virtual TBool LIW_DATA_TYPES_018();
       
   239        
       
   240        //HasCriteria check
       
   241        virtual TBool LIW_DATA_TYPES_019();
       
   242        
       
   243        //TLiwVariant::operator == check
       
   244        virtual TBool LIW_DATA_TYPES_020();
       
   245        
       
   246        //CLiwGenericParamList::FindFirst and FindNext
       
   247        virtual TBool LIW_DATA_TYPES_021();
       
   248        
       
   249        //CLiwGenericParamList::FindFirst and FindNext and AppendL(CLiwGenericParamList&)
       
   250        virtual TBool LIW_DATA_TYPES_022();
       
   251        
       
   252        //CLiwContainer::ExternalizeL
       
   253        virtual TBool LIW_DATA_TYPES_023();
       
   254        
       
   255        //TLiwVariant::Dump // only for debug version
       
   256        virtual TBool LIW_DATA_TYPES_024();
       
   257        
       
   258        //Should be called as the last case
       
   259        virtual TBool LIW_CLEANUP_LIW_001();
       
   260        
       
   261        //for conversion utilities
       
   262        virtual TBool LIW_DATA_TYPES_025();
       
   263        virtual TBool LIW_DATA_TYPES_026();
       
   264        //virtual TBool LIW_DATA_TYPES_027();
       
   265        //virtual TBool LIW_DATA_TYPES_028();
       
   266        virtual TBool LIW_DATA_TYPES_029();
       
   267        virtual TBool LIW_DATA_TYPES_030();
       
   268        //virtual TBool LIW_DATA_TYPES_031();
       
   269        //virtual TBool LIW_DATA_TYPES_032();
       
   270        virtual TBool LIW_DATA_TYPES_033();
       
   271        virtual TBool LIW_DATA_TYPES_034();
       
   272        //virtual TBool LIW_DATA_TYPES_035();
       
   273        //virtual TBool LIW_DATA_TYPES_036();
       
   274        virtual TBool LIW_DATA_TYPES_037();
       
   275        virtual TBool LIW_DATA_TYPES_038();
       
   276        virtual TBool LIW_DATA_TYPES_039();
       
   277        //virtual TBool LIW_DATA_TYPES_040();
       
   278        virtual TBool LIW_DATA_TYPES_041();
       
   279        virtual TBool LIW_DATA_TYPES_042();
       
   280        virtual TBool LIW_DATA_TYPES_043();
       
   281        //virtual TBool LIW_DATA_TYPES_044();
       
   282        
       
   283        //QueryImplementation TestCases
       
   284        virtual TBool LIW_DATA_TYPES_045();
       
   285        virtual TBool LIW_DATA_TYPES_046();
       
   286        virtual TBool LIW_DATA_TYPES_047();
       
   287        virtual TBool LIW_DATA_TYPES_048();
       
   288        virtual TBool LIW_DATA_TYPES_049();
       
   289        
       
   290        //Versioning TestCases
       
   291        virtual TBool LIW_MDAT_VER1();
       
   292        virtual TBool LIW_MDAT_VER2();
       
   293        virtual TBool LIW_MDAT_VER3();
       
   294        virtual TBool LIW_MDAT_VER4();
       
   295        virtual TBool LIW_MDAT_VER5();
       
   296        
       
   297        //Generic Metadata TestCases
       
   298        virtual TBool LIW_MDAT_CAP1();
       
   299        virtual TBool LIW_MDAT_CAP2();
       
   300        
       
   301        //Test case for Data Type - Map AtL returning const TDesC8&
       
   302        virtual TBool LIW_Map_AtL_New();
       
   303        
       
   304        //Test case for Data Type - Cleanup check
       
   305        virtual TBool LIW_ContainerCleanup();
       
   306        virtual TBool LIW_ParamCleanup();
       
   307        virtual TBool LIW_VariantCleanup();
       
   308        
       
   309         //Checking TInt64 datatype & conversion utilities
       
   310         virtual TBool LIW_DATA_TYPES_050();
       
   311        
       
   312         virtual void TestL(CLiwMap *map);
       
   313         virtual void TestParamL(CLiwGenericParamList *param);
       
   314         virtual void TestVariantL(CLiwMap* map);
       
   315 	        
       
   316         virtual TInt LIW_ASYNC_001();
       
   317         virtual TInt LIW_ASYNC_002();
       
   318         virtual TInt LIW_ASYNC_003();
       
   319         virtual TInt LIW_ASYNC_004();
       
   320                 
       
   321         virtual TInt LIW_ASYNC_LongServiceCmd();
       
   322         virtual TInt LIW_ASYNC_LongInterface();
       
   323         virtual TInt LIW_ASYNC_LongInvalidServiceCmd();
       
   324         virtual TInt LIW_ASYNC_LongInvalidInterface();
       
   325         virtual TInt LIW_ASYNC_LongInterface1();
       
   326         virtual TInt LIW_ParamCleanup1();
       
   327         virtual void TestParam1L();
       
   328         virtual TInt LIW_GetInterest();
       
   329         virtual TBool LIW_Defaut_list_externalize();
       
   330         virtual TBool LIW_DATA_TYPES_013_A();
       
   331         virtual TBool LIW_DATA_TYPES_015_A();
       
   332         virtual TInt LIW_DATA_GenericParamList();
       
   333         virtual TInt LIW_DATA_NewLOverLoad();
       
   334         /**
       
   335          * Method used to log version of test class
       
   336          */
       
   337         void SendTestClassVersion();
       
   338         TInt LoadL();
       
   339 
       
   340         //ADD NEW METHOD DEC HERE
       
   341         //[TestMethods] - Do not remove
       
   342 
       
   343     public:     // Data
       
   344         // ?one_line_short_description_of_data
       
   345         //?data_declaration;
       
   346         
       
   347     protected:  // Data
       
   348         // ?one_line_short_description_of_data
       
   349         //?data_declaration;
       
   350 
       
   351     private:    // Data
       
   352         CLiwServiceHandler *iServiceHandler;
       
   353         CLiw_AsyncTC *asyObj;
       
   354         // ?one_line_short_description_of_data
       
   355         //?data_declaration;
       
   356 
       
   357         // Reserved pointer for future extension
       
   358         //TAny* iReserved;
       
   359 
       
   360     public:     // Friend classes
       
   361         //?friend_class_declaration;
       
   362     protected:  // Friend classes
       
   363         //?friend_class_declaration;
       
   364     private:    // Friend classes
       
   365         //?friend_class_declaration;
       
   366         
       
   367     };
       
   368 
       
   369 #endif      // LIWTESTCASES_H
       
   370 
       
   371 // End of File