|
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 __CTESTENGINE_H__ |
|
17 #define __CTESTENGINE_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <f32file.h> |
|
21 #include <http/framework/cprottransaction.h> |
|
22 #if !defined __MTESTOBSERVER_H__ |
|
23 #include "mtestobserver.h" |
|
24 #endif |
|
25 #if !defined(__HTTPTESTCORE_H__) |
|
26 #include "HttpTestCore.h" |
|
27 #endif |
|
28 /** @class CTestEngine |
|
29 @todo |
|
30 @since 8.0 |
|
31 */ |
|
32 class CTestEngine : public CHttpTestBase,public MTestObserver |
|
33 |
|
34 { |
|
35 public: // methods |
|
36 |
|
37 /** @fn NewL() |
|
38 Factory constructor. |
|
39 @since 8.0 |
|
40 @return A pointer to a fully initialised object. |
|
41 */ |
|
42 static CTestEngine* NewL(); |
|
43 |
|
44 /** @fn ~CTestEngine |
|
45 Destructor. |
|
46 @since 8.0 |
|
47 */ |
|
48 virtual ~CTestEngine(); |
|
49 |
|
50 /** @fn DoTestsL() |
|
51 Starts the test run. |
|
52 @since 8.0 |
|
53 */ |
|
54 // void DoTestsL(); |
|
55 |
|
56 |
|
57 public: |
|
58 const TDesC& TestName(); |
|
59 void RunTestsL(); |
|
60 void DoRunL(); |
|
61 void DoCancel(); |
|
62 public: // methods from CProtTransaction |
|
63 |
|
64 // virtual void CreateTxDataL(); |
|
65 // virtual void CreateRxDataL(MRxDataObserver& aObserver); |
|
66 |
|
67 private: // methods |
|
68 |
|
69 /** @fn CTestEngine() |
|
70 Constructor. |
|
71 @since 8.0 |
|
72 */ |
|
73 CTestEngine(); |
|
74 |
|
75 /** @fn ConstructL() |
|
76 Second phase constructor. |
|
77 @since 8.0 |
|
78 */ |
|
79 void ConstructL(); |
|
80 |
|
81 // Test |
|
82 void TestComposeMessageL(TInt aNumberofHeaders); |
|
83 void TestParseMessageL(TInt aMessageType); |
|
84 |
|
85 |
|
86 private: // methods from MTestObserver |
|
87 |
|
88 virtual void NotifyError(TInt aError); |
|
89 virtual void NotifyStart(); |
|
90 void NotifyComplete(); |
|
91 |
|
92 //logger related |
|
93 private: |
|
94 IMPORT_C void StartTimer(); |
|
95 IMPORT_C void EndTimer(const TDesC&); |
|
96 void LogIt(const TDesC& aComment); |
|
97 |
|
98 private: // attributes |
|
99 |
|
100 TInt iTestCount; |
|
101 TBool iTestFailed; |
|
102 //Timer related |
|
103 RFs iFs; |
|
104 RFile iFile; |
|
105 TUint32 iStartTime; |
|
106 TUint32 iEndTime; |
|
107 TTimeIntervalMicroSeconds iTimeDifference ; |
|
108 CHTTPTestUtils* iTestUtils; |
|
109 }; |
|
110 |
|
111 #endif // __CTESTENGINE_H__ |