author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 19 | 989d2f495d90 |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: ?Description |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
#ifndef ISERVICETESTMODULE_H |
|
21 |
#define ISERVICETESTMODULE_H |
|
22 |
||
23 |
// INCLUDES |
|
24 |
#include <StifLogger.h> |
|
25 |
#include <TestScripterInternal.h> |
|
26 |
#include <StifTestModule.h> |
|
27 |
||
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
28 |
#include <liwcommon.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
29 |
#include <liwbufferextension.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
30 |
#include <liwservicehandler.h> |
19 | 31 |
|
32 |
// CONSTANTS |
|
33 |
//const ?type ?constant_var = ?constant; |
|
34 |
||
35 |
// MACROS |
|
36 |
//#define ?macro ?macro_def |
|
37 |
#define TEST_CLASS_VERSION_MAJOR 0 |
|
38 |
#define TEST_CLASS_VERSION_MINOR 0 |
|
39 |
#define TEST_CLASS_VERSION_BUILD 0 |
|
40 |
||
41 |
// Logging path |
|
42 |
_LIT( KIServiceTestModuleLogPath, "\\logs\\testframework\\" ); |
|
43 |
// Log file |
|
44 |
_LIT( KIServiceTestModuleLogFile, "IServiceTestModule.txt" ); |
|
45 |
_LIT( KIServiceTestModuleLogFileWithTitle, "IServiceTestModule_[%S].txt" ); |
|
46 |
||
47 |
// FUNCTION PROTOTYPES |
|
48 |
//?type ?function_name(?arg_list); |
|
49 |
||
50 |
// FORWARD DECLARATIONS |
|
51 |
//class ?FORWARD_CLASSNAME; |
|
52 |
class CIServiceTestModule; |
|
53 |
||
54 |
/** |
|
55 |
* CIServiceTestModule test class for STIF Test Framework TestScripter. |
|
56 |
* ?other_description_lines |
|
57 |
* |
|
58 |
* @lib ?library |
|
59 |
* @since ?Series60_version |
|
60 |
*/ |
|
61 |
NONSHARABLE_CLASS(CIServiceTestModule) : public CScriptBase,public MLiwNotifyCallback |
|
62 |
{ |
|
63 |
public: // Constructors and destructor |
|
64 |
||
65 |
/** |
|
66 |
* Two-phased constructor. |
|
67 |
*/ |
|
68 |
static CIServiceTestModule* NewL( CTestModuleIf& aTestModuleIf ); |
|
69 |
||
70 |
/** |
|
71 |
* Destructor. |
|
72 |
*/ |
|
73 |
virtual ~CIServiceTestModule(); |
|
74 |
||
75 |
public: // New functions |
|
76 |
||
77 |
/** |
|
78 |
* ?member_description. |
|
79 |
* @since ?Series60_version |
|
80 |
* @param ?arg1 ?description |
|
81 |
* @return ?description |
|
82 |
*/ |
|
83 |
//?type ?member_function( ?type ?arg1 ); |
|
84 |
||
85 |
public: // Functions from base classes |
|
86 |
||
87 |
/** |
|
88 |
* From CScriptBase Runs a script line. |
|
89 |
* @since ?Series60_version |
|
90 |
* @param aItem Script line containing method name and parameters |
|
91 |
* @return Symbian OS error code |
|
92 |
*/ |
|
93 |
virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
94 |
||
95 |
TInt HandleNotifyL(TInt aCmdId, |
|
96 |
TInt aEventId, |
|
97 |
CLiwGenericParamList& aEventParamList, |
|
98 |
const CLiwGenericParamList& aInParamList); |
|
99 |
||
100 |
void LoadServiceRegistry(); |
|
101 |
||
102 |
||
103 |
protected: // New functions |
|
104 |
||
105 |
/** |
|
106 |
* ?member_description. |
|
107 |
* @since ?Series60_version |
|
108 |
* @param ?arg1 ?description |
|
109 |
* @return ?description |
|
110 |
*/ |
|
111 |
//?type ?member_function( ?type ?arg1 ); |
|
112 |
||
113 |
protected: // Functions from base classes |
|
114 |
||
115 |
/** |
|
116 |
* From ?base_class ?member_description |
|
117 |
*/ |
|
118 |
//?type ?member_function(); |
|
119 |
||
120 |
private: |
|
121 |
||
122 |
/** |
|
123 |
* C++ default constructor. |
|
124 |
*/ |
|
125 |
CIServiceTestModule( CTestModuleIf& aTestModuleIf ); |
|
126 |
||
127 |
/** |
|
128 |
* By default Symbian 2nd phase constructor is private. |
|
129 |
*/ |
|
130 |
void ConstructL(); |
|
131 |
||
132 |
// Prohibit copy constructor if not deriving from CBase. |
|
133 |
// ?classname( const ?classname& ); |
|
134 |
// Prohibit assigment operator if not deriving from CBase. |
|
135 |
// ?classname& operator=( const ?classname& ); |
|
136 |
||
137 |
/** |
|
138 |
* Frees all resources allocated from test methods. |
|
139 |
* @since ?Series60_version |
|
140 |
*/ |
|
141 |
void Delete(); |
|
142 |
/** |
|
143 |
* Test methods are listed below. |
|
144 |
*/ |
|
145 |
||
146 |
/** |
|
147 |
* Example test method. |
|
148 |
* @since ?Series60_version |
|
149 |
* @param aItem Script line containing parameters. |
|
150 |
* @return Symbian OS error code. |
|
151 |
*/ |
|
152 |
virtual TInt GetMetaDataListL( CStifItemParser& aItem ); |
|
153 |
||
154 |
CLiwDefaultMap* SetInputFilterL( CStifItemParser& aItem ); |
|
155 |
||
156 |
void SetExpectedOutputMap( CStifItemParser& aItem ); |
|
157 |
||
158 |
||
159 |
TBool CompareMaps(CLiwMap* aExpectedMap, |
|
160 |
const CLiwMap* aResultMap); |
|
161 |
||
162 |
||
163 |
||
164 |
TBool CompareTRealResult(const TDesC8& aKey, |
|
165 |
CLiwMap* aExpectedMap, |
|
166 |
const CLiwMap* aResultMap); |
|
167 |
||
168 |
||
169 |
TBool CompareStringResult(const TDesC8& aKey, |
|
170 |
CLiwMap* aExpectedMap, |
|
171 |
const CLiwMap* aResultMap); |
|
172 |
||
173 |
||
174 |
TBool IsExpectedResult(CLiwIterable* aResultlist); |
|
175 |
||
176 |
TInt LoadProviderTest(CStifItemParser& aItem); |
|
177 |
TInt GetListTwice(CStifItemParser& aItem); |
|
178 |
TInt InvalidCommand(CStifItemParser& aItem); |
|
179 |
TInt CancelInvalidTransID(CStifItemParser& aItem); |
|
180 |
TInt InvalidServiceValue(CStifItemParser& aItem); |
|
181 |
TInt InvalidInterfaceValue(CStifItemParser& aItem); |
|
182 |
TInt InvalidMinVerValue(CStifItemParser& aItem); |
|
183 |
TInt InvalidMaxVerValue(CStifItemParser& aItem); |
|
184 |
TInt InvalidFilterValue(CStifItemParser& aItem); |
|
185 |
||
186 |
/** |
|
187 |
* Method used to log version of test class |
|
188 |
*/ |
|
189 |
void SendTestClassVersion(); |
|
190 |
||
191 |
||
192 |
private: |
|
193 |
CLiwServiceHandler* iServiceHandler; |
|
194 |
MLiwInterface* iIface; |
|
195 |
CLiwCriteriaItem* iCriteria; |
|
196 |
RCriteriaArray iCriteriaArray; |
|
197 |
||
198 |
CLiwGenericParamList* iInparams; |
|
199 |
CLiwGenericParamList* iOutparams; // Data |
|
200 |
||
201 |
TInt iResult; |
|
202 |
TInt iExpectedError; |
|
203 |
RPointerArray<CLiwMap> iExpectedOutPutArray; |
|
204 |
}; |
|
205 |
||
206 |
#endif // ISERVICETESTMODULE_H |