|
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 #ifndef __CPIPELININGTESTCASE_H__ |
|
17 #define __CPIPELININGTESTCASE_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <http.h> |
|
21 |
|
22 #include "MPipeliningTestCase.h" |
|
23 |
|
24 /* |
|
25 The CPipeliningTestCase is a simple class to inherit from MPipeliningTestCase to provide |
|
26 default implementations for some of the functions required by MPipeliningTestCase. Many |
|
27 methods in this class are sometimes not really required so this is class has been |
|
28 introduced to provide some default implementations. All these methods are virtual so that |
|
29 any of them can be overriden with new implementations. |
|
30 */ |
|
31 class CPipeliningTestCase : public CBase, |
|
32 public MPipeliningTestCase |
|
33 { |
|
34 public: |
|
35 ~CPipeliningTestCase(); |
|
36 |
|
37 |
|
38 |
|
39 /* |
|
40 This method should return the number of transactions on a giving connection index. Most |
|
41 test will only require a single connection so this method should return the same value |
|
42 as MPipeliningTestCase::TotalTransactionCount() so this method will simply call that. |
|
43 */ |
|
44 virtual TInt TransactionCount(TInt aConnectionIndex) const; |
|
45 |
|
46 /* |
|
47 This method allows the test case to set an option into how the transactions are |
|
48 submitted. If this method returns ETrue, the transaction will be batched where they are |
|
49 all opened first and then submitted all together, or else return EFalse so transactions |
|
50 are submitted as they are opened. Most test cases will require that transaction are |
|
51 batched so the default implementation is to return ETrue. |
|
52 */ |
|
53 virtual TBool BatchTransactions() const; |
|
54 |
|
55 /* |
|
56 When the client receives a transaction event, the error code can be checked to verify |
|
57 what (if any) error code is expected. The transaction is supplied so that the test case |
|
58 can identify the transaction by Id(). Most test cases will not expect an error code so |
|
59 the default implementation is to simply return KErrNone. |
|
60 */ |
|
61 virtual TInt ExpectedError(RHTTPTransaction aTrans); |
|
62 |
|
63 /* |
|
64 This method should return the number of connections that is expected to open with the |
|
65 test server in the test case. If the test server is not being used (ie. transactions are |
|
66 going to 'real' servers) then this should return 0. For simplicity, the default |
|
67 implementation is to return 0. |
|
68 */ |
|
69 virtual TInt ConnectionCount() const; |
|
70 |
|
71 /* |
|
72 This method should return the number of expected connections opened with real servers. |
|
73 This information is stored by the protocol handler in debug mode only and checked. |
|
74 |
|
75 When using the test server this should return the same as ConnectionCount() |
|
76 */ |
|
77 TInt RealExpectedConnectionCount() const; |
|
78 |
|
79 /* |
|
80 This method will indicate whether to enable batching (request buffering). Most pipelining |
|
81 test cases do not require batching to be enabled so the default implementation is to return |
|
82 EFalse. |
|
83 */ |
|
84 virtual TBool EnableBatching() const; |
|
85 |
|
86 void ProcessHeadersL(RHTTPTransaction aTrans); |
|
87 |
|
88 virtual TBool TransportHandlerPriority() const; |
|
89 |
|
90 |
|
91 protected: |
|
92 CPipeliningTestCase(); |
|
93 |
|
94 }; |
|
95 |
|
96 #endif // __CPIPELININGTESTCASE_H__ |