applayerprotocols/httptransportfw/Test/T_HttpPipeliningTest/ctestcase26.cpp
changeset 0 b16258d2340f
child 19 c0c2f28ace9c
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2003-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 #include "CTestCase26.h"
       
    17 #include "httptestutils.h"
       
    18 
       
    19 const TInt KTransactionCount = 14;
       
    20 
       
    21 CTestCase26* CTestCase26::NewL(CHTTPTestUtils& aTestUtils)
       
    22 	{
       
    23 	CTestCase26* self = new (ELeave) CTestCase26(aTestUtils);
       
    24 	CleanupStack::PushL(self);
       
    25 	self->ConstructL();
       
    26 	CleanupStack::Pop(self);
       
    27 	return self;
       
    28 	}
       
    29 
       
    30 CTestCase26::CTestCase26(CHTTPTestUtils& aTestUtils)
       
    31 : CBatchingTestCase(), iTestUtils(aTestUtils)
       
    32 	{
       
    33 	}
       
    34 
       
    35 void CTestCase26::ConstructL()
       
    36 	{
       
    37 	}
       
    38 
       
    39 CTestCase26::~CTestCase26()
       
    40 	{
       
    41 	}
       
    42 
       
    43 const TDesC& CTestCase26::TestCaseName() const
       
    44 	{
       
    45 	_LIT(KTxtTitle, "Test Case 26");
       
    46 	return KTxtTitle();
       
    47 	}
       
    48 
       
    49 TInt CTestCase26::TotalTransactionCount() const
       
    50 	{
       
    51 	return KTransactionCount;
       
    52 	}
       
    53 	
       
    54 RHTTPTransaction CTestCase26::GetTransactionL(TInt aIndex, RHTTPSession aSession, MHTTPTransactionCallback& aClient)
       
    55 	{
       
    56 	__ASSERT_ALWAYS(aIndex<KTransactionCount, User::Invariant());
       
    57 	
       
    58 	TPtrC8 uriDes;
       
    59 	
       
    60 	switch(aIndex)
       
    61 		{
       
    62 		case 0:
       
    63 			{
       
    64 			uriDes.Set(_L8("http://10.29.23.12"));
       
    65 			} break;
       
    66 		case 1:
       
    67 			{
       
    68 			uriDes.Set(_L8("http://10.29.23.12/manual/index.html"));
       
    69 			} break;
       
    70 		case 2:
       
    71 			{
       
    72 			uriDes.Set(_L8("http://10.29.23.12/manual/new_features_1_3.html"));
       
    73 			} break;
       
    74 		case 3:
       
    75 			{
       
    76 			uriDes.Set(_L8("http://10.29.23.12/wap/suite-08Jun2000/"));
       
    77 			} break;
       
    78 		case 4:
       
    79 			{
       
    80 			uriDes.Set(_L8("http://10.29.23.12/wap/suite-20Jun2000/"));
       
    81 			} break;
       
    82 		case 5:
       
    83 			{
       
    84 			uriDes.Set(_L8("http://10.29.23.12/manual/upgrading_to_1_3.html"));
       
    85 			} break;
       
    86 		case 6:
       
    87 			{
       
    88 			uriDes.Set(_L8("http://10.29.23.12/manual/install.html"));
       
    89 			} break;
       
    90 		case 7:
       
    91 			{
       
    92 			uriDes.Set(_L8("http://10.29.23.12/manual/invoking.html"));
       
    93 			} break;
       
    94 		case 8:
       
    95 			{
       
    96 			uriDes.Set(_L8("http://10.29.23.12/stats.html"));
       
    97 			} break;
       
    98 		case 9:
       
    99 			{
       
   100 			uriDes.Set(_L8("http://10.29.23.12/manual/stopping.html"));
       
   101 			} break;
       
   102 		case 10:
       
   103 			{
       
   104 			uriDes.Set(_L8("http://10.29.23.12/manual/mod/directives.html"));
       
   105 			} break;
       
   106 		case 11:
       
   107 			{
       
   108 			uriDes.Set(_L8("http://10.29.23.12/manual/images/custom_errordocs.gif"));
       
   109 			} break;
       
   110 		case 12:
       
   111 			{
       
   112 			uriDes.Set(_L8("http://10.29.23.12/manual/images/home.gif"));
       
   113 			} break;
       
   114 		case 13:
       
   115 			{
       
   116 			uriDes.Set(_L8("http://10.29.23.12/manual/images/index.gif"));
       
   117 			} break;
       
   118 		default:
       
   119 			// Shouldn't happen!
       
   120 			User::Invariant();
       
   121 			break;
       
   122 		}
       
   123 	
       
   124 	
       
   125 	RStringF method = aSession.StringPool().StringF(HTTP::EGET,RHTTPSession::GetTable());
       
   126 	TUriParser8 uri; 
       
   127 	uri.Parse(uriDes);
       
   128 	return aSession.OpenTransactionL(uri, aClient, method);
       
   129 	}
       
   130 
       
   131 const TDesC8& CTestCase26::GetRawRequest(TInt /*aConnectionIndex*/, TInt /*aTransIndex*/)
       
   132 	{
       
   133 	// This method shoulod never be called as we are going to a live server
       
   134 	User::Invariant();
       
   135 	
       
   136 	return KNullDesC8();
       
   137 	}
       
   138 	
       
   139 const TDesC8& CTestCase26::GetRawResponse(TInt /*aConnectionIndex*/, TInt /*aTransIndex*/)
       
   140 	{
       
   141 	// This method shoulod never be called as we are going to a live server
       
   142 	User::Invariant();
       
   143 	
       
   144 	return KNullDesC8();
       
   145 	}
       
   146 	
       
   147 	
       
   148 TInt CTestCase26::RealExpectedConnectionCount() const
       
   149 	{
       
   150 	return 1;
       
   151 	}
       
   152 	
       
   153 TBool CTestCase26::SetTransportHandlerPriority() const
       
   154 	{
       
   155 	return ETrue;
       
   156 	}