websrv_pub/web_service_messaging_api/tsrc/bc/newsoapclasses/inc/newsoapclassesbctest.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-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:          NewSoapClasses test module.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 #ifndef NEWSOAPCLASSES_H
       
    29 #define NEWSOAPCLASSES_H
       
    30 
       
    31 // INCLUDES
       
    32 #include "StifTestModule.h"
       
    33 #include <StifLogger.h>
       
    34 
       
    35 #include <SenParser.h>
       
    36 #include <SenSoapEnvelope2.h>
       
    37 #include <SenSoapFault2.h>
       
    38 #include <SenSoapMessage2.h>
       
    39 #include <SenSoapConstants.h>
       
    40 //#include <SenSoapMessageDom2.h>
       
    41 #include <SenWsSecurityHeader2.h>
       
    42 #include <SenIdentityProvider.h>
       
    43 //#include <SenMessageContext.h>
       
    44 #include <SenXmlProperties.h>
       
    45 #include <e32debug.h>
       
    46 #include <e32std.h>
       
    47 #include <e32def.h>
       
    48 #include <SenXmlConstants.h>
       
    49 
       
    50 
       
    51 
       
    52 
       
    53 
       
    54 //  FORWARD DECLARATIONS
       
    55 class CSenSoapFault2;
       
    56 class CSenSoapEnvelope2;
       
    57 class CSenSoapMessage2;
       
    58 class CSenWsSecurityHeader2;
       
    59 
       
    60 // MACROS
       
    61 //#define ?macro ?macro_def
       
    62 #define TEST_MODULE_VERSION_MAJOR 50
       
    63 #define TEST_MODULE_VERSION_MINOR 9
       
    64 #define TEST_MODULE_VERSION_BUILD 6
       
    65 
       
    66 
       
    67 // Logging path
       
    68 _LIT( KNewSoapClassesLogPath, "\\logs\\testframework\\NewSoapClassesBCTest\\" ); 
       
    69 // Log file
       
    70 _LIT( KNewSoapClassesLogFile, "NewSoapClassesBCTest.txt" ); 
       
    71 
       
    72 // Function pointer related internal definitions
       
    73 // Visual studio 6.0 (__VC32__) needs different type of handling 
       
    74 #ifdef __VC32__
       
    75 #define GETPTR
       
    76 #else
       
    77 #define GETPTR &
       
    78 #endif  
       
    79 #define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
       
    80 #define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
       
    81 #define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
       
    82 #define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
       
    83 
       
    84 // FUNCTION PROTOTYPES
       
    85 //?type ?function_name(?arg_list);
       
    86 
       
    87 // FORWARD DECLARATIONS
       
    88 //class ?FORWARD_CLASSNAME;
       
    89 class CNewSoapClassesBCTest;
       
    90 
       
    91 // DATA TYPES
       
    92 //enum ?declaration
       
    93 //typedef ?declaration
       
    94 //extern ?data_type;
       
    95 // A typedef for function that does the actual testing,
       
    96 // function is a type 
       
    97 // TInt CNewSoapClassesBCTest::<NameOfFunction> ( TTestResult& aResult )
       
    98 typedef TInt (CNewSoapClassesBCTest::* TestFunction)(TTestResult&);
       
    99 
       
   100 // CLASS DECLARATION
       
   101 
       
   102 /**
       
   103 *  An internal structure containing a test case name and
       
   104 *  the pointer to function doing the test
       
   105 *
       
   106 *  @lib ?library
       
   107 *  @since ?Series60_version
       
   108 */
       
   109 class TCaseInfoInternal
       
   110     {
       
   111     public:
       
   112         const TText*    iCaseName;
       
   113         TestFunction    iMethod;
       
   114         TBool           iIsOOMTest;
       
   115         TInt            iFirstMemoryAllocation;
       
   116         TInt            iLastMemoryAllocation;
       
   117     };
       
   118 
       
   119 // CLASS DECLARATION
       
   120 
       
   121 /**
       
   122 *  A structure containing a test case name and
       
   123 *  the pointer to function doing the test
       
   124 *
       
   125 *  @lib ?library
       
   126 *  @since ?Series60_version
       
   127 */
       
   128 class TCaseInfo
       
   129     {
       
   130     public:
       
   131         TPtrC iCaseName;
       
   132         TestFunction iMethod;
       
   133         TBool           iIsOOMTest;
       
   134         TInt            iFirstMemoryAllocation;
       
   135         TInt            iLastMemoryAllocation;
       
   136 
       
   137     TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
       
   138         {
       
   139         };
       
   140 
       
   141     };
       
   142 
       
   143 
       
   144 // CLASS DECLARATION
       
   145 
       
   146 /**
       
   147 *  This a NewSoapClasses class.
       
   148 *  ?other_description_lines
       
   149 *
       
   150 *  @lib ?library
       
   151 *  @since ?Series60_version
       
   152 */
       
   153 NONSHARABLE_CLASS(CNewSoapClassesBCTest) : public CTestModuleBase
       
   154     {
       
   155     public:  // Constructors and destructor
       
   156 
       
   157 
       
   158         /**
       
   159         * Two-phased constructor.
       
   160         */
       
   161         static CNewSoapClassesBCTest* NewL();
       
   162 
       
   163         /**
       
   164         * Destructor.
       
   165         */
       
   166         virtual ~CNewSoapClassesBCTest();
       
   167 
       
   168     public: // New functions
       
   169 
       
   170         /**
       
   171         * ?member_description.
       
   172         * @since ?Series60_version
       
   173         * @param ?arg1 ?description
       
   174         * @return ?description
       
   175         */
       
   176         //?type ?member_function( ?type ?arg1 );
       
   177 
       
   178     public: // Functions from base classes
       
   179 
       
   180         /**
       
   181         * From CTestModuleBase InitL is used to initialize the 
       
   182         *       NewSoapClasses. It is called once for every instance of 
       
   183         *       TestModuleNewSoapClasses after its creation.
       
   184         * @since ?Series60_version
       
   185         * @param aIniFile Initialization file for the test module (optional)
       
   186         * @param aFirstTime Flag is true when InitL is executed for first 
       
   187         *               created instance of NewSoapClasses.
       
   188         * @return Symbian OS error code
       
   189         */
       
   190         TInt InitL( TFileName& aIniFile, TBool aFirstTime );
       
   191 
       
   192         /**
       
   193         * From CTestModuleBase GetTestCasesL is used to inquiry test cases 
       
   194         *   from NewSoapClasses. 
       
   195         * @since ?Series60_version
       
   196         * @param aTestCaseFile Test case file (optional)
       
   197         * @param aTestCases  Array of TestCases returned to test framework
       
   198         * @return Symbian OS error code
       
   199         */
       
   200         TInt GetTestCasesL( const TFileName& aTestCaseFile, 
       
   201                             RPointerArray<TTestCaseInfo>& aTestCases );
       
   202 
       
   203         /**
       
   204         * From CTestModuleBase RunTestCaseL is used to run an individual 
       
   205         *   test case. 
       
   206         * @since ?Series60_version
       
   207         * @param aCaseNumber Test case number
       
   208         * @param aTestCaseFile Test case file (optional)
       
   209         * @param aResult Test case result returned to test framework (PASS/FAIL)
       
   210         * @return Symbian OS error code (test case execution error, which is 
       
   211         *           not reported in aResult parameter as test case failure).
       
   212         */   
       
   213         TInt RunTestCaseL( const TInt aCaseNumber, 
       
   214                            const TFileName& aTestCaseFile,
       
   215                            TTestResult& aResult );
       
   216 
       
   217         /**
       
   218         * From CTestModuleBase; OOMTestQueryL is used to specify is particular
       
   219         * test case going to be executed using OOM conditions
       
   220         * @param aTestCaseFile Test case file (optional)
       
   221         * @param aCaseNumber Test case number (optional)
       
   222         * @param aFailureType OOM failure type (optional)
       
   223         * @param aFirstMemFailure The first heap memory allocation failure value (optional)
       
   224         * @param aLastMemFailure The last heap memory allocation failure value (optional)
       
   225         * @return TBool
       
   226         */
       
   227         virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, 
       
   228                                      const TInt /* aCaseNumber */, 
       
   229                                      TOOMFailureType& aFailureType, 
       
   230                                      TInt& /* aFirstMemFailure */, 
       
   231                                      TInt& /* aLastMemFailure */ );
       
   232 
       
   233         /**
       
   234         * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
       
   235         * test environment
       
   236         * @param aTestCaseFile Test case file (optional)
       
   237         * @param aCaseNumber Test case number (optional)
       
   238         * @return None
       
   239         */
       
   240         virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, 
       
   241                                     const TInt /* aCaseNumber */ ); 
       
   242 
       
   243         /**
       
   244         * From CTestModuleBase; OOMHandleWarningL
       
   245         * @param aTestCaseFile Test case file (optional)
       
   246         * @param aCaseNumber Test case number (optional)
       
   247         * @param aFailNextValue FailNextValue for OOM test execution (optional)
       
   248         * @return None
       
   249         *
       
   250         * User may add implementation for OOM test warning handling. Usually no
       
   251         * implementation is required.           
       
   252         */
       
   253         virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
       
   254                                         const TInt /* aCaseNumber */, 
       
   255                                         TInt& /* aFailNextValue */); 
       
   256 
       
   257         /**
       
   258         * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
       
   259         * test environment
       
   260         * @param aTestCaseFile Test case file (optional)
       
   261         * @param aCaseNumber Test case number (optional)
       
   262         * @return None
       
   263         *
       
   264         */
       
   265         virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, 
       
   266                                        const TInt /* aCaseNumber */ );
       
   267  				/**
       
   268          * Method used to log version of test module
       
   269          */
       
   270         void SendTestModuleVersion();
       
   271 
       
   272     private:
       
   273 
       
   274         /**
       
   275         * C++ default constructor.
       
   276         */
       
   277         CNewSoapClassesBCTest();
       
   278 
       
   279         /**
       
   280         * By default Symbian 2nd phase constructor is private.
       
   281         */
       
   282         void ConstructL();
       
   283 
       
   284         // Prohibit copy constructor if not deriving from CBase.
       
   285         // ?classname( const ?classname& );
       
   286         // Prohibit assigment operator if not deriving from CBase.
       
   287         // ?classname& operator=( const ?classname& );
       
   288 
       
   289         /**
       
   290         * Function returning test case name and pointer to test case function.
       
   291         * @since ?Series60_version
       
   292         * @param aCaseNumber test case number
       
   293         * @return TCaseInfo 
       
   294         */
       
   295         const TCaseInfo Case ( const TInt aCaseNumber ) const;
       
   296         
       
   297         void SetupL();
       
   298         void Teardown();
       
   299 
       
   300 
       
   301         /**
       
   302         * Actual Hardcoded test case functions are listed below.
       
   303         */
       
   304          TInt MT_CSenSoapEnvelope2_NewLL(TTestResult& aResult);
       
   305          
       
   306          TInt MT_CSenSoapEnvelope2_NewLCL(TTestResult& aResult);
       
   307         
       
   308          TInt MT_CSenSoapEnvelope2_NewL_1L(TTestResult& aResult);
       
   309          
       
   310          TInt MT_CSenSoapEnvelope2_NewLC_1L(TTestResult& aResult);
       
   311          
       
   312          TInt MT_CSenSoapEnvelope2_NewL_2L(TTestResult& aResult);
       
   313          
       
   314          TInt MT_CSenSoapEnvelope2_NewLC_2L(TTestResult& aResult);
       
   315          
       
   316          TInt MT_CSenSoapEnvelope2_TypeL(TTestResult& aResult);
       
   317          
       
   318          TInt MT_CSenSoapEnvelope2_DirectionL(TTestResult& aResult);
       
   319          
       
   320          TInt MT_CSenSoapEnvelope2_TxnIdL(TTestResult& aResult);
       
   321          
       
   322          TInt MT_CSenSoapEnvelope2_CloneL(TTestResult& aResult);
       
   323          
       
   324          TInt MT_CSenSoapEnvelope2_SoapVersionL(TTestResult& aResult);
       
   325          
       
   326          TInt MT_CSenSoapEnvelope2_SetContextL(TTestResult& aResult);
       
   327          
       
   328          TInt MT_CSenSoapEnvelope2_ContextL(TTestResult& aResult);
       
   329          
       
   330          TInt MT_CSenSoapEnvelope2_SetPropertiesL(TTestResult& aResult);
       
   331 
       
   332          TInt MT_CSenSoapEnvelope2_PropertiesL(TTestResult& aResult);
       
   333          
       
   334          TInt MT_CSenSoapEnvelope2_IsSafeToCastL(TTestResult& aResult); 
       
   335 
       
   336 
       
   337          TInt MT_CSenSoapEnvelope2_SetBodyLL(TTestResult& aResult);
       
   338          
       
   339          
       
   340          TInt MT_CSenSoapEnvelope2_SetBodyL_1L(TTestResult& aResult);
       
   341         
       
   342         
       
   343          TInt MT_CSenSoapEnvelope2_BodyLL(TTestResult& aResult);
       
   344         
       
   345         
       
   346          TInt MT_CSenSoapEnvelope2_HeaderLL(TTestResult& aResult);
       
   347         
       
   348         
       
   349          TInt MT_CSenSoapEnvelope2_AddHeaderLL(TTestResult& aResult);
       
   350         
       
   351         
       
   352          TInt MT_CSenSoapEnvelope2_BodyAsStringLL(TTestResult& aResult);
       
   353         
       
   354         
       
   355          TInt MT_CSenSoapEnvelope2_IsFaultL(TTestResult& aResult);
       
   356         
       
   357         
       
   358          TInt MT_CSenSoapEnvelope2_DetachFaultLL(TTestResult& aResult);
       
   359         
       
   360         
       
   361          TInt MT_CSenSoapEnvelope2_FaultLL(TTestResult& aResult);
       
   362         
       
   363         
       
   364          TInt MT_CSenSoapEnvelope2_SetSoapActionLL(TTestResult& aResult);
       
   365         
       
   366         
       
   367          TInt MT_CSenSoapEnvelope2_SoapActionL(TTestResult& aResult);
       
   368         
       
   369         
       
   370          TInt MT_CSenSoapEnvelope2_HasHeaderL(TTestResult& aResult);
       
   371         
       
   372         
       
   373          TInt MT_CSenSoapEnvelope2_HasBodyL(TTestResult& aResult);
       
   374          
       
   375          
       
   376          TInt MT_CSenSoapEnvelope2_Parse1L(TTestResult& aResult);
       
   377         
       
   378         
       
   379          TInt MT_CSenSoapEnvelope2_Parse2L(TTestResult& aResult);
       
   380         
       
   381         
       
   382          TInt MT_CSenSoapEnvelope2_Parse3L(TTestResult& aResult);
       
   383         
       
   384         
       
   385          TInt MT_CSenSoapFault2_NewLL(TTestResult& aResult);
       
   386         
       
   387         
       
   388          TInt MT_CSenSoapFault2_NewL_1L(TTestResult& aResult);
       
   389         
       
   390         
       
   391          TInt MT_CSenSoapFault2_NewL_2L(TTestResult& aResult);
       
   392         
       
   393         
       
   394          TInt MT_CSenSoapFault2_FaultCodeL(TTestResult& aResult);
       
   395         
       
   396         
       
   397          TInt MT_CSenSoapFault2_FaultSubcodeL(TTestResult& aResult);
       
   398         
       
   399         
       
   400          TInt MT_CSenSoapFault2_FaultStringL(TTestResult& aResult);
       
   401         
       
   402         
       
   403          TInt MT_CSenSoapFault2_FaultActorL(TTestResult& aResult);
       
   404         
       
   405         
       
   406          TInt MT_CSenSoapFault2_DetailL(TTestResult& aResult);
       
   407         
       
   408         
       
   409          TInt MT_CSenSoapMessage2_NewLL(TTestResult& aResult);
       
   410          
       
   411          TInt MT_CSenSoapMessage2_NewLCL(TTestResult& aResult);
       
   412         
       
   413         
       
   414          TInt MT_CSenSoapMessage2_NewL_1L(TTestResult& aResult);
       
   415          
       
   416          TInt MT_CSenSoapMessage2_NewLC_1L(TTestResult& aResult);
       
   417         
       
   418         
       
   419          TInt MT_CSenSoapMessage2_NewL_2L(TTestResult& aResult);
       
   420          
       
   421          TInt MT_CSenSoapMessage2_NewLC_2L(TTestResult& aResult);
       
   422          
       
   423          TInt MT_CSenSoapMessage2_NewL_3L(TTestResult& aResult);
       
   424          
       
   425          TInt MT_CSenSoapMessage2_NewLC_3L(TTestResult& aResult);
       
   426          
       
   427          TInt MT_CSenSoapMessage2_NewL_4L(TTestResult& aResult);
       
   428          
       
   429          TInt MT_CSenSoapMessage2_NewLC_4L(TTestResult& aResult);
       
   430          
       
   431          TInt MT_CSenSoapMessage2_NewL_5L(TTestResult& aResult);
       
   432          
       
   433          TInt MT_CSenSoapMessage2_NewLC_5L(TTestResult& aResult);
       
   434          
       
   435          TInt MT_CSenSoapMessage2_NewL_6L(TTestResult& aResult);
       
   436          
       
   437          TInt MT_CSenSoapMessage2_NewLC_6L(TTestResult& aResult);
       
   438          
       
   439          TInt MT_CSenSoapMessage2_TypeL(TTestResult& aResult);
       
   440          
       
   441 		 TInt MT_CSenSoapMessage2_CloneL(TTestResult& aResult);
       
   442 		 
       
   443 		 TInt MT_CSenSoapMessage2_Parse1L(TTestResult& aResult);
       
   444 		 
       
   445         
       
   446         
       
   447          TInt MT_CSenSoapMessage2_SetSecurityHeaderLL(TTestResult& aResult);
       
   448         
       
   449         
       
   450          TInt MT_CSenSoapMessage2_AddSecurityTokenLL(TTestResult& aResult);
       
   451          
       
   452          
       
   453          TInt MT_CSenWsSecurityHeader2_NewLL(TTestResult& aResult);
       
   454         
       
   455         
       
   456          TInt MT_CSenWsSecurityHeader2_NewLCL(TTestResult& aResult);
       
   457         
       
   458         
       
   459          TInt MT_CSenWsSecurityHeader2_NewL_1L(TTestResult& aResult);
       
   460         
       
   461         
       
   462          TInt MT_CSenWsSecurityHeader2_NewLC_1L(TTestResult& aResult);
       
   463         
       
   464         
       
   465          TInt MT_CSenWsSecurityHeader2_NewL_2L(TTestResult& aResult);
       
   466         
       
   467         
       
   468          TInt MT_CSenWsSecurityHeader2_NewLC_2L(TTestResult& aResult);
       
   469         
       
   470         
       
   471          TInt MT_CSenWsSecurityHeader2_UsernameTokenLL(TTestResult& aResult);
       
   472         
       
   473         
       
   474          TInt MT_CSenWsSecurityHeader2_UsernameTokenL_1L(TTestResult& aResult);
       
   475         
       
   476         
       
   477          TInt MT_CSenWsSecurityHeader2_UsernameTokenL_2L(TTestResult& aResult);
       
   478         
       
   479         
       
   480          TInt MT_CSenWsSecurityHeader2_UsernameTokenL_3L(TTestResult& aResult);
       
   481         
       
   482         
       
   483          TInt MT_CSenWsSecurityHeader2_UsernameTokenL_4L(TTestResult& aResult);
       
   484         
       
   485         
       
   486          TInt MT_CSenWsSecurityHeader2_TimestampLL(TTestResult& aResult);
       
   487         
       
   488         
       
   489          TInt MT_CSenWsSecurityHeader2_TimestampL_1L(TTestResult& aResult);
       
   490         
       
   491         
       
   492          TInt MT_CSenWsSecurityHeader2_XmlNsL(TTestResult& aResult);
       
   493         
       
   494         
       
   495          TInt MT_CSenWsSecurityHeader2_XmlNsPrefixL(TTestResult& aResult);
       
   496          
       
   497 		 TInt MT_CTestMSenMessage_Type(TTestResult& aResult);
       
   498 		 TInt MT_CTestMSenMessage_Direction(TTestResult& aResult);
       
   499 		 TInt MT_CTestMSenMessage_Context(TTestResult& aResult);
       
   500 		 TInt MT_CTestMSenMessage_SetContext(TTestResult& aResult);
       
   501 		 TInt MT_CTestMSenMessage_Properties(TTestResult& aResult);
       
   502 		 TInt MT_CTestMSenMessage_SetProperties(TTestResult& aResult);
       
   503 		 TInt MT_CTestMSenMessage_IsSafeToCast(TTestResult& aResult);
       
   504 		 TInt MT_CTestMSenMessage_TxnId(TTestResult& aResult);
       
   505 		 TInt MT_CTestMSenMessage_CloneL(TTestResult& aResult);
       
   506      public:     // Data
       
   507         // ?one_line_short_description_of_data
       
   508         //?data_declaration;
       
   509 
       
   510     protected:  // Data
       
   511         // ?one_line_short_description_of_data
       
   512         //?data_declaration;
       
   513 
       
   514     private:    // Data
       
   515         // Pointer to test (function) to be executed
       
   516         TestFunction iMethod;
       
   517 
       
   518         // Pointer to logger
       
   519         CStifLogger * iLog; 
       
   520 
       
   521 		CSenXmlReader* iXmlReader;
       
   522         // ?one_line_short_description_of_data
       
   523         //?data_declaration;
       
   524 
       
   525         // Reserved pointer for future extension
       
   526         //TAny* iReserved;
       
   527 
       
   528     public:     // Friend classes
       
   529         //?friend_class_declaration;
       
   530     protected:  // Friend classes
       
   531         //?friend_class_declaration;
       
   532     private:    // Friend classes
       
   533         //?friend_class_declaration;
       
   534 
       
   535     };
       
   536 
       
   537 #endif      // NewSoapClasses_H
       
   538 
       
   539 // End of File