applayerprotocols/httptransportfw/Test/Acceptance/Iter1/Tc12.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2004-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 // Author: Franco.Bellu@symbian.com
       
    15 // 
       
    16 //
       
    17 
       
    18 
       
    19 #ifndef __TC12_H__
       
    20 #define __TC12_H__
       
    21 
       
    22 #include "HttpTestCore.h"
       
    23 #include <http.h>
       
    24 #include "csrvaddrval.h"
       
    25 
       
    26 
       
    27 /** 
       
    28  * BEHAVIOR TO TEST: The VF to generate an EFailed Event AND to terminate 
       
    29  * the transaction with RHTTPTransaction::Cancel().
       
    30  * This situation can happen as a result of a badly formulated Request (At 
       
    31  * this stage only POST and GET are tested):
       
    32  * 1)GET request with body data 
       
    33  * 2)POST request without body data
       
    34  * 3)POST request wit body data but without the minimum entity header 
       
    35  * The DoRunL() function simulate this 3 situation making 3 transaction in 
       
    36  * sequence using the same session:
       
    37  * 1) GET request with body data
       
    38  * The MHFRunL() should log the KErrHttpGetReqWithBody error status message 
       
    39  * issued by the VF and the consequent EFailed one .In addition the 
       
    40  * Transaction is cancelled as shown in the httptextprt.txt log file.
       
    41  * 2) POST request without body datais sent with no body
       
    42  * The MHFRunL() should log the KErrHttpPostReqWithoutBody error status 
       
    43  * message issued by the VF and the consequent EFailed one. In addition the 
       
    44  * Transaction is cancelled as shown in the httptextprt.txt log file.
       
    45  * 3) POST request with body data(as it should be)but without an entity header:
       
    46  * 'Content-Length:6'.
       
    47  * The MHFRunL() should log the KErrHttpReqWithoutEntityHeaders error status 
       
    48  * message issued by the VF and the consequent EFailed one. In addition the 
       
    49  * Transaction is cancelled as shown in the httptextprt.txt log file.
       
    50  * NB: For the purpose of this test case the content of the headers and the 
       
    51  * body won't be showed.
       
    52  */
       
    53 
       
    54 class CHttpTestCase12: public CHttpTestTransBase, public MHTTPTransactionCallback
       
    55 	{
       
    56 	//to implement in this class' member functs definitions
       
    57 public:
       
    58 	CHttpTestCase12(CScriptFile* aIniSettingsFile);
       
    59 	virtual ~CHttpTestCase12();
       
    60 
       
    61 	virtual void MHFRunL(RHTTPTransaction aTransaction,
       
    62 								const THTTPEvent& aEvent) ;
       
    63 	virtual TInt MHFRunError(TInt aError,RHTTPTransaction aTransaction,
       
    64 								const THTTPEvent& aEvent);
       
    65 private:	
       
    66 	const TDesC& TestName();
       
    67 	virtual void DoRunL();
       
    68 	virtual TInt RunError(TInt aErr);
       
    69 	virtual void DoCancel();	
       
    70 	void OpenTestTransaction1L();
       
    71 	void CloseTestTransaction1();
       
    72 	void OpenTestTransaction2L();
       
    73 	void CloseTestTransaction2();
       
    74 	void OpenTestTransaction3L();
       
    75 	void CloseTestTransaction3();
       
    76 protected:
       
    77 	void CompleteOwnRequest();
       
    78 private:
       
    79 	RHTTPSession iSession;
       
    80 	RHTTPTransaction iTransaction;
       
    81 	RStringF iIpAddr;
       
    82 	/** This has the instance of the settings.ini file.  This instance is passed
       
    83 	 to ReplaceHostNameL() function which uses this instance to retrieve the
       
    84 	 data from settings.ini file.
       
    85 	 */
       
    86 	CScriptFile* iIniSettingsFile;
       
    87 	};
       
    88 
       
    89 #endif