websrv_pub/web_service_manager_api/tsrc/senservicemanagerTester/inc/senservicemanagerTester.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002 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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 #ifndef SENSERVICEMANAGERTESTER_H
       
    27 #define SENSERVICEMANAGERTESTER_H
       
    28 
       
    29 //  INCLUDES
       
    30 #include <StifLogger.h>
       
    31 #include <TestScripterInternal.h>
       
    32 #include <StifTestModule.h>
       
    33 #include <SenServiceManager.h>
       
    34 #include <SenIdentityProvider.h>
       
    35 #include <SenXmlServiceDescription.h>
       
    36 #include <SenServiceConnection.h>
       
    37 #include <f32file.h>
       
    38 #include <TestclassAssert.h>
       
    39 namespace{
       
    40     _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
       
    41     _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
       
    42     _LIT8(KText,"text");
       
    43     _LIT8(KText2,"text2");
       
    44 }
       
    45 
       
    46 // CONSTANTS
       
    47 //const ?type ?constant_var = ?constant;
       
    48 
       
    49 // MACROS
       
    50 //#define ?macro ?macro_def
       
    51 #define TEST_CLASS_VERSION_MAJOR 0
       
    52 #define TEST_CLASS_VERSION_MINOR 0
       
    53 #define TEST_CLASS_VERSION_BUILD 0
       
    54 
       
    55 // Logging path
       
    56 _LIT( KsenservicemanagerTesterLogPath, "\\logs\\testframework\\senservicemanagerTester\\" ); 
       
    57 // Log file
       
    58 _LIT( KsenservicemanagerTesterLogFile, "senservicemanagerTester.txt" ); 
       
    59 _LIT( KsenservicemanagerTesterLogFileWithTitle, "senservicemanagerTester_[%S].txt" );
       
    60 
       
    61 // FUNCTION PROTOTYPES
       
    62 //?type ?function_name(?arg_list);
       
    63 
       
    64 // FORWARD DECLARATIONS
       
    65 //class ?FORWARD_CLASSNAME;
       
    66 class CsenservicemanagerTester;
       
    67 
       
    68 // DATA TYPES
       
    69 //enum ?declaration
       
    70 //typedef ?declaration
       
    71 //extern ?data_type;
       
    72 typedef TInt (CsenservicemanagerTester::* TestFunction)(CStifItemParser&);
       
    73 
       
    74 // CLASS DECLARATION
       
    75 
       
    76 /**
       
    77 *  CsenservicemanagerTester test class for STIF Test Framework TestScripter.
       
    78 *  ?other_description_lines
       
    79 *
       
    80 *  @lib ?library
       
    81 *  @since ?Series60_version
       
    82 */
       
    83 class TCaseInfoInternal
       
    84     {
       
    85     public:
       
    86         const TText*    iCaseName;
       
    87         TestFunction    iMethod;
       
    88         TBool           iIsOOMTest;
       
    89         TInt            iFirstMemoryAllocation;
       
    90         TInt            iLastMemoryAllocation;
       
    91     };
       
    92 
       
    93 // CLASS DECLARATION
       
    94 
       
    95 /**
       
    96 *  A structure containing a test case name and
       
    97 *  the pointer to function doing the test
       
    98 *
       
    99 *  @lib ?library
       
   100 *  @since ?Series60_version
       
   101 */
       
   102 class TCaseInfo
       
   103     {
       
   104     public:
       
   105         TPtrC iCaseName;
       
   106         TestFunction iMethod;
       
   107         TBool           iIsOOMTest;
       
   108         TInt            iFirstMemoryAllocation;
       
   109         TInt            iLastMemoryAllocation;
       
   110 
       
   111     TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
       
   112         {
       
   113         };
       
   114 
       
   115     };
       
   116 
       
   117 NONSHARABLE_CLASS(CsenservicemanagerTester) : public CScriptBase
       
   118     {
       
   119     public:  // Constructors and destructor
       
   120 
       
   121         /**
       
   122         * Two-phased constructor.
       
   123         */
       
   124         static CsenservicemanagerTester* NewL( CTestModuleIf& aTestModuleIf );
       
   125 
       
   126         /**
       
   127         * Destructor.
       
   128         */
       
   129         virtual ~CsenservicemanagerTester();
       
   130 
       
   131     public: // New functions
       
   132 
       
   133         /**
       
   134         * ?member_description.
       
   135         * @since ?Series60_version
       
   136         * @param ?arg1 ?description
       
   137         * @return ?description
       
   138         */
       
   139         //?type ?member_function( ?type ?arg1 );
       
   140 
       
   141     public: // Functions from base classes
       
   142 
       
   143         /**
       
   144         * From CScriptBase Runs a script line.
       
   145         * @since ?Series60_version
       
   146         * @param aItem Script line containing method name and parameters
       
   147         * @return Symbian OS error code
       
   148         */
       
   149         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   150 
       
   151     protected:  // New functions
       
   152 
       
   153         /**
       
   154         * ?member_description.
       
   155         * @since ?Series60_version
       
   156         * @param ?arg1 ?description
       
   157         * @return ?description
       
   158         */
       
   159         //?type ?member_function( ?type ?arg1 );
       
   160 
       
   161     protected:  // Functions from base classes
       
   162 
       
   163         /**
       
   164         * From ?base_class ?member_description
       
   165         */
       
   166         //?type ?member_function();
       
   167 
       
   168     private:
       
   169 
       
   170         /**
       
   171         * C++ default constructor.
       
   172         */
       
   173         CsenservicemanagerTester( CTestModuleIf& aTestModuleIf );
       
   174 
       
   175         /**
       
   176         * By default Symbian 2nd phase constructor is private.
       
   177         */
       
   178         void ConstructL();
       
   179 
       
   180         // Prohibit copy constructor if not deriving from CBase.
       
   181         // ?classname( const ?classname& );
       
   182         // Prohibit assigment operator if not deriving from CBase.
       
   183         // ?classname& operator=( const ?classname& );
       
   184 
       
   185         /**
       
   186         * Frees all resources allocated from test methods.
       
   187         * @since ?Series60_version
       
   188         */
       
   189         const TCaseInfo Case ( const TInt aCaseNumber ) const;
       
   190         void Delete();
       
   191 
       
   192         /**
       
   193         * Test methods are listed below. 
       
   194         */
       
   195 
       
   196     private:    // methods
       
   197          void Empty();
       
   198 
       
   199          void SetupL();
       
   200         
       
   201          void Teardown();
       
   202          void DeleteDBL();
       
   203          
       
   204          
       
   205          TInt UT_CSenServiceManager_NewLL(CStifItemParser& aItem);
       
   206         
       
   207          TInt UT_CSenServiceManager_NewLCL(CStifItemParser& aItem);
       
   208          
       
   209          TInt UT_CSenServiceManager_NewL_1L(CStifItemParser& aItem);
       
   210         
       
   211          TInt UT_CSenServiceManager_NewL_1CL(CStifItemParser& aItem);
       
   212          
       
   213         
       
   214         	  
       
   215          TInt UT_CSenServiceManager_ServiceDescriptionsLL_normalL(CStifItemParser& aItem);
       
   216          TInt UT_CSenServiceManager_ServiceDescriptionsLL_notFoundL(CStifItemParser& aItem);
       
   217          TInt UT_CSenServiceManager_ServiceDescriptionsLL_badDescriptorL(CStifItemParser& aItem);
       
   218          TInt UT_CSenServiceManager_ServiceDescriptionsLL_nullL(CStifItemParser& aItem);
       
   219          TInt UT_CSenServiceManager_ServiceDescriptionsLL_randomPtrL(CStifItemParser& aItem);
       
   220         
       
   221          TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_normalL(CStifItemParser& aItem);
       
   222          TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_notFoundL(CStifItemParser& aItem);
       
   223          TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_badDescriptorL(CStifItemParser& aItem);
       
   224          TInt UT_CSenServiceManager_ServiceDescriptionsL_1L_XMLpatternL(CStifItemParser& aItem);
       
   225          
       
   226          TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_normalL(CStifItemParser& aItem);
       
   227          TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_badDescriptorL(CStifItemParser& aItem);
       
   228          TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_noEndpointL(CStifItemParser& aItem);
       
   229          TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_noContractL(CStifItemParser& aItem);
       
   230          TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_badFrameworkL(CStifItemParser& aItem);
       
   231          TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_randomPtrL(CStifItemParser& aItem);
       
   232          TInt UT_CSenServiceManager_RegisterServiceDescriptionLL_nullL(CStifItemParser& aItem);
       
   233          
       
   234          TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_normalL(CStifItemParser& aItem);
       
   235          TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_badDescriptorL(CStifItemParser& aItem);
       
   236          TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_noEndpointL(CStifItemParser& aItem);
       
   237          TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_noContractL(CStifItemParser& aItem);
       
   238          TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_badFrameworkL(CStifItemParser& aItem);
       
   239          TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_randomPtrL(CStifItemParser& aItem);
       
   240          TInt UT_CSenServiceManager_UnregisterServiceDescriptionLL_nullL(CStifItemParser& aItem);
       
   241         
       
   242         
       
   243          TInt UT_CSenServiceManager_RegisterIdentityProviderLL_normalL(CStifItemParser& aItem);
       
   244          TInt UT_CSenServiceManager_RegisterIdentityProviderLL_badDescriptorL(CStifItemParser& aItem);
       
   245          TInt UT_CSenServiceManager_RegisterIdentityProviderLL_notReadyL(CStifItemParser& aItem);
       
   246          TInt UT_CSenServiceManager_RegisterIdentityProviderLL_providerIDInUseL(CStifItemParser& aItem);
       
   247          TInt UT_CSenServiceManager_RegisterIdentityProviderLL_nullL(CStifItemParser& aItem);
       
   248          TInt UT_CSenServiceManager_RegisterIdentityProviderLL_randomPtrL(CStifItemParser& aItem);
       
   249 
       
   250         
       
   251          TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_normalL(CStifItemParser& aItem);
       
   252          TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_badDescriptorL(CStifItemParser& aItem);
       
   253          TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_notFoundL(CStifItemParser& aItem);
       
   254          TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_notReadyL(CStifItemParser& aItem);
       
   255          TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_nullL(CStifItemParser& aItem);
       
   256          TInt UT_CSenServiceManager_UnregisterIdentityProviderLL_randomPtrL(CStifItemParser& aItem);
       
   257         
       
   258         
       
   259          TInt UT_CSenServiceManager_AssociateServiceLL_normalL(CStifItemParser& aItem);
       
   260          TInt UT_CSenServiceManager_AssociateServiceLL_argumentL(CStifItemParser& aItem);
       
   261          TInt UT_CSenServiceManager_AssociateServiceLL_notReadyL(CStifItemParser& aItem);
       
   262          TInt UT_CSenServiceManager_AssociateServiceLL_notFoundL(CStifItemParser& aItem);
       
   263         
       
   264         
       
   265          TInt UT_CSenServiceManager_DissociateServiceLL_normalL(CStifItemParser& aItem);
       
   266          TInt UT_CSenServiceManager_DissociateServiceLL_argumentL(CStifItemParser& aItem);
       
   267          TInt UT_CSenServiceManager_DissociateServiceLL_notReadyL(CStifItemParser& aItem);
       
   268          TInt UT_CSenServiceManager_DissociateServiceLL_notFoundL(CStifItemParser& aItem);
       
   269         
       
   270 
       
   271     private:    // Data
       
   272         CSenServiceManager*         iServiceManager;
       
   273         CSenXmlServiceDescription*  iSenXmlServiceDescription;
       
   274         CSenIdentityProvider*       iProvider;
       
   275         RFs                         iFsSession;
       
   276 
       
   277 		CActiveScheduler* iActiveScheduler;
       
   278         
       
   279         /**
       
   280          * Method used to log version of test class
       
   281          */
       
   282         void SendTestClassVersion();
       
   283 
       
   284         //ADD NEW METHOD DEC HERE
       
   285         //[TestMethods] - Do not remove
       
   286 
       
   287     public:     // Data
       
   288         // ?one_line_short_description_of_data
       
   289         //?data_declaration;
       
   290 
       
   291     protected:  // Data
       
   292         // ?one_line_short_description_of_data
       
   293         //?data_declaration;
       
   294 
       
   295     private:    // Data
       
   296         // Pointer to test (function) to be executed
       
   297         TestFunction iMethod;
       
   298 
       
   299         // Pointer to logger
       
   300         CStifLogger * iLog; 
       
   301 
       
   302         // ?one_line_short_description_of_data
       
   303         //?data_declaration;
       
   304 
       
   305         // Reserved pointer for future extension
       
   306         //TAny* iReserved;
       
   307 
       
   308     public:     // Friend classes
       
   309         //?friend_class_declaration;
       
   310     protected:  // Friend classes
       
   311         //?friend_class_declaration;
       
   312     private:    // Friend classes
       
   313         //?friend_class_declaration;
       
   314 
       
   315     };
       
   316 
       
   317 #endif      // SENSERVICEMANAGERTESTER_H
       
   318 
       
   319 // End of File