|
1 /* |
|
2 * Copyright (c) 2005-2006 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 "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: "testclass" Test module for STIF FW |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_COMASUPLPOSTESTERMODULECFG_H |
|
20 #define C_COMASUPLPOSTESTERMODULECFG_H |
|
21 |
|
22 #include <stiflogger.h> |
|
23 #include <testscripterinternal.h> |
|
24 #include <stiftestmodule.h> |
|
25 #include "epos_comasuplpostestercategory.h" |
|
26 |
|
27 /** Logging path */ |
|
28 _LIT( KPosTesterModuleCfgLogPath, "\\logs\\testframework\\PosTesterModuleCfg\\" ); |
|
29 /** Log file */ |
|
30 _LIT( KPosTesterModuleCfgLogFile, "PosTesterModuleCfg.txt" ); |
|
31 |
|
32 class COMASuplPosTesterModuleCfg; |
|
33 class COMASuplEComHandler; |
|
34 class COMASuplConsoleManager; |
|
35 class CImplementationInformation; |
|
36 class COMASuplTestHandler; |
|
37 class COMASuplPosTesterLogger; |
|
38 class COMASuplPosHandlerBase; |
|
39 class COMASuplPosTesterCategory; |
|
40 class COMASuplThreadProcessTest; |
|
41 /** |
|
42 * COMASuplPosTesterModuleCfg test class for STIF Test Framework TestScripter. |
|
43 * Execites tests, sequence is controlled by cfg file. |
|
44 * |
|
45 * @lib epos_comasuplpostestermodulecfg.lib |
|
46 * @since S60 v3.1u |
|
47 */ |
|
48 NONSHARABLE_CLASS(COMASuplPosTesterModuleCfg) : public CScriptBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 static COMASuplPosTesterModuleCfg* NewL( CTestModuleIf& aTestModuleIf ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~COMASuplPosTesterModuleCfg(); |
|
61 |
|
62 public: // Functions from base classes |
|
63 /** |
|
64 * From CScriptBase |
|
65 * Runs a script line. |
|
66 * |
|
67 * @since S60 v3.1u |
|
68 * @param aItem Script line containing method name and parameters |
|
69 */ |
|
70 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
71 |
|
72 private: |
|
73 |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 COMASuplPosTesterModuleCfg( CTestModuleIf& aTestModuleIf ); |
|
78 |
|
79 /** |
|
80 * By default Symbian 2nd phase constructor is private. |
|
81 */ |
|
82 void ConstructL(); |
|
83 |
|
84 /** |
|
85 * Frees all resources allocated from test methods. |
|
86 * @since S60 v3.1 |
|
87 * @return void |
|
88 */ |
|
89 void Delete(); |
|
90 |
|
91 /** |
|
92 * Test methods are listed below. |
|
93 */ |
|
94 |
|
95 /** |
|
96 * Test method. |
|
97 * @since S60 v3.1 |
|
98 * @param aItem Script line containing parameters. |
|
99 * @return Symbian OS error code. |
|
100 */ |
|
101 virtual TInt SuplGatewayTestL( CStifItemParser& aItem ); |
|
102 |
|
103 /** |
|
104 * Test method. |
|
105 * @since S60 v3.1 |
|
106 * @param aItem Script line containing parameters. |
|
107 * @return Symbian OS error code. |
|
108 */ |
|
109 virtual TInt GetUserSelectionL( CStifItemParser& aItem ); |
|
110 |
|
111 /** |
|
112 * Test method. |
|
113 * @since S60 v3.1 |
|
114 * @param aItem Script line containing parameters. |
|
115 * @return Symbian OS error code. |
|
116 */ |
|
117 virtual TInt Uid_ECom_TestL( CStifItemParser& aItem ); |
|
118 |
|
119 /** |
|
120 * Test method. |
|
121 * @since S60 v3.1 |
|
122 * @param aItem Script line containing parameters. |
|
123 * @return Symbian OS error code. |
|
124 */ |
|
125 virtual TInt PosHandlerCreationL( CStifItemParser& aItem ); |
|
126 |
|
127 /** |
|
128 * Test method. |
|
129 * @since S60 v3.1 |
|
130 * @param aItem Script line containing parameters. |
|
131 * @return Symbian OS error code. |
|
132 */ |
|
133 virtual TInt PosSessionCreationL( CStifItemParser& aItem ); |
|
134 |
|
135 /** |
|
136 * Test method. |
|
137 * @since S60 v3.1 |
|
138 * @param aItem Script line containing parameters. |
|
139 * @return Symbian OS error code. |
|
140 */ |
|
141 virtual TInt GetSuplInfoTestL(CStifItemParser& aItem); |
|
142 |
|
143 /** |
|
144 * Test method. |
|
145 * @since S60 v3.1 |
|
146 * @param aItem Script line containing parameters. |
|
147 * @return Symbian OS error code. |
|
148 */ |
|
149 virtual TInt GetSuplInfoCancelTestL( CStifItemParser& aItem); |
|
150 |
|
151 /** |
|
152 * Test method. |
|
153 * @since S60 v3.1 |
|
154 * @param aItem Script line containing parameters. |
|
155 * @return Symbian OS error code. |
|
156 */ |
|
157 virtual TInt MessageReaderL(CStifItemParser& aItem); |
|
158 |
|
159 /** |
|
160 * Test method. |
|
161 * @since S60 v3.1 |
|
162 * @param aItem Script line containing parameters. |
|
163 * @return Symbian OS error code. |
|
164 */ |
|
165 virtual TInt PositionVelocityTestL(CStifItemParser& aItem); |
|
166 |
|
167 /** |
|
168 * Test method. |
|
169 * @since S60 v3.1 |
|
170 * @param aItem Script line containing parameters. |
|
171 * @return Symbian OS error code. |
|
172 */ |
|
173 virtual TInt PositionCancellationTestL(CStifItemParser& aItem); |
|
174 |
|
175 /** |
|
176 * Test method. |
|
177 * @since S60 v3.1 |
|
178 * @param aItem Script line containing parameters. |
|
179 * @return Symbian OS error code. |
|
180 */ |
|
181 virtual TInt InitializeCancelTestL(CStifItemParser& aItem); |
|
182 |
|
183 /** |
|
184 * Test method. |
|
185 * @since S60 v3.1 |
|
186 * @param aItem Script line containing parameters. |
|
187 * @return Symbian OS error code. |
|
188 */ |
|
189 virtual TInt PositionTestL(CStifItemParser& aItem); |
|
190 |
|
191 /** |
|
192 * Test method. |
|
193 * @since S60 v3.1 |
|
194 * @param aItem Script line containing parameters. |
|
195 * @return Symbian OS error code. |
|
196 */ |
|
197 virtual TInt MultipleSessionTestL(CStifItemParser& /*aItem*/); |
|
198 /** |
|
199 * Test method. |
|
200 * @since S60 v3.1 |
|
201 * @param aItem Script line containing parameters. |
|
202 * @return Symbian OS error code. |
|
203 */ |
|
204 virtual TInt WriteSummaryL (CStifItemParser& aItem); |
|
205 |
|
206 /** |
|
207 * Test method. |
|
208 * @since S60 v3.1 |
|
209 * @param aItem Script line containing parameters. |
|
210 * @return Symbian OS error code. |
|
211 */ |
|
212 virtual TInt SessionTestL(CStifItemParser& aItem); |
|
213 |
|
214 /** |
|
215 * Prepares filename from the displayname of the implementation. |
|
216 * |
|
217 * @since S60 v3.1 |
|
218 * @param aOutputFileName Name of output file. |
|
219 * @param aImplInfo Implementation. |
|
220 * @return void |
|
221 */ |
|
222 void PrepareFileName(TFileName& aOutputFileName, |
|
223 const CImplementationInformation& aImplInfo); |
|
224 |
|
225 /** |
|
226 * Prepares filename from the displayname of the implementation. |
|
227 * |
|
228 * @since S60 v3.1 |
|
229 * @param aChar Character is checked if it can be used in file name. |
|
230 * @return TBool True if character can be used in a file name. |
|
231 */ |
|
232 TBool IsValidFileNameChar(const TUint16* aChar); |
|
233 |
|
234 /** |
|
235 * Adds number of info, warning and error messages to member variables. |
|
236 * |
|
237 * @since S60 v3.1 |
|
238 * @param aTestCat Test class whose summary is to be added. |
|
239 * @return void |
|
240 */ |
|
241 void UpdateSummary(COMASuplPosTesterCategory* aTestCat); |
|
242 |
|
243 private: |
|
244 /** |
|
245 * It is used to identify all implementations |
|
246 * Own. |
|
247 */ |
|
248 COMASuplEComHandler* iEComHandler; |
|
249 /** |
|
250 * Controls display of list and selection. |
|
251 * Own. |
|
252 */ |
|
253 COMASuplConsoleManager* iConsoleManager; |
|
254 /** |
|
255 * provides logging utility. |
|
256 * Own. |
|
257 */ |
|
258 COMASuplPosTesterLogger* iPosLogger; |
|
259 /** |
|
260 * Name of the logfile prepared from Display name. |
|
261 */ |
|
262 TFileName iLogFileName; |
|
263 /** |
|
264 * Points to the implementation selected by the user. |
|
265 * If there is only one implementation, it is selected. |
|
266 * Own. |
|
267 */ |
|
268 CImplementationInformation* iSelectedImpl; |
|
269 /** |
|
270 * Controls tests and monitors user inputs/request for cancellation. |
|
271 * Own. |
|
272 */ |
|
273 COMASuplTestHandler* iTestHandler; |
|
274 |
|
275 /** |
|
276 * ETrue if testing is canceled by user. |
|
277 */ |
|
278 TBool iTestingCancelled; |
|
279 /** |
|
280 * POS handler provided to tests . |
|
281 * Own. |
|
282 */ |
|
283 COMASuplPosHandlerBase* iPosHandler; |
|
284 |
|
285 /** |
|
286 * Total number of infos during a test cycle. |
|
287 */ |
|
288 TInt iNetInfos; |
|
289 |
|
290 /** |
|
291 * Total number of warnings during a test cycle. |
|
292 */ |
|
293 TInt iNetWarnings; |
|
294 |
|
295 /** |
|
296 * Total number of errors during a test cycle. |
|
297 */ |
|
298 TInt iNetErrors; |
|
299 |
|
300 /** |
|
301 * Status of testing. |
|
302 */ |
|
303 TTestingStatus iTestingStatus; |
|
304 |
|
305 /** |
|
306 * Object of test class for Thread and process thread. |
|
307 */ |
|
308 COMASuplThreadProcessTest* iThreadTester; |
|
309 }; |
|
310 |
|
311 #endif |