|
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 "parsers.h" |
|
17 #include "commands.h" |
|
18 |
|
19 #ifndef _NO_IAP_PREFS |
|
20 #include <iapprefs.h> |
|
21 #endif |
|
22 |
|
23 |
|
24 // Msv client commands |
|
25 _LIT(KCommandStartClientSession, "start_client_session"); // 0 parameters, initialises CMsvTestUtils, and frees resources. Should be called at the start of every section |
|
26 _LIT(KCommandResetClient, "reset_client"); // 0 parameters, resets CMsvTestUtils, and frees resources. Should be called at the end of every section |
|
27 |
|
28 // Msv utility commands |
|
29 _LIT(KCommandCleanMessageFolder, "clean_message_folder"); // 0 parameters, deletes message store |
|
30 _LIT(KCommandCheckMessageStore, "check_message_store"); |
|
31 _LIT(KCommandAddComment, "add_comment"); // n parameters, adds a comment to the log, concatenates parameters |
|
32 _LIT(KCommandWait, "wait"); // 1 parameter, waits for n seconds... |
|
33 _LIT(KCommandTestEntry, "test_entry"); // 1 parameter, tests the attributes of the currently selected message |
|
34 _LIT(KCommandDumpMessageStore, "dump_message_store"); // 0 parameters, outputs the contents of the message store to a file |
|
35 |
|
36 // Msv selection commands |
|
37 _LIT(KCommandSelectFolder, "select_folder"); // 1 parameter, selects a folder |
|
38 _LIT(KCommandSelectEntry, "select_entry"); // 1 parameter, select an entry by looking in iDetails and iDescription (Note: can only take 1 parameter) |
|
39 _LIT(KCommandSelectRootFolder, "select_root_folder"); // 0 parameters, selects root |
|
40 _LIT(KCommandSelectAllMessages, "select_all_messages"); // 0 parameters, selects all entries in current folder |
|
41 _LIT(KCommandSelectDestination, "select_destination_folder"); // 1 parameter, selects a destination folder used for copying and moving |
|
42 _LIT(KCommandCheckSelectionCount, "check_selection_count"); // 1 parameter, tests the current selection count == parameter |
|
43 _LIT(KCommandSelectLastInSelection, "select_last_in_selection"); // 1 parameter, reduces the current selection to its last N entries |
|
44 _LIT(KCommandSelectFirstInSelection,"select_first_in_selection"); // 1 parameter, reduces the current selection to its first N entries |
|
45 _LIT(KCommandCheckRemoteFolderSize, "check_remote_folder_size"); // 1 parameter, checks the remote folder size is what is expected |
|
46 _LIT(KCommandSelectPopulated, "select_populated"); // 0 parameter, selects populated messages in the current selection |
|
47 _LIT(KCommandCheckNewFlag, "check_new_flag"); // 2 parameters, tests if the selected entry(with the index Parameter1) has its New flag == parameter2 |
|
48 _LIT(KCommandCheckPriority, "check_priority"); // 2 parameters, tests if the selected entry(with the index Parameter1) has its Priority flag == parameter2 |
|
49 _LIT(KCommandCheckAttachment, "check_attachment"); // 2 parameters, tests if the selected entry(with the index Parameter1) has its Attachment flag == parameter2 |
|
50 _LIT(KCommandCheckBodyText, "check_body_text"); // 2 parameters, tests if the selected entry(with the index Parameter1) has Body Text == parameter2 |
|
51 |
|
52 // The main section |
|
53 _LIT(KMainSectionName, "main"); |
|
54 |
|
55 |
|
56 // Msv client operations |
|
57 _LIT(KCommandMsvCopySelection, "copy"); // 0 parameters, copies a 'selection' to a 'destination folder' |
|
58 _LIT(KCommandMsvMoveSelection, "move"); // 0 parameters, moves a 'selection' to a 'destination folder' |
|
59 _LIT(KCommandMsvDeleteSelection, "delete"); |
|
60 |
|
61 // Test entry commands |
|
62 _LIT(KCommandTestEntryVisible, "visible"); // 0 parameters, copies a 'selection' to a 'destination folder' |
|
63 _LIT(KCommandTestEntryComplete, "complete"); // 0 parameters, moves a 'selection' to a 'destination folder' |
|
64 |
|
65 // True or False ? |
|
66 _LIT(KParameterETrue, "true"); // !EFalse |
|
67 _LIT(KParameterEFalse, "false"); // EFalse |
|
68 |
|
69 // |
|
70 // |
|
71 // CMainSectionParser |
|
72 // |
|
73 |
|
74 EXPORT_C CMainSectionParser* CMainSectionParser::NewL(CMainTestHarness& aMainTest, CTestScript& aScript) |
|
75 { |
|
76 CMainSectionParser* self = new (ELeave) CMainSectionParser(aMainTest, aScript); |
|
77 CleanupStack::PushL(self); |
|
78 self->ConstructL(); |
|
79 CleanupStack::Pop(self); |
|
80 return self; |
|
81 } |
|
82 |
|
83 EXPORT_C void CMainSectionParser::LogCommentL(const TDesC& aComment) |
|
84 { |
|
85 iMainTest.TestConsole().Printf(aComment); |
|
86 } |
|
87 |
|
88 EXPORT_C void CMainSectionParser::ConstructL() |
|
89 { |
|
90 CBaseSectionParser::ConstructL(KMainSectionName); |
|
91 //iCommandParsers->AppendL(CNewEmailTestCommandParser::NewL(iScript, iMainTest)); |
|
92 } |
|
93 |
|
94 EXPORT_C CMainSectionParser::CMainSectionParser(CMainTestHarness& aMainTest, CTestScript& aScript) : CBaseSectionParser(aScript), iMainTest(aMainTest) |
|
95 { |
|
96 } |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 // |
|
102 // |
|
103 // CMsvUtilitiesParser |
|
104 // |
|
105 |
|
106 EXPORT_C CMsvUtilitiesParser* CMsvUtilitiesParser::NewL(CMsvClientTest& aMsvClientTest) |
|
107 { |
|
108 CMsvUtilitiesParser* self = new (ELeave) CMsvUtilitiesParser(aMsvClientTest); |
|
109 CleanupStack::PushL(self); |
|
110 self->ConstructL(); |
|
111 CleanupStack::Pop(self); |
|
112 return self; |
|
113 } |
|
114 |
|
115 EXPORT_C void CMsvUtilitiesParser::ProcessL() |
|
116 { |
|
117 if ((*iCurrentCommand) == KCommandCleanMessageFolder) |
|
118 { |
|
119 iMsvClientTest.AddStateL(new (ELeave) CCleanMessageFolder(iMsvClientTest.MsvTestUtils()), iDebugInfo); |
|
120 } |
|
121 else if ((*iCurrentCommand) == KCommandCheckMessageStore) |
|
122 { |
|
123 CheckNumberOfArgumentsL(2); |
|
124 TParse fileName; |
|
125 // MMS Test Harness: Changed this line to use the MsvTestUtils version of |
|
126 // ResolveFile() rather than the one declared globally in t_email.cpp. |
|
127 iMsvClientTest.MsvTestUtils().ResolveFile((*iArgumentList)[0], (*iArgumentList)[1], fileName); |
|
128 iMsvClientTest.AddStateL(new (ELeave) CCheckMessageFolder(fileName.FullName(), iMsvClientTest.MsvTestUtils()), iDebugInfo); |
|
129 } |
|
130 else if ((*iCurrentCommand) == KCommandStartClientSession) |
|
131 { |
|
132 iMsvClientTest.AddStateL(new (ELeave) CGoClientSide(iMsvClientTest.MsvTestUtils()), iDebugInfo); |
|
133 } |
|
134 else if ((*iCurrentCommand) == KCommandAddComment) |
|
135 { |
|
136 iMsvClientTest.AddStateL(CAddComment::NewL(*iArgumentList, iMsvClientTest.MsvTestUtils()), iDebugInfo); |
|
137 } |
|
138 else if ((*iCurrentCommand) == KCommandResetClient) |
|
139 { |
|
140 // MMS Test Harness: this wait appears to be useless! |
|
141 //iMsvClientTest.AddStateL(new (ELeave) CLongWait(), iDebugInfo); |
|
142 iMsvClientTest.AddStateL(new (ELeave) CResetMessageServer(iMsvClientTest), iDebugInfo); |
|
143 } |
|
144 else if ((*iCurrentCommand) == KCommandTestEntry) |
|
145 { |
|
146 iMsvClientTest.AddStateL(new (ELeave) CMsvTestEntry(iMsvClientTest), iDebugInfo); |
|
147 |
|
148 // eh xxxx, set up section parser for the details |
|
149 } |
|
150 // MMS Test Harness: added this command to output the contents |
|
151 // of the message store |
|
152 else if ((*iCurrentCommand) == KCommandDumpMessageStore) |
|
153 { |
|
154 iMsvClientTest.AddStateL(new (ELeave) CDumpMessageStore(iMsvClientTest.MsvTestUtils()), iDebugInfo); |
|
155 } |
|
156 // MMS Test Harness: moved the "wait" command here from |
|
157 // CEmailUtilitiesParser. |
|
158 else if ((*iCurrentCommand) == KCommandWait) |
|
159 { |
|
160 CheckNumberOfArgumentsL(1); |
|
161 |
|
162 // Get the Wait Time |
|
163 TLex lex((*iArgumentList)[0]); |
|
164 TInt waitTime; |
|
165 User::LeaveIfError(lex.Val(waitTime)); |
|
166 |
|
167 iMsvClientTest.AddStateL(new (ELeave) CLongWait(waitTime), iDebugInfo); |
|
168 } |
|
169 else |
|
170 { |
|
171 User::Leave(KErrNotFound); |
|
172 } |
|
173 } |
|
174 |
|
175 void CMsvUtilitiesParser::ConstructL() |
|
176 { |
|
177 CBaseCommandParser::ConstructL(); |
|
178 AddCommandL(KCommandCleanMessageFolder); |
|
179 AddCommandL(KCommandCheckMessageStore); |
|
180 AddCommandL(KCommandAddComment); |
|
181 AddCommandL(KCommandStartClientSession); |
|
182 AddCommandL(KCommandResetClient); |
|
183 AddCommandL(KCommandTestEntry); |
|
184 AddCommandL(KCommandDumpMessageStore); |
|
185 // MMS Test Harness: moved the "wait" command here from |
|
186 // CEmailUtilitiesParser. |
|
187 AddCommandL(KCommandWait); |
|
188 } |
|
189 |
|
190 CMsvUtilitiesParser::CMsvUtilitiesParser(CMsvClientTest& aMsvClientTest) : iMsvClientTest(aMsvClientTest) |
|
191 { |
|
192 } |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 // |
|
202 // |
|
203 // CMsvSelectParser |
|
204 // |
|
205 |
|
206 EXPORT_C CMsvSelectParser* CMsvSelectParser::NewL(CMsvClientTest& aMsvClientTest) |
|
207 { |
|
208 CMsvSelectParser* self = new (ELeave) CMsvSelectParser(aMsvClientTest); |
|
209 CleanupStack::PushL(self); |
|
210 self->ConstructL(); |
|
211 CleanupStack::Pop(self); |
|
212 return self; |
|
213 } |
|
214 |
|
215 |
|
216 EXPORT_C void CMsvSelectParser::ProcessL() |
|
217 { |
|
218 if ((*iCurrentCommand) == KCommandSelectFolder) |
|
219 { |
|
220 CheckNumberOfArgumentsL(1); |
|
221 // iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, iMsvClientTest.iSelectedFolder, iMsvClientTest.MsvTestUtils()) |
|
222 // , iDebugInfo); |
|
223 iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, &(iMsvClientTest.iSelectedFolder), iMsvClientTest.MsvTestUtils()) |
|
224 , iDebugInfo); |
|
225 } |
|
226 else if ((*iCurrentCommand) == KCommandSelectEntry) |
|
227 { |
|
228 CheckNumberOfArgumentsL(1); |
|
229 // iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, iMsvClientTest.iSelectedFolder, iMsvClientTest.MsvTestUtils()) |
|
230 // , iDebugInfo); |
|
231 iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, iMsvClientTest.iCurrentSelection, iMsvClientTest.MsvTestUtils()) |
|
232 , iDebugInfo); |
|
233 } |
|
234 else if ((*iCurrentCommand) == KCommandSelectRootFolder) |
|
235 { |
|
236 CheckNumberOfArgumentsL(0); |
|
237 iMsvClientTest.AddStateL(new (ELeave) CSelectEntryById(KMsvRootIndexEntryId, iMsvClientTest.iSelectedFolder, iMsvClientTest.MsvTestUtils()) |
|
238 , iDebugInfo); |
|
239 } |
|
240 else if ((*iCurrentCommand) == KCommandSelectAllMessages) |
|
241 { |
|
242 CheckNumberOfArgumentsL(0); |
|
243 iMsvClientTest.AddStateL(new (ELeave) CSelectAllMessages(iMsvClientTest.iSelectedFolder, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
244 , iDebugInfo); |
|
245 } |
|
246 else if ((*iCurrentCommand) == KCommandSelectDestination) |
|
247 { |
|
248 CheckNumberOfArgumentsL(1); |
|
249 // iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, iMsvClientTest.iDestinationFolder, iMsvClientTest.MsvTestUtils() ) |
|
250 // , iDebugInfo); |
|
251 iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, &(iMsvClientTest.iDestinationFolder), iMsvClientTest.MsvTestUtils() ) |
|
252 , iDebugInfo); |
|
253 } |
|
254 else if ((*iCurrentCommand) == KCommandCheckSelectionCount) |
|
255 { |
|
256 CheckNumberOfArgumentsL(1); |
|
257 TLex lex((*iArgumentList)[0]); |
|
258 TInt expectedCount; |
|
259 User::LeaveIfError(lex.Val(expectedCount)); |
|
260 iMsvClientTest.AddStateL(new (ELeave) CCheckSelectionCount(expectedCount, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
261 , iDebugInfo); |
|
262 } |
|
263 else if ((*iCurrentCommand) == KCommandCheckNewFlag) |
|
264 { |
|
265 CheckNumberOfArgumentsL(2); |
|
266 |
|
267 // Get the index of the Selected Entry to Test |
|
268 TLex lex((*iArgumentList)[0]); |
|
269 TInt selectedIndex; |
|
270 User::LeaveIfError(lex.Val(selectedIndex)); |
|
271 |
|
272 // Get the expected New Status for this entry |
|
273 lex = ((*iArgumentList)[1]); |
|
274 TInt argumentValue; |
|
275 User::LeaveIfError(lex.Val(argumentValue)); |
|
276 TBool expectedNewStatus = STATIC_CAST(TBool, argumentValue); |
|
277 iMsvClientTest.AddStateL(new (ELeave) CCheckNewFlag(selectedIndex, expectedNewStatus, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
278 , iDebugInfo); |
|
279 } |
|
280 else if ((*iCurrentCommand) == KCommandCheckPriority) |
|
281 { |
|
282 CheckNumberOfArgumentsL(2); |
|
283 |
|
284 // Get the index of the Selected Entry to Test |
|
285 TLex lex((*iArgumentList)[0]); |
|
286 TInt selectedIndex; |
|
287 User::LeaveIfError(lex.Val(selectedIndex)); |
|
288 |
|
289 // Get the expected New Status for this entry |
|
290 lex = ((*iArgumentList)[1]); |
|
291 TInt priority; |
|
292 User::LeaveIfError(lex.Val(priority)); |
|
293 iMsvClientTest.AddStateL(new (ELeave) CCheckPriority(selectedIndex, priority, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
294 , iDebugInfo); |
|
295 } |
|
296 else if ((*iCurrentCommand) == KCommandCheckAttachment) |
|
297 { |
|
298 CheckNumberOfArgumentsL(2); |
|
299 |
|
300 // Get the index of the Selected Entry to Test |
|
301 TLex lex((*iArgumentList)[0]); |
|
302 TInt selectedIndex; |
|
303 User::LeaveIfError(lex.Val(selectedIndex)); |
|
304 |
|
305 // Get the expected Attachment Status for this entry |
|
306 lex = ((*iArgumentList)[1]); |
|
307 TInt argumentValue; |
|
308 User::LeaveIfError(lex.Val(argumentValue)); |
|
309 TBool testAttachment = STATIC_CAST(TBool, argumentValue); |
|
310 iMsvClientTest.AddStateL(new (ELeave) CCheckAttachment(selectedIndex, testAttachment, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
311 , iDebugInfo); |
|
312 } |
|
313 else if ((*iCurrentCommand) == KCommandCheckBodyText) |
|
314 { |
|
315 CheckNumberOfArgumentsL(2); |
|
316 |
|
317 // Get the index of the Selected Entry to Test |
|
318 TLex lex((*iArgumentList)[0]); |
|
319 TInt selectedIndex; |
|
320 User::LeaveIfError(lex.Val(selectedIndex)); |
|
321 |
|
322 // Get the expected Body Text |
|
323 TBuf<KMaxTestBodyTxt> bodyText = (*iArgumentList)[1]; |
|
324 iMsvClientTest.AddStateL(CCheckBodyText::NewL(selectedIndex, bodyText, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
325 , iDebugInfo); |
|
326 } |
|
327 else if ((*iCurrentCommand) == KCommandSelectLastInSelection) |
|
328 { |
|
329 CheckNumberOfArgumentsL(1); |
|
330 TLex lex((*iArgumentList)[0]); |
|
331 TInt expectedCount; |
|
332 User::LeaveIfError(lex.Val(expectedCount)); |
|
333 iMsvClientTest.AddStateL(new (ELeave) CSelectLastInSelection(expectedCount, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
334 , iDebugInfo); |
|
335 } |
|
336 else if ((*iCurrentCommand) == KCommandSelectFirstInSelection) |
|
337 { |
|
338 CheckNumberOfArgumentsL(1); |
|
339 TLex lex((*iArgumentList)[0]); |
|
340 TInt expectedCount; |
|
341 User::LeaveIfError(lex.Val(expectedCount)); |
|
342 iMsvClientTest.AddStateL(new (ELeave) CSelectFirstInSelection(expectedCount, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
343 , iDebugInfo); |
|
344 } |
|
345 else if ((*iCurrentCommand) == KCommandCheckRemoteFolderSize) |
|
346 { |
|
347 CheckNumberOfArgumentsL(1); |
|
348 TLex lex((*iArgumentList)[0]); |
|
349 TInt expectedCount; |
|
350 User::LeaveIfError(lex.Val(expectedCount)); |
|
351 iMsvClientTest.AddStateL(new (ELeave) CCheckRemoteFolderSize(expectedCount, iMsvClientTest.MsvTestUtils()) |
|
352 , iDebugInfo); |
|
353 } |
|
354 else if ((*iCurrentCommand) == KCommandSelectPopulated) |
|
355 { |
|
356 CheckNumberOfArgumentsL(0); |
|
357 iMsvClientTest.AddStateL(new (ELeave) CSelectPopulatedInSelection(*(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils()) |
|
358 , iDebugInfo); |
|
359 } |
|
360 else |
|
361 { |
|
362 User::Leave(KErrNotFound); |
|
363 } |
|
364 } |
|
365 |
|
366 void CMsvSelectParser::ConstructL() |
|
367 { |
|
368 CBaseCommandParser::ConstructL(); |
|
369 AddCommandL(KCommandSelectRootFolder); |
|
370 AddCommandL(KCommandSelectFolder); |
|
371 AddCommandL(KCommandSelectEntry); |
|
372 AddCommandL(KCommandSelectAllMessages); |
|
373 AddCommandL(KCommandSelectDestination); |
|
374 AddCommandL(KCommandCheckSelectionCount); |
|
375 AddCommandL(KCommandSelectLastInSelection); |
|
376 AddCommandL(KCommandSelectFirstInSelection); |
|
377 AddCommandL(KCommandCheckRemoteFolderSize); |
|
378 AddCommandL(KCommandSelectPopulated); |
|
379 AddCommandL(KCommandCheckNewFlag); |
|
380 AddCommandL(KCommandCheckPriority); |
|
381 AddCommandL(KCommandCheckAttachment); |
|
382 AddCommandL(KCommandCheckBodyText); |
|
383 } |
|
384 |
|
385 CMsvSelectParser::CMsvSelectParser(CMsvClientTest& aMsvClientTest) : iMsvClientTest(aMsvClientTest) |
|
386 { |
|
387 } |
|
388 |
|
389 |
|
390 |
|
391 // |
|
392 // |
|
393 // CMsvOperationParser |
|
394 // |
|
395 |
|
396 EXPORT_C CMsvOperationParser* CMsvOperationParser::NewL(CMsvClientTest& aMsvClientTest) |
|
397 { |
|
398 CMsvOperationParser* self = new (ELeave) CMsvOperationParser(aMsvClientTest); |
|
399 CleanupStack::PushL(self); |
|
400 self->ConstructL(); |
|
401 CleanupStack::Pop(self); |
|
402 return self; |
|
403 } |
|
404 |
|
405 EXPORT_C void CMsvOperationParser::ProcessL() |
|
406 { |
|
407 if ((*iCurrentCommand) == KCommandMsvCopySelection) |
|
408 { |
|
409 CheckNumberOfArgumentsL(0); |
|
410 iMsvClientTest.AddStateL(new (ELeave) CCopySelection(iMsvClientTest), iDebugInfo); |
|
411 } |
|
412 else if ((*iCurrentCommand) == KCommandMsvMoveSelection) |
|
413 { |
|
414 CheckNumberOfArgumentsL(0); |
|
415 iMsvClientTest.AddStateL(new (ELeave) CMoveSelection(iMsvClientTest), iDebugInfo); |
|
416 } |
|
417 else if ((*iCurrentCommand) == KCommandMsvDeleteSelection) |
|
418 { |
|
419 CheckNumberOfArgumentsL(0); |
|
420 iMsvClientTest.AddStateL(new (ELeave) CDeleteSelection(iMsvClientTest), iDebugInfo); |
|
421 } |
|
422 else |
|
423 { |
|
424 User::Leave(KErrNotFound); |
|
425 } |
|
426 } |
|
427 |
|
428 void CMsvOperationParser::ConstructL() |
|
429 { |
|
430 CBaseCommandParser::ConstructL(); |
|
431 AddCommandL(KCommandMsvCopySelection); |
|
432 AddCommandL(KCommandMsvMoveSelection); |
|
433 AddCommandL(KCommandMsvDeleteSelection); |
|
434 } |
|
435 |
|
436 CMsvOperationParser::CMsvOperationParser(CMsvClientTest& aMsvClientTest) : iMsvClientTest(aMsvClientTest) |
|
437 { |
|
438 } |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 // |
|
444 // |
|
445 // CMsvTestEntryCommandParser |
|
446 // |
|
447 |
|
448 EXPORT_C void CMsvTestEntryCommandParser::ProcessL() |
|
449 { |
|
450 if ((*iCurrentCommand) == KCommandTestEntryVisible) |
|
451 { |
|
452 iTestEntry.TestVisible(GetBooleanArgumentL()); |
|
453 } |
|
454 else if ((*iCurrentCommand) == KCommandTestEntryComplete) |
|
455 { |
|
456 iTestEntry.TestComplete(GetBooleanArgumentL()); |
|
457 } |
|
458 } |
|
459 |
|
460 EXPORT_C CMsvTestEntryCommandParser* CMsvTestEntryCommandParser::NewL(CMsvTestEntry& aTestEntry) |
|
461 { |
|
462 CMsvTestEntryCommandParser* self = CMsvTestEntryCommandParser::NewL(aTestEntry); |
|
463 CleanupStack::PushL(self); |
|
464 self->ConstructL(); |
|
465 CleanupStack::Pop(self); |
|
466 return self; |
|
467 } |
|
468 |
|
469 void CMsvTestEntryCommandParser::ConstructL() |
|
470 { |
|
471 CBaseCommandParser::ConstructL(); |
|
472 AddCommandL(KCommandTestEntryVisible); |
|
473 AddCommandL(KCommandTestEntryComplete); |
|
474 } |
|
475 |
|
476 CMsvTestEntryCommandParser::CMsvTestEntryCommandParser(CMsvTestEntry& aTestEntry) : iTestEntry(aTestEntry) |
|
477 { |
|
478 } |
|
479 |
|
480 TBool CMsvTestEntryCommandParser::GetBooleanArgumentL() |
|
481 { |
|
482 TBool result = ETrue; |
|
483 |
|
484 CheckNumberOfArgumentsL(1); |
|
485 |
|
486 if ((*iArgumentList)[0] == KParameterETrue) |
|
487 { |
|
488 result = ETrue; |
|
489 } |
|
490 else if ((*iArgumentList)[0] == KParameterEFalse) |
|
491 { |
|
492 result = EFalse; |
|
493 } |
|
494 else |
|
495 { |
|
496 User::Leave(KErrArgument); |
|
497 } |
|
498 |
|
499 return result; |
|
500 } |
|
501 |
|
502 |
|
503 |
|
504 // |
|
505 // |
|
506 // CMsvTestEntrySectionParser |
|
507 // |
|
508 |
|
509 EXPORT_C CMsvTestEntrySectionParser* CMsvTestEntrySectionParser::NewL(const TDesC& aSectionName, CTestScript& aScript, CMsvTestEntry& aTestState) |
|
510 { |
|
511 CMsvTestEntrySectionParser* self = new (ELeave) CMsvTestEntrySectionParser(aScript, aTestState); |
|
512 CleanupStack::PushL(self); |
|
513 self->ConstructL(aSectionName); |
|
514 CleanupStack::Pop(self); |
|
515 return self; |
|
516 } |
|
517 |
|
518 EXPORT_C CMsvTestEntrySectionParser::~CMsvTestEntrySectionParser() |
|
519 { |
|
520 } |
|
521 |
|
522 EXPORT_C void CMsvTestEntrySectionParser::ConstructL(const TDesC& aSectionName) |
|
523 { |
|
524 CBaseSectionParser::ConstructL(aSectionName); |
|
525 AddCommandParserL(CMsvTestEntryCommandParser::NewL(iTestState)); |
|
526 } |
|
527 |
|
528 EXPORT_C CMsvTestEntrySectionParser::CMsvTestEntrySectionParser(CTestScript& aScript, CMsvTestEntry& aTestState) |
|
529 : CBaseSectionParser(aScript), |
|
530 iTestState(aTestState) |
|
531 { |
|
532 } |
|
533 |
|
534 EXPORT_C void CMsvTestEntrySectionParser::LogCommentL(const TDesC& /*aComment*/) |
|
535 { |
|
536 // Log comment |
|
537 } |