websrv_pub/web_service_connection_api/tsrc/SenConnectionTimeoutsTester/inc/SenConnectionTimeoutsTester.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 SENCONNECTIONTIMEOUTSTESTER_H
       
    27 #define SENCONNECTIONTIMEOUTSTESTER_H
       
    28 
       
    29 //  INCLUDES
       
    30 #include <StifLogger.h>
       
    31 #include <TestScripterInternal.h>
       
    32 #include <StifTestModule.h>
       
    33 #include <TestclassAssert.h>
       
    34 #include <MSenServiceConsumer.h>
       
    35 #include <SenBaseFragment.h>
       
    36 #include <SenBaseElement.h>
       
    37 #include <SenXmlReader.h>
       
    38 
       
    39 #include <f32file.h>
       
    40 #include <e32base.h> // for CActive
       
    41 #include <e32std.h>
       
    42 #include <unistd.h>
       
    43 #include <aknnotewrappers.h> 
       
    44 
       
    45 // CONSTANTS
       
    46 //const ?type ?constant_var = ?constant;
       
    47 
       
    48 //  INTERNAL INCLUDES
       
    49 namespace
       
    50     {
       
    51     _LIT16(KSessionsFile,"c:\\private\\101f96f4\\SenSessions.xml");
       
    52     _LIT16(KIdentitiesFile,"c:\\private\\101f96f4\\senidentities.xml");
       
    53     }
       
    54 
       
    55 enum TUT_CSenConnectionTimeoutsTester
       
    56     {
       
    57     ENotInitialized = 1,
       
    58     EConnectionNotReady,
       
    59     };
       
    60 //  FORWARD DECLARATIONS
       
    61 class CSenBaseFragment;
       
    62 class CSenBaseElement;
       
    63 class CSenSoapEnvelope;
       
    64 class SenXmlUtils;
       
    65 class CSenServiceConnection;
       
    66 class CSenXmlReader;
       
    67 class CSenDomFragment;
       
    68 class CSenXmlServiceDescription;
       
    69 class CSenServicePattern;
       
    70 class CSenServiceManager;
       
    71 class CSenSoapMessage;
       
    72 class CSenSoapMessage2;
       
    73 
       
    74 #include <e32def.h>
       
    75 #ifndef NONSHARABLE_CLASS
       
    76     #define NONSHARABLE_CLASS(x) class x
       
    77 #endif
       
    78 // MACROS
       
    79 //#define ?macro ?macro_def
       
    80 #define TEST_CLASS_VERSION_MAJOR 0
       
    81 #define TEST_CLASS_VERSION_MINOR 0
       
    82 #define TEST_CLASS_VERSION_BUILD 0
       
    83 
       
    84 // Logging path
       
    85 _LIT( KSenConnectionTimeoutsTesterLogPath, "\\logs\\testframework\\SenConnectionTimeoutsTester\\" ); 
       
    86 // Log file
       
    87 _LIT( KSenConnectionTimeoutsTesterLogFile, "SenConnectionTimeoutsTester.txt" ); 
       
    88 _LIT( KSenConnectionTimeoutsTesterLogFileWithTitle, "SenConnectionTimeoutsTester_[%S].txt" );
       
    89 
       
    90 // FUNCTION PROTOTYPES
       
    91 //?type ?function_name(?arg_list);
       
    92 
       
    93 // FORWARD DECLARATIONS
       
    94 //class ?FORWARD_CLASSNAME;
       
    95 class CSenConnectionTimeoutsTester;
       
    96 
       
    97 // DATA TYPES
       
    98 //enum ?declaration
       
    99 //typedef ?declaration
       
   100 //extern ?data_type;
       
   101 typedef TInt (CSenConnectionTimeoutsTester::* TestFunction)( CStifItemParser&);
       
   102 
       
   103 // CLASS DECLARATION
       
   104 
       
   105 /**
       
   106 *  CSenConnectionTimeoutsTester test class for STIF Test Framework TestScripter.
       
   107 *  ?other_description_lines
       
   108 *
       
   109 *  @lib ?library
       
   110 *  @since ?Series60_version
       
   111 */
       
   112 NONSHARABLE_CLASS(CSenConnectionTimeoutsTester) : public CScriptBase, public MSenServiceConsumer 
       
   113     {
       
   114     public:
       
   115         enum TCallback
       
   116             {
       
   117             ECallbackNone = 0,
       
   118             ECallbackHandleMessage,
       
   119             ECallbackHandleError
       
   120             };
       
   121     public:  // Constructors and destructor
       
   122 
       
   123         /**
       
   124         * Two-phased constructor.
       
   125         */
       
   126         static CSenConnectionTimeoutsTester* NewL( CTestModuleIf& aTestModuleIf );
       
   127         static CSenConnectionTimeoutsTester* NewL();
       
   128         static CSenConnectionTimeoutsTester* NewLC();
       
   129 
       
   130         /**
       
   131         * Destructor.
       
   132         */
       
   133         virtual ~CSenConnectionTimeoutsTester();
       
   134 
       
   135     public: // New functions
       
   136 
       
   137         /**
       
   138         * ?member_description.
       
   139         * @since ?Series60_version
       
   140         * @param ?arg1 ?description
       
   141         * @return ?description
       
   142         */
       
   143         //?type ?member_function( ?type ?arg1 );
       
   144 
       
   145     public: // Functions from base classes
       
   146 
       
   147         /**
       
   148         * From CScriptBase Runs a script line.
       
   149         * @since ?Series60_version
       
   150         * @param aItem Script line containing method name and parameters
       
   151         * @return Symbian OS error code
       
   152         */
       
   153         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   154 
       
   155     protected:  // New functions
       
   156 
       
   157         /**
       
   158         * ?member_description.
       
   159         * @since ?Series60_version
       
   160         * @param ?arg1 ?description
       
   161         * @return ?description
       
   162         */
       
   163         //?type ?member_function( ?type ?arg1 );
       
   164 
       
   165     protected:  // Functions from base classes
       
   166 
       
   167         /**
       
   168         * From ?base_class ?member_description
       
   169         */
       
   170         //?type ?member_function();
       
   171 
       
   172     private:
       
   173 
       
   174         /**
       
   175         * C++ default constructor.
       
   176         */
       
   177         CSenConnectionTimeoutsTester( CTestModuleIf& aTestModuleIf );
       
   178         CSenConnectionTimeoutsTester();
       
   179 
       
   180         /**
       
   181         * By default Symbian 2nd phase constructor is private.
       
   182         */
       
   183         void ConstructL();
       
   184 
       
   185         // Prohibit copy constructor if not deriving from CBase.
       
   186         // ?classname( const ?classname& );
       
   187         // Prohibit assigment operator if not deriving from CBase.
       
   188         // ?classname& operator=( const ?classname& );
       
   189 
       
   190         /**
       
   191         * Frees all resources allocated from test methods.
       
   192         * @since ?Series60_version
       
   193         */
       
   194         void Delete();
       
   195 
       
   196         /**
       
   197         * Test methods are listed below. 
       
   198         */
       
   199 
       
   200         
       
   201         /**
       
   202          * Method used to log version of test class
       
   203          */
       
   204         void SendTestClassVersion();
       
   205 
       
   206         //ADD NEW METHOD DEC HERE
       
   207         //[TestMethods] - Do not remove
       
   208 
       
   209     public:     // Data
       
   210         // ?one_line_short_description_of_data
       
   211         //?data_declaration;
       
   212 
       
   213     protected:  // Data
       
   214         // ?one_line_short_description_of_data
       
   215         //?data_declaration;
       
   216 
       
   217     private:    // Data
       
   218         
       
   219         // ?one_line_short_description_of_data
       
   220         //?data_declaration;
       
   221 
       
   222         // Reserved pointer for future extension
       
   223         //TAny* iReserved;
       
   224     private:    // New methods
       
   225     
       
   226             // MService Consumer implementation
       
   227         void HandleMessageL(const TDesC8& aMessage);        
       
   228         void HandleErrorL(const int aErrorCode, const TDesC8& aError);
       
   229         void SetStatus(const TInt aStatus);
       
   230 
       
   231         void SetupL();
       
   232 
       
   233         void Teardown();
       
   234 
       
   235         void ErrorL(TInt aCode);
       
   236 
       
   237 
       
   238         TInt CSenConnectionTimeoutsTester_TP_Async1(CStifItemParser& aItem);
       
   239         
       
   240         TInt CSenConnectionTimeoutsTester_TP_Async2(CStifItemParser& aItem);     
       
   241         
       
   242         
       
   243         
       
   244         TInt CSenConnectionTimeoutsTester_TP_Send(const TDesC8& aLogFileName,
       
   245                                               const TDesC8& aCustomHttpHeader,
       
   246                                               const TDesC8& aCustomHttpHeaderValue,
       
   247                                               CSenServiceConnection* iServiceConnection);
       
   248                                               
       
   249         TInt CSenConnectionTimeoutsTester_TP_CheckLogs(const TDesC& aLogFilePath,
       
   250                                                    const TDesC8& aCustomHttpHeader,
       
   251                                                    const TDesC8& aCustomHttpHeaderValue);                                    
       
   252                                                    
       
   253         TUint32 SearchIAPIdByName(const TDesC& aIAPName);
       
   254         
       
   255         CSenSoapMessage* CreateAuthRequestLC();
       
   256         
       
   257         CSenSoapMessage2* CreateNewAuthRequestLC();
       
   258         
       
   259         HBufC8* ReadFileL(const TDesC& aFilename);
       
   260         
       
   261         HBufC8* HttpMethodValueFromXmlLC(const TDesC8& aXml);
       
   262         
       
   263         HBufC8* HttpPropertyValueFromXmlLC(const TDesC8& aXml,
       
   264                                            const TDesC8& aPropertyName);
       
   265                                            
       
   266         void StartActiveScheduler(TInt aNumberOfSentMessages);
       
   267         void StopActiveScheduler();
       
   268 
       
   269     private:    // Data
       
   270     TestFunction iMethod;
       
   271         // Pointer to logger
       
   272         CStifLogger * iLog; 
       
   273         
       
   274         CSenXmlServiceDescription*  iSenXmlServiceDescription;
       
   275         CSenXmlServiceDescription*  iSession;
       
   276         CSenServiceConnection*      iServiceConnection;
       
   277         CSenServiceManager*         iManager;
       
   278         CSenXmlReader*              iXmlReader;
       
   279         
       
   280         TInt                        iTransactionId;
       
   281         TInt                        iConnectionState;
       
   282         TBool                       iInitialized;
       
   283         TBool                       iReady;
       
   284         
       
   285         TCallback                   iCallback;
       
   286         HBufC8*                     ipMessage;
       
   287         
       
   288         TInt                        iNumberOfPendingOps;
       
   289         HBufC8*                     ipFrameworkID;
       
   290         
       
   291         TInt                        iErrorCode;
       
   292 
       
   293     public:     // Friend classes
       
   294         //?friend_class_declaration;
       
   295     protected:  // Friend classes
       
   296         //?friend_class_declaration;
       
   297     private:    // Friend classes
       
   298         //?friend_class_declaration;
       
   299 
       
   300     };
       
   301 
       
   302 #endif      // SENCONNECTIONTIMEOUTSTESTER_H
       
   303 
       
   304 // End of File