applayerprotocols/httptransportfw/Test/t_httpmessage/ctestengine.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CTESTENGINE_H__
       
    17 #define __CTESTENGINE_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 #include "httptestutils.h"
       
    22 #include "mdriverobserver.h"
       
    23 
       
    24 /**	@class		CTestEngine
       
    25 	@todo
       
    26 	@since		8.0
       
    27 */
       
    28 class CTestEngine : public CBase,
       
    29 					public MDriverObserver
       
    30 	{
       
    31 public:		// methods
       
    32 
       
    33 /**	@fn			NewL()
       
    34 	Factory constructor.
       
    35 	@since		8.0
       
    36 	@return		A pointer to a fully initialised object.
       
    37 */
       
    38 	static CTestEngine* NewL();
       
    39 
       
    40 /**	@fn			~CTestEngine
       
    41 	Destructor.
       
    42 	@since		8.0
       
    43 */
       
    44 	virtual ~CTestEngine();
       
    45 
       
    46 /**	@fn			DoTestsL()
       
    47 	Starts the test run.
       
    48 	@since		8.0
       
    49 */
       
    50 	void DoTestsL();
       
    51 	virtual void Log(const TDesC& aComment);
       
    52 	
       
    53 private:	// methods from MDriverObserver
       
    54 
       
    55 	virtual void NotifyError(TInt aError);
       
    56 	virtual void NotifyStart();
       
    57 	virtual void NotifyComplete();
       
    58 	virtual void Dump(const TDesC8& aData);
       
    59 
       
    60 private:	// typedefs
       
    61 
       
    62 /**	@typedef	TTestFunctionL
       
    63 	A typedef defining a pointer to a test function.
       
    64 	@since		8.0
       
    65 */
       
    66 	typedef void (CTestEngine::*TTestFunctionL) ();
       
    67 
       
    68 private:	// methods
       
    69 
       
    70 /**	@fn			CTestEngine()
       
    71 	Constructor.
       
    72 	@since		8.0
       
    73 */
       
    74 	CTestEngine();
       
    75 
       
    76 /**	@fn			ConstructL()
       
    77 	Second phase constructor.
       
    78 	@since		8.0
       
    79 */
       
    80 	void ConstructL();
       
    81 
       
    82 /**	@fn			DoOOMTest(TTestFunctionL aDoTestFunctionL)
       
    83 	Does OOM testing on the test case specified. Will continue to re-start the
       
    84 	specified test case until either the test case function does not leave and
       
    85 	the test passes. If a test case does not pass under standard conditions, 
       
    86 	then OOM testing of that test case should not be done.
       
    87 	@since		8.0
       
    88 	@param		aDoTestFunctionL	The function of the test case to be run.
       
    89 */
       
    90 	void DoOOMTest(TTestFunctionL aDoTestFunctionL);
       
    91 	
       
    92 	void DoParseRawBadResponseTest1L();
       
    93 	void DoParseRawBadResponseTest2L();
       
    94 	void DoParseRawBadResponseTest3L();
       
    95 	void DoParseRawBadResponseTest4L();
       
    96 	void DoParseRawBadResponseTest5L();
       
    97 	void DoParseRawBadResponseTest6L();
       
    98 	void DoParseRawBadResponseTest7L();
       
    99 	void DoParseRawBadResponseTest8L();
       
   100 	void DoParseRawBadResponseTest9L();
       
   101 	
       
   102 	void DoParseSimpleMessageL();
       
   103 	void DoParseNoEntityBodyL();
       
   104 	void DoParseNonEncodedBodyL();
       
   105 	void DoParseChunkEncodedBodyL();
       
   106 	void DoParseChunkEncodedBodyWithTrailersL();
       
   107 	void DoParseBadLineL();
       
   108 	void DoParseBadEmptyLineL();
       
   109 	void DoParseBadHeaderContinuationL();
       
   110 	void DoParseBadChunkExtensionL();
       
   111 	void DoParseBadChunkDataL();
       
   112 	void DoParseBadChunkSizeL();
       
   113 	void DoParseMissingCRsL();
       
   114 	void DoParseSpuriousCRsL();
       
   115 	void DoParseLongHeaderL();
       
   116 	void DoParseLeadingEmptyLineL();
       
   117 	void DoParseNonChunkedResetL();
       
   118 	void DoParseChunkedResetL();
       
   119 	void DoParseChunkDataContainingOnlyCRsL();
       
   120 
       
   121 	void DoComposeSimpleMessageL();
       
   122 	void DoComposeNoEntityBodyL();
       
   123 	void DoComposeNonEncodedBodyL();
       
   124 	void DoComposeChunkEncodedBodyL();
       
   125 	void DoComposeChunkEncodedBodyWithTrailersL();
       
   126 	void DoComposeTooMuchEntityBodyDataL();
       
   127 	void DoComposeTooLittleEntityBodyDataL();
       
   128 	void DoComposeLongHeaderL();
       
   129 	void DoComposeNonEncodedBodyResetL();
       
   130 	void DoComposeChunkEncodedBodyWithTrailersResetL();
       
   131 	
       
   132 private:	// attributes
       
   133 
       
   134 	CHTTPTestUtils*		iTestUtils;
       
   135 	TInt				iTestCount;
       
   136 	TBool				iTestFailed;
       
   137 	TBool				iOOMTesting;
       
   138 	TBool				iUseUnknownBodyLength;
       
   139 
       
   140 	};
       
   141 
       
   142 #endif	// __CTESTENGINE_H__