|
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 #include "biotestutils.h" |
|
19 |
|
20 // |
|
21 // The [main] section |
|
22 _LIT(KMainSectionName, "main"); |
|
23 |
|
24 // |
|
25 // The bio_client_test command in the [main] section |
|
26 _LIT(KBioClientCmd, "bio_test"); |
|
27 |
|
28 // |
|
29 // The commands in the [client] section (general) |
|
30 _LIT(KCommandCleanMessageFolder, "clean_message_folder"); // 0 parameters, deletes message store |
|
31 _LIT(KCommandPrettifyLog, "prettify_log"); // 0 parameters, deletes message store |
|
32 _LIT(KCommandDumpParsedMsg, "dump_parsed_message"); // 0 parameters, deletes message store |
|
33 _LIT(KCommandAddComment, "add_comment"); // n parameters, adds a comment to the log, concatenates parameters |
|
34 _LIT(KCommandGenerateMsgFromFile, "gen_msg_from_file"); // 1 parameter - FileName, create a BIO msg from a file, |
|
35 _LIT(KCommandGenerateMsgFromSection, "gen_msg_from_section"); // 1 parameter - FileName, create a BIO msg from a file, |
|
36 _LIT(KCommandCheckUsedBif, "check_used_bif"); // 1 parameter - the expected bif name, |
|
37 _LIT(KCommandChkFileInMsgDirWithExt, "chk_file_in_msg_dir_with_ext");// 0 parameters |
|
38 _LIT(KCommandCleanAllBioMsgs, "clean_all_bio_msgs"); // 0 parameters, deletes all the BIO msgs in the message store |
|
39 |
|
40 // |
|
41 // The commands in the [client] section (TestBIODB) |
|
42 _LIT(KCommandDumpBif, "bio_db_dump"); // 0 parameters, dumps biffs |
|
43 _LIT(KCommandBifAPITest, "bio_db_api_test"); // 0 parameters, tests bif API |
|
44 _LIT(KCommandDumpWapBif, "bio_db_dump_wap"); |
|
45 //_LIT(KCommandCheckBioNess, "bio_db_check_bioness"); |
|
46 _LIT(KCommandDefaultSendBearer, "bio_db_default_send_bearer"); |
|
47 |
|
48 |
|
49 // |
|
50 // The commands in the [client] section (COMMDB) |
|
51 _LIT(KCommandClientCommDB, "bio_commdb"); // 2 parameters, table name and section name |
|
52 // |
|
53 // The commands in the [client] section (MSV) |
|
54 _LIT(KCommandPop3SettingsCheck, "check_pop3_defs"); //1 parameter - a section name. |
|
55 _LIT(KCommandPop3NamedSettingsCheck, "check_pop3_named"); //2 parameters - a section name and a SettingsName |
|
56 _LIT(KCommandSmtpSettingsCheck, "check_smtp_defs"); //1 parameter - a section name. |
|
57 _LIT(KCommandSmtpNamedSettingsCheck, "check_smtp_named"); //2 parameters - a section name and a SettingsName |
|
58 _LIT(KCommandImapSettingsCheck, "check_imap_defs"); //1 parameter - a section name. |
|
59 _LIT(KCommandImapNamedSettingsCheck, "check_imap_named"); //2 parameters - a section name and a SettingsName |
|
60 _LIT(KCommandSmsSettingsCheck, "check_sms"); //1 parameter - a section name. |
|
61 |
|
62 // |
|
63 // The commands in the [client] section (TestClientSide) |
|
64 _LIT(KCommandClientParse, "bio_client_parse"); // 1 optional parameter. |
|
65 _LIT(KCommandClientProcess, "bio_client_process"); |
|
66 _LIT(KCommandClientFindBody, "bio_client_find_in_body"); // 1 parameter, finds text in message body |
|
67 _LIT(KCommandClientFindSubject, "bio_client_find_in_subject"); // 1 parameter, finds text in message subject |
|
68 |
|
69 // |
|
70 // The commands in the [client] section (TestServerSide) |
|
71 _LIT(KCommandServerParse, "bio_server_parse"); |
|
72 _LIT(KCommandServerProcess, "bio_server_process"); |
|
73 |
|
74 |
|
75 // |
|
76 // The commands in the [check_sms_defs] section |
|
77 |
|
78 _LIT(KCommandSmsChkMessageCentreNumber, "chk_messagecentrenumber"); //2 parameters - the message centre name and expectred number |
|
79 _LIT(KCommandSmsChkDefaultMessageCentreNumber, "chk_defaultmsgcentrenumber"); //1 parameters - the message centre name and expectred number |
|
80 _LIT(KCommandSmsDumpMessageCentres, "dump_messagecentres"); //0 parameters |
|
81 |
|
82 |
|
83 // |
|
84 // The commands in the [check_pop3_defs] section |
|
85 // NB: Those commented out are not in _current_ BIO spec. |
|
86 _LIT(KCommandPop3ChkLoginName, "chk_pop3_loginname"); //1 parameter - the expected LogonName |
|
87 _LIT(KCommandPop3ChkPassword, "chk_pop3_password"); //1 parameter - the expected Password |
|
88 _LIT(KCommandPop3ChkServerAddress, "chk_pop3_serveraddress"); //1 parameter - the expected server address |
|
89 //_LIT(KCommandPop3ChkAPop, "chk_pop3_apop"); //1 parameter - true or false |
|
90 //_LIT(KCommandPop3ChkAutoSendOnConnect, "chk_pop3_autosendonconnect"); //1 parameter - true or false |
|
91 //_LIT(KCommandPop3ChkPort, "chk_pop3_port"); //1 parameter - a number |
|
92 _LIT(KCommandPop3ChkUserAddress, "chk_pop3_useraddress"); //1 parameter - the expected user@address |
|
93 //_LIT(KCommandPop3ChkVersion, "chk_pop3_version"); //1 parameter - a number |
|
94 |
|
95 // |
|
96 // The commands in the [check_smtp_defs] section |
|
97 // NB: Those commented out are not in _current_ BIO spec. |
|
98 //_LIT(KCommandSmtpEmailAlias, "chk_smtp_emailalias"); //1 parameter - the expected value |
|
99 _LIT(KCommandSmtpEmailAddress, "chk_smtp_emailaddress"); //1 parameter - the expected value |
|
100 //_LIT(KCommandSmtpReplyToAddress, "chk_smtp_replytoaddress"); //1 parameter - the expected value |
|
101 //_LIT(KCommandSmtpReceiptAddress, "chk_smtp_receiptaddress"); //1 parameter - the expected value |
|
102 //_LIT(KCommandSmtpBodyEncoding, "chk_smtp_bodyencoding"); //1 parameter - the expected value |
|
103 //_LIT(KCommandSmtpDefaultMsgCharSet, "chk_smtp_defaultmsgcharset"); //1 parameter - the expected value |
|
104 //_LIT(KCommandSmtpAddVCardToEmail, "chk_smtp_addvcardtoemail"); //1 parameter - the expected value |
|
105 //_LIT(KCommandSmtpAddSignatureToEmail, "chk_smtp_addsignaturetoemail");//1 parameter - the expected value |
|
106 //_LIT(KCommandSmtpRequestReceipts, "chk_smtp_requestreceipts"); //1 parameter - the expected value |
|
107 //_LIT(KCommandSmtpSendCopyToSelf, "chk_smtp_sendcopytoself"); //1 parameter - the expected value |
|
108 //_LIT(KCommandSmtpSendMessageOption, "chk_smtp_sendmessageoption"); //1 parameter - the expected value |
|
109 _LIT(KCommandSmtpServerAddress, "chk_smtp_serveraddress"); //1 parameter - the expected value |
|
110 //_LIT(KCommandSmtpUserAddress, "chk_smtp_useraddress"); //1 parameter - the expected value |
|
111 |
|
112 |
|
113 // |
|
114 // The commands in the [check_imap_defs] section |
|
115 // NB: Those commented out are not in _current_ BIO spec. |
|
116 _LIT(KCommandImapServerAddress, "chk_imap_serveraddress"); //1 parameter - the expected value |
|
117 //_LIT(KCommandImapPort, "chk_imap_port"); //1 parameter - the expected value |
|
118 _LIT(KCommandImapLoginName, "chk_imap_loginname"); //1 parameter - the expected value |
|
119 _LIT(KCommandImapPassword, "chk_imap_password"); //1 parameter - the expected value |
|
120 _LIT(KCommandImapFolderPath, "chk_imap_folderpath"); //1 parameter - the expected value |
|
121 //_LIT(KCommandImapPathSeparator, "chk_imap_pathseparator"); //1 parameter - the expected value |
|
122 //_LIT(KCommandImapDisconnectedUserMode, "chk_imap_disconnectedusermode");//1 parameter - the expected value |
|
123 //_LIT(KCommandImapSynchronise, "chk_imap_synchronise"); //1 parameter - the expected value |
|
124 //_LIT(KCommandImapSubscribe, "chk_imap_subscribe"); //1 parameter - the expected value |
|
125 //_LIT(KCommandImapAutoSendOnConnect, "chk_imap_autosendonconnect"); //1 parameter - the expected value |
|
126 //_LIT(KCommandImapMaxEmailSize, "chk_imap_maxemailsize"); //1 parameter - the expected value |
|
127 //_LIT(KCommandImapDeleteEmailsWhenDisconnecting, "chk_imap_deleteemailswhendisconnecting"); //1 parameter - the expected value |
|
128 //_LIT(KCommandImapAcknowledgeReceipts, "chk_imap_acknowledgereceipts");//1 parameter - the expected value |
|
129 //_LIT(KCommandImapGetMailOptions, "chk_imap_getmailoptions"); //1 parameter - the expected value |
|
130 //_LIT(KCommandImapInboxSynchronisationLimit, "chk_imap_inboxsynchronisationlimit");//1 parameter - the expected value |
|
131 |
|
132 // |
|
133 // The commands in the [bio_commdb] section |
|
134 _LIT(KCommandCommDbReadText, "commdb_read_text"); // 2 parameters, reads a setting from CommDB |
|
135 _LIT(KCommandCommDbReadLongText, "commdb_read_longtext"); // 2 parameters, reads a setting from CommDB |
|
136 _LIT(KCommandCommDbReadUint, "commdb_read_uint"); // 2 parameters, reads a setting from CommDB |
|
137 _LIT(KCommandCommDbReadBool, "commdb_read_bool"); // 2 parameters, reads a setting from CommDB |
|
138 _LIT(KCommandCommDbCheck, "commdb_check"); // 3 parameters, checks that a setting in CommDB has the specified value |
|
139 |
|
140 // |
|
141 // The commands in the [gen_msg_from_section] section |
|
142 _LIT(KCommandGenMsgAddLine, "msg_add_line"); // 1 parameters, the text line to add - MUST BE "'ed! |
|
143 _LIT(KCommandGenMsgType, "msg_set_type"); // 1 parameters, the message type - MUST BE "'ed! |
|
144 |
|
145 |
|
146 // |
|
147 // CBioMainSectionParser |
|
148 // Parses the [main] section of the script |
|
149 CBioMainSectionParser* CBioMainSectionParser::NewL(CMainTestHarness& aMainTest, CTestScript& aScript) |
|
150 { |
|
151 CBioMainSectionParser* self = new (ELeave) CBioMainSectionParser(aMainTest, aScript); |
|
152 CleanupStack::PushL(self); |
|
153 self->ConstructL(); |
|
154 CleanupStack::Pop(self); |
|
155 return self; |
|
156 } |
|
157 |
|
158 void CBioMainSectionParser::LogComment(const TDesC& aComment) |
|
159 { |
|
160 iMainTest.TestUtils().WriteComment(aComment); |
|
161 } |
|
162 |
|
163 void CBioMainSectionParser::ConstructL() |
|
164 { |
|
165 CBaseSectionParser::ConstructL(KMainSectionName); |
|
166 |
|
167 // |
|
168 // Add the command parser to parse the bio_client_test command |
|
169 iCommandParsers->AppendL(CBioMainCommandsParser::NewL(iScript, iMainTest)); |
|
170 } |
|
171 |
|
172 // |
|
173 // CBioMainCommandsParser |
|
174 // Handles the commands that appear in the [main] section |
|
175 CBioMainCommandsParser* CBioMainCommandsParser::NewL(CTestScript& aScript, CMainTestHarness& aMainTest) |
|
176 { |
|
177 CBioMainCommandsParser* self = new (ELeave) CBioMainCommandsParser(aScript, aMainTest); |
|
178 CleanupStack::PushL(self); |
|
179 self->ConstructL(); |
|
180 CleanupStack::Pop(self); |
|
181 return self; |
|
182 } |
|
183 |
|
184 void CBioMainCommandsParser::ProcessL() |
|
185 { |
|
186 // |
|
187 // Check there are 1 argument |
|
188 CheckNumberOfArgumentsL(1); |
|
189 |
|
190 // |
|
191 // Create the client test harness that will actually do the work |
|
192 // It shares the same TestUtils instance to update the same log file |
|
193 CClientTestHarness* clientTestH = CClientTestHarness::NewL(iMainTest.TestUtils(), iMainTest.TestConsole()); |
|
194 CleanupStack::PushL(clientTestH); |
|
195 |
|
196 // |
|
197 // Attach it to the main state machine, this transfers ownership! |
|
198 iMainTest.AddStateL(clientTestH, iDebugInfo); |
|
199 CleanupStack::Pop(clientTestH); |
|
200 |
|
201 // |
|
202 // Create the client secion parser |
|
203 // Note we pass in the client test harness not the main one! |
|
204 CBioClientSectionParser* sectionP = CBioClientSectionParser::NewL(*clientTestH, iScript, (*iArgumentList)[0]); |
|
205 CleanupStack::PushL(sectionP); |
|
206 sectionP->ParseL(); |
|
207 CleanupStack::PopAndDestroy(sectionP); |
|
208 |
|
209 } |
|
210 |
|
211 void CBioMainCommandsParser::ConstructL() |
|
212 { |
|
213 CBaseCommandParser::ConstructL(); |
|
214 |
|
215 // |
|
216 // Add the commands we can handle (bio_client_test) |
|
217 AddCommandL(KBioClientCmd); |
|
218 } |
|
219 |
|
220 // |
|
221 // CBioClientSectionParser |
|
222 // Handles the [client] section of the script |
|
223 CBioClientSectionParser* CBioClientSectionParser::NewL(CClientTestHarness& aTestH, CTestScript& aScript, const TDesC& aNewSectionName) |
|
224 { |
|
225 CBioClientSectionParser* self = new (ELeave) CBioClientSectionParser(aTestH, aScript); |
|
226 CleanupStack::PushL(self); |
|
227 self->ConstructL(aNewSectionName); |
|
228 CleanupStack::Pop(self); |
|
229 return self; |
|
230 } |
|
231 |
|
232 void CBioClientSectionParser::LogComment(const TDesC& aComment) |
|
233 { |
|
234 iClientTest.TestUtils().WriteComment(aComment); |
|
235 } |
|
236 |
|
237 void CBioClientSectionParser::ConstructL(const TDesC& aNewSectionName) |
|
238 { |
|
239 CBaseSectionParser::ConstructL(aNewSectionName); |
|
240 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
241 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
242 iClientTest.SetDebugInfo(debugInfo); |
|
243 iCommandParsers->AppendL(CBioClientCommandsParser::NewL(iClientTest)); |
|
244 } |
|
245 |
|
246 // |
|
247 // CBioClientCommandsParser |
|
248 // Handles the bio specific commands in the |
|
249 // [client] section of the script |
|
250 CBioClientCommandsParser* CBioClientCommandsParser::NewL(CClientTestHarness& aClientTest) |
|
251 { |
|
252 CBioClientCommandsParser* self = new (ELeave) CBioClientCommandsParser(aClientTest); |
|
253 CleanupStack::PushL(self); |
|
254 self->ConstructL(); |
|
255 CleanupStack::Pop(self); |
|
256 return self; |
|
257 } |
|
258 |
|
259 void CBioClientCommandsParser::ProcessL() |
|
260 { |
|
261 // |
|
262 // General |
|
263 if((*iCurrentCommand) == KCommandCleanMessageFolder) |
|
264 { |
|
265 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, CDoCmdGeneral::ECmdGeneralClean), iDebugInfo); |
|
266 } |
|
267 else |
|
268 if((*iCurrentCommand) == KCommandPrettifyLog) |
|
269 { |
|
270 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, CDoCmdGeneral::ECmdGeneralPrettifyLog), iDebugInfo); |
|
271 } |
|
272 else |
|
273 if((*iCurrentCommand) == KCommandDumpParsedMsg) |
|
274 { |
|
275 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, CDoCmdGeneral::ECmdGeneralDumpMsg), iDebugInfo); |
|
276 } |
|
277 else |
|
278 if((*iCurrentCommand) == KCommandAddComment) |
|
279 { |
|
280 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, *iArgumentList, CDoCmdGeneral::ECmdGeneralComment) ,iDebugInfo); |
|
281 } |
|
282 else |
|
283 if((*iCurrentCommand) == KCommandGenerateMsgFromFile) |
|
284 { |
|
285 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, *iArgumentList, CDoCmdGeneral::ECmdGeneralGenerateFromFile) ,iDebugInfo); |
|
286 } |
|
287 else |
|
288 if((*iCurrentCommand) == KCommandGenerateMsgFromSection) |
|
289 { |
|
290 // |
|
291 // Create a new section parser for the msg |
|
292 CheckNumberOfArgumentsL(1); |
|
293 CBioGenMsgSectionParser* section = CBioGenMsgSectionParser::NewL(iClientTest, *(iDebugInfo.ScriptFile()), (*iArgumentList)[0]); |
|
294 CleanupStack::PushL(section); |
|
295 section->ParseL(); |
|
296 section->SectionFinishedL(); |
|
297 CleanupStack::PopAndDestroy(section); |
|
298 } |
|
299 else |
|
300 if((*iCurrentCommand) == KCommandCheckUsedBif) |
|
301 { |
|
302 CheckNumberOfArgumentsL(1); |
|
303 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, *iArgumentList, CDoCmdGeneral::ECmdGeneralCheckUsedBif) ,iDebugInfo); |
|
304 } |
|
305 else |
|
306 if((*iCurrentCommand) == KCommandChkFileInMsgDirWithExt) |
|
307 { |
|
308 //CheckNumberOfArgumentsL(1); |
|
309 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, CDoCmdGeneral::ECmdGeneralCheckFileWithExtExists) ,iDebugInfo); |
|
310 } |
|
311 else |
|
312 if ((*iCurrentCommand) == KCommandCleanAllBioMsgs) |
|
313 { |
|
314 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, CDoCmdGeneral::ECmdGeneralCleanAllBioMsgs) ,iDebugInfo); |
|
315 } |
|
316 else |
|
317 |
|
318 // |
|
319 // BIO DB |
|
320 if((*iCurrentCommand) == KCommandDumpBif) |
|
321 { |
|
322 iClientTest.AddStateL(CDoCmdBioDB::NewL(iClientTest, CDoCmdBioDB::ECmdBioDBDump), iDebugInfo); |
|
323 } |
|
324 else |
|
325 if((*iCurrentCommand) == KCommandBifAPITest) |
|
326 { |
|
327 iClientTest.AddStateL(CDoCmdBioDB::NewL(iClientTest, CDoCmdBioDB::ECmdBioDBTestAPI), iDebugInfo); |
|
328 } |
|
329 else |
|
330 if((*iCurrentCommand) == KCommandDumpWapBif) |
|
331 { |
|
332 iClientTest.AddStateL(CDoCmdBioDB::NewL(iClientTest, CDoCmdBioDB::ECmdBioDBDumpWapBif), iDebugInfo); |
|
333 } |
|
334 else |
|
335 /*if((*iCurrentCommand) == KCommandCheckBioNess) |
|
336 { |
|
337 iClientTest.AddStateL(CDoCmdBioDB::NewL(iClientTest, CDoCmdBioDB::ECmdBioDBCheckBioness), iDebugInfo); |
|
338 } |
|
339 else*/ |
|
340 if((*iCurrentCommand) == KCommandDefaultSendBearer) |
|
341 { |
|
342 iClientTest.AddStateL(CDoCmdBioDB::NewL(iClientTest, CDoCmdBioDB::ECmdBioDBDefaultSendBearer), iDebugInfo); |
|
343 } |
|
344 else |
|
345 |
|
346 // |
|
347 // CommDB |
|
348 if((*iCurrentCommand) == KCommandClientCommDB) |
|
349 { |
|
350 // |
|
351 // Check there are 2 arguments (TableName, SectionName) |
|
352 CheckNumberOfArgumentsL(2); |
|
353 |
|
354 // |
|
355 // Create the COMMDB section parser |
|
356 // Note we pass in the client test harness not the main one! |
|
357 CBioCommDBSectionParser* sectionP = CBioCommDBSectionParser::NewL(iClientTest, (*iDebugInfo.ScriptFile()), (*iArgumentList)[0], (*iArgumentList)[1]); |
|
358 CleanupStack::PushL(sectionP); |
|
359 sectionP->ParseL(); |
|
360 |
|
361 // |
|
362 // Note how we pass our own debug info to the section. This insures if this |
|
363 // test fails, the line we are on now is said to have failed - rather than |
|
364 // one of the lines in the section. This is because the operations in a COMMDB |
|
365 // section are not individual commands - they simply build up an SQL statement |
|
366 // I.E they cant individually fail - the whole section failes instead |
|
367 sectionP->SectionFinishedL(iDebugInfo); |
|
368 CleanupStack::PopAndDestroy(sectionP); |
|
369 } |
|
370 else |
|
371 |
|
372 // |
|
373 // Msv |
|
374 if((*iCurrentCommand) == KCommandSmsSettingsCheck) |
|
375 { |
|
376 // |
|
377 // Check there are 1 argument |
|
378 CheckNumberOfArgumentsL(1); |
|
379 |
|
380 // |
|
381 // Create the client secion parser |
|
382 // Note we pass in the client test harness not the main one! |
|
383 CBioSmsSettingsSectionParser* sectionP = CBioSmsSettingsSectionParser::NewL(iClientTest, (*iDebugInfo.ScriptFile()), (*iArgumentList)[0]); |
|
384 CleanupStack::PushL(sectionP); |
|
385 sectionP->ParseL(); |
|
386 CleanupStack::PopAndDestroy(sectionP); |
|
387 } |
|
388 else |
|
389 if((*iCurrentCommand) == KCommandPop3SettingsCheck) |
|
390 { |
|
391 // |
|
392 // Check there are 1 argument |
|
393 CheckNumberOfArgumentsL(1); |
|
394 |
|
395 // |
|
396 // Create the client secion parser |
|
397 // Note we pass in the client test harness not the main one! |
|
398 CBioPop3SettingsSectionParser* sectionP = CBioPop3SettingsSectionParser::NewL(iClientTest, (*iDebugInfo.ScriptFile()), (*iArgumentList)[0]); |
|
399 CleanupStack::PushL(sectionP); |
|
400 sectionP->ParseL(); |
|
401 CleanupStack::PopAndDestroy(sectionP); |
|
402 } |
|
403 else |
|
404 if((*iCurrentCommand) == KCommandPop3NamedSettingsCheck) |
|
405 { |
|
406 // |
|
407 // Check there are 1 argument |
|
408 CheckNumberOfArgumentsL(2); |
|
409 |
|
410 // |
|
411 // Create the client secion parser |
|
412 // Note we pass in the client test harness not the main one! |
|
413 CBioPop3NamedSettingsSectionParser* sectionP = CBioPop3NamedSettingsSectionParser::NewL(iClientTest, (*iDebugInfo.ScriptFile()), (*iArgumentList)[0],(*iArgumentList)[1]); |
|
414 CleanupStack::PushL(sectionP); |
|
415 sectionP->ParseL(); |
|
416 CleanupStack::PopAndDestroy(sectionP); |
|
417 } |
|
418 else |
|
419 if((*iCurrentCommand) == KCommandSmtpNamedSettingsCheck) |
|
420 { |
|
421 // |
|
422 // Check there are 1 argument |
|
423 CheckNumberOfArgumentsL(2); |
|
424 |
|
425 // |
|
426 // Create the client secion parser |
|
427 // Note we pass in the client test harness not the main one! |
|
428 CBioSmtpNamedSettingsSectionParser* sectionP = CBioSmtpNamedSettingsSectionParser::NewL(iClientTest, (*iDebugInfo.ScriptFile()), (*iArgumentList)[0],(*iArgumentList)[1]); |
|
429 CleanupStack::PushL(sectionP); |
|
430 sectionP->ParseL(); |
|
431 CleanupStack::PopAndDestroy(sectionP); |
|
432 } |
|
433 else |
|
434 if((*iCurrentCommand) == KCommandImapNamedSettingsCheck) |
|
435 { |
|
436 // |
|
437 // Check there are 1 argument |
|
438 CheckNumberOfArgumentsL(2); |
|
439 |
|
440 // |
|
441 // Create the client secion parser |
|
442 // Note we pass in the client test harness not the main one! |
|
443 CBioImapNamedSettingsSectionParser* sectionP = CBioImapNamedSettingsSectionParser::NewL(iClientTest, (*iDebugInfo.ScriptFile()), (*iArgumentList)[0],(*iArgumentList)[1]); |
|
444 CleanupStack::PushL(sectionP); |
|
445 sectionP->ParseL(); |
|
446 CleanupStack::PopAndDestroy(sectionP); |
|
447 } |
|
448 else |
|
449 if((*iCurrentCommand) == KCommandSmtpSettingsCheck) |
|
450 { |
|
451 //This creates a new section parser |
|
452 // |
|
453 // Check there are 1 argument |
|
454 CheckNumberOfArgumentsL(1); |
|
455 |
|
456 // |
|
457 // Create the client secion parser |
|
458 // Note we pass in the client test harness not the main one! |
|
459 CBioSmtpSettingsSectionParser* sectionP = CBioSmtpSettingsSectionParser::NewL(iClientTest, (*iDebugInfo.ScriptFile()), (*iArgumentList)[0]); |
|
460 CleanupStack::PushL(sectionP); |
|
461 sectionP->ParseL(); |
|
462 CleanupStack::PopAndDestroy(sectionP); |
|
463 } |
|
464 else |
|
465 if((*iCurrentCommand) == KCommandImapSettingsCheck) |
|
466 { |
|
467 //This creates a new section parser |
|
468 // |
|
469 // Check there are 1 argument |
|
470 CheckNumberOfArgumentsL(1); |
|
471 |
|
472 // |
|
473 // Create the client secion parser |
|
474 // Note we pass in the client test harness not the main one! |
|
475 CBioImapSettingsSectionParser* sectionP = CBioImapSettingsSectionParser::NewL(iClientTest, (*iDebugInfo.ScriptFile()), (*iArgumentList)[0]); |
|
476 CleanupStack::PushL(sectionP); |
|
477 sectionP->ParseL(); |
|
478 CleanupStack::PopAndDestroy(sectionP); |
|
479 } |
|
480 else |
|
481 // |
|
482 // Client |
|
483 if((*iCurrentCommand) == KCommandClientParse) |
|
484 { |
|
485 iClientTest.AddStateL(CDoCmdClient::NewL(*iArgumentList, iClientTest, CDoCmdClient::ECmdClientParse), iDebugInfo); |
|
486 } |
|
487 else |
|
488 if((*iCurrentCommand) == KCommandClientProcess) |
|
489 { |
|
490 iClientTest.AddStateL(CDoCmdClient::NewL(*iArgumentList, iClientTest, CDoCmdClient::ECmdClientProcess), iDebugInfo); |
|
491 } |
|
492 else |
|
493 if((*iCurrentCommand) == KCommandClientFindBody) |
|
494 { |
|
495 CheckNumberOfArgumentsL(1); |
|
496 iClientTest.AddStateL(CDoCmdClient::NewL(*iArgumentList, iClientTest, CDoCmdClient::ECmdClientFindBody), iDebugInfo); |
|
497 } |
|
498 else |
|
499 if((*iCurrentCommand) == KCommandClientFindSubject) |
|
500 { |
|
501 CheckNumberOfArgumentsL(1); |
|
502 iClientTest.AddStateL(CDoCmdClient::NewL(*iArgumentList, iClientTest, CDoCmdClient::ECmdClientFindSubject), iDebugInfo); |
|
503 } |
|
504 else |
|
505 |
|
506 // |
|
507 // Server |
|
508 if((*iCurrentCommand) == KCommandServerProcess) |
|
509 { |
|
510 iClientTest.AddStateL(CDoCmdServer::NewL(*iArgumentList, iClientTest, CDoCmdServer::ECmdServerProcess), iDebugInfo); |
|
511 } |
|
512 else |
|
513 if((*iCurrentCommand) == KCommandServerParse) |
|
514 { |
|
515 iClientTest.AddStateL(CDoCmdServer::NewL(*iArgumentList, iClientTest, CDoCmdServer::ECmdServerParse), iDebugInfo); |
|
516 } |
|
517 |
|
518 else |
|
519 { |
|
520 User::Leave(KErrNotFound); |
|
521 } |
|
522 } |
|
523 |
|
524 void CBioClientCommandsParser::ConstructL() |
|
525 { |
|
526 CBaseCommandParser::ConstructL(); |
|
527 |
|
528 // |
|
529 // Add the general commands |
|
530 AddCommandL(KCommandCleanMessageFolder); |
|
531 AddCommandL(KCommandPrettifyLog); |
|
532 AddCommandL(KCommandDumpParsedMsg); |
|
533 AddCommandL(KCommandAddComment); |
|
534 AddCommandL(KCommandGenerateMsgFromFile); |
|
535 AddCommandL(KCommandGenerateMsgFromSection); |
|
536 AddCommandL(KCommandCheckUsedBif); |
|
537 AddCommandL(KCommandChkFileInMsgDirWithExt); |
|
538 AddCommandL(KCommandCleanAllBioMsgs); |
|
539 |
|
540 // |
|
541 // Add the BioDB Commands |
|
542 AddCommandL(KCommandDumpBif); |
|
543 AddCommandL(KCommandBifAPITest); |
|
544 AddCommandL(KCommandDumpWapBif); |
|
545 //AddCommandL(KCommandCheckBioNess); |
|
546 AddCommandL(KCommandDefaultSendBearer); |
|
547 |
|
548 // |
|
549 // Add the CommDB related Commands |
|
550 AddCommandL(KCommandClientCommDB); |
|
551 |
|
552 // |
|
553 // Add the client side commands |
|
554 AddCommandL(KCommandClientParse); |
|
555 AddCommandL(KCommandClientProcess); |
|
556 AddCommandL(KCommandClientFindBody); |
|
557 AddCommandL(KCommandClientFindSubject); |
|
558 |
|
559 // |
|
560 // Add the server side commands |
|
561 AddCommandL(KCommandServerParse); |
|
562 AddCommandL(KCommandServerProcess); |
|
563 |
|
564 //Msv |
|
565 //AddCommandL(KCommandReadDefaultPOP3LoginName); |
|
566 AddCommandL(KCommandPop3NamedSettingsCheck); |
|
567 AddCommandL(KCommandSmtpNamedSettingsCheck); |
|
568 AddCommandL(KCommandImapNamedSettingsCheck); |
|
569 AddCommandL(KCommandPop3SettingsCheck); |
|
570 AddCommandL(KCommandSmtpSettingsCheck); |
|
571 AddCommandL(KCommandImapSettingsCheck); |
|
572 AddCommandL(KCommandSmsSettingsCheck); |
|
573 |
|
574 } |
|
575 |
|
576 // |
|
577 // CBioSmsSettingsSectionParser |
|
578 // Handles the [check_Sms_defs] section of the script |
|
579 CBioSmsSettingsSectionParser* CBioSmsSettingsSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName) |
|
580 { |
|
581 CBioSmsSettingsSectionParser* self = new (ELeave) CBioSmsSettingsSectionParser(aTest, aScript); |
|
582 CleanupStack::PushL(self); |
|
583 self->ConstructL(aNewSectionName); |
|
584 CleanupStack::Pop(self); |
|
585 return self; |
|
586 } |
|
587 |
|
588 void CBioSmsSettingsSectionParser::LogComment(const TDesC& aComment) |
|
589 { |
|
590 iClientTest.TestUtils().WriteComment(aComment); |
|
591 } |
|
592 |
|
593 void CBioSmsSettingsSectionParser::ConstructL(const TDesC& aNewSectionName) |
|
594 { |
|
595 CBaseSectionParser::ConstructL(aNewSectionName); |
|
596 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
597 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
598 iClientTest.SetDebugInfo(debugInfo); |
|
599 iCommandParsers->AppendL(CBioSmsSettingsCommandsParser::NewL(iClientTest)); |
|
600 } |
|
601 |
|
602 // |
|
603 // CBioSmsSettingsCommandsParser |
|
604 // Handles the commands in the |
|
605 // [check_Sms_defs] section of the script |
|
606 void CBioSmsSettingsCommandsParser::ProcessL() |
|
607 { |
|
608 if((*iCurrentCommand) == KCommandSmsChkMessageCentreNumber) |
|
609 { |
|
610 CheckNumberOfArgumentsL(2); |
|
611 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkSmsMsgCentreNumber), iDebugInfo); |
|
612 } |
|
613 else |
|
614 if((*iCurrentCommand) == KCommandSmsDumpMessageCentres) |
|
615 { |
|
616 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdDumpSmsMsgCentres), iDebugInfo); |
|
617 } |
|
618 else |
|
619 if((*iCurrentCommand) == KCommandSmsChkDefaultMessageCentreNumber) |
|
620 { |
|
621 CheckNumberOfArgumentsL(1); |
|
622 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkDefaultSmsMsgCentre), iDebugInfo); |
|
623 } |
|
624 else |
|
625 { |
|
626 User::Leave(KErrNotFound); |
|
627 } |
|
628 } |
|
629 |
|
630 CBioSmsSettingsCommandsParser* CBioSmsSettingsCommandsParser::NewL(CClientTestHarness& aMainTest) |
|
631 { |
|
632 CBioSmsSettingsCommandsParser* self = new (ELeave) CBioSmsSettingsCommandsParser(aMainTest); |
|
633 CleanupStack::PushL(self); |
|
634 self->ConstructL(); |
|
635 CleanupStack::Pop(self); |
|
636 return self; |
|
637 } |
|
638 |
|
639 void CBioSmsSettingsCommandsParser::ConstructL() |
|
640 { |
|
641 CBaseCommandParser::ConstructL(); |
|
642 |
|
643 // |
|
644 // Add the commands |
|
645 AddCommandL(KCommandSmsChkMessageCentreNumber); |
|
646 AddCommandL(KCommandSmsChkDefaultMessageCentreNumber); |
|
647 AddCommandL(KCommandSmsDumpMessageCentres); |
|
648 |
|
649 } |
|
650 |
|
651 // |
|
652 // CBioPop3NamedSettingsSectionParser |
|
653 // Handles the [check_pop3_defs] section of the script |
|
654 CBioPop3NamedSettingsSectionParser* CBioPop3NamedSettingsSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName,const TDesC& aSettingsName) |
|
655 { |
|
656 CBioPop3NamedSettingsSectionParser* self = new (ELeave) CBioPop3NamedSettingsSectionParser(aTest, aScript); |
|
657 CleanupStack::PushL(self); |
|
658 self->ConstructL(aNewSectionName,aSettingsName); |
|
659 CleanupStack::Pop(self); |
|
660 return self; |
|
661 } |
|
662 |
|
663 void CBioPop3NamedSettingsSectionParser::LogComment(const TDesC& aComment) |
|
664 { |
|
665 iClientTest.TestUtils().WriteComment(aComment); |
|
666 } |
|
667 |
|
668 void CBioPop3NamedSettingsSectionParser::ConstructL(const TDesC& aNewSectionName,const TDesC& aSettingsName) |
|
669 { |
|
670 CBaseSectionParser::ConstructL(aNewSectionName); |
|
671 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
672 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
673 iClientTest.SetDebugInfo(debugInfo); |
|
674 |
|
675 iClientTest.AddStateL(CDoCmdMsv::NewL(aSettingsName,iClientTest, CDoCmdMsv::ECmdInstantNamedPop3), debugInfo); |
|
676 |
|
677 iCommandParsers->AppendL(CBioPop3SettingsCommandsParser::NewL(iClientTest)); |
|
678 } |
|
679 |
|
680 // |
|
681 // CBioSmtpNamedSettingsSectionParser |
|
682 // Handles the [check_Smtp_defs] section of the script |
|
683 CBioSmtpNamedSettingsSectionParser* CBioSmtpNamedSettingsSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName,const TDesC& aSettingsName) |
|
684 { |
|
685 CBioSmtpNamedSettingsSectionParser* self = new (ELeave) CBioSmtpNamedSettingsSectionParser(aTest, aScript); |
|
686 CleanupStack::PushL(self); |
|
687 self->ConstructL(aNewSectionName,aSettingsName); |
|
688 CleanupStack::Pop(self); |
|
689 return self; |
|
690 } |
|
691 |
|
692 void CBioSmtpNamedSettingsSectionParser::LogComment(const TDesC& aComment) |
|
693 { |
|
694 iClientTest.TestUtils().WriteComment(aComment); |
|
695 } |
|
696 |
|
697 void CBioSmtpNamedSettingsSectionParser::ConstructL(const TDesC& aNewSectionName,const TDesC& aSettingsName) |
|
698 { |
|
699 CBaseSectionParser::ConstructL(aNewSectionName); |
|
700 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
701 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
702 iClientTest.SetDebugInfo(debugInfo); |
|
703 |
|
704 iClientTest.AddStateL(CDoCmdMsv::NewL(aSettingsName,iClientTest, CDoCmdMsv::ECmdInstantNamedSmtp), debugInfo); |
|
705 |
|
706 iCommandParsers->AppendL(CBioSmtpSettingsCommandsParser::NewL(iClientTest)); |
|
707 } |
|
708 |
|
709 // |
|
710 // CBioImapNamedSettingsSectionParser |
|
711 // Handles the [check_Imap_defs] section of the script |
|
712 CBioImapNamedSettingsSectionParser* CBioImapNamedSettingsSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName,const TDesC& aSettingsName) |
|
713 { |
|
714 CBioImapNamedSettingsSectionParser* self = new (ELeave) CBioImapNamedSettingsSectionParser(aTest, aScript); |
|
715 CleanupStack::PushL(self); |
|
716 self->ConstructL(aNewSectionName,aSettingsName); |
|
717 CleanupStack::Pop(self); |
|
718 return self; |
|
719 } |
|
720 |
|
721 void CBioImapNamedSettingsSectionParser::LogComment(const TDesC& aComment) |
|
722 { |
|
723 iClientTest.TestUtils().WriteComment(aComment); |
|
724 } |
|
725 |
|
726 void CBioImapNamedSettingsSectionParser::ConstructL(const TDesC& aNewSectionName,const TDesC& aSettingsName) |
|
727 { |
|
728 CBaseSectionParser::ConstructL(aNewSectionName); |
|
729 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
730 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
731 iClientTest.SetDebugInfo(debugInfo); |
|
732 |
|
733 iClientTest.AddStateL(CDoCmdMsv::NewL(aSettingsName,iClientTest, CDoCmdMsv::ECmdInstantNamedImap), debugInfo); |
|
734 |
|
735 iCommandParsers->AppendL(CBioImapSettingsCommandsParser::NewL(iClientTest)); |
|
736 } |
|
737 |
|
738 // |
|
739 // CBioPop3SettingsSectionParser |
|
740 // Handles the [check_pop3_defs] section of the script |
|
741 CBioPop3SettingsSectionParser* CBioPop3SettingsSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName) |
|
742 { |
|
743 CBioPop3SettingsSectionParser* self = new (ELeave) CBioPop3SettingsSectionParser(aTest, aScript); |
|
744 CleanupStack::PushL(self); |
|
745 self->ConstructL(aNewSectionName); |
|
746 CleanupStack::Pop(self); |
|
747 return self; |
|
748 } |
|
749 |
|
750 void CBioPop3SettingsSectionParser::LogComment(const TDesC& aComment) |
|
751 { |
|
752 iClientTest.TestUtils().WriteComment(aComment); |
|
753 } |
|
754 |
|
755 void CBioPop3SettingsSectionParser::ConstructL(const TDesC& aNewSectionName) |
|
756 { |
|
757 CBaseSectionParser::ConstructL(aNewSectionName); |
|
758 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
759 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
760 iClientTest.SetDebugInfo(debugInfo); |
|
761 |
|
762 iClientTest.AddStateL(CDoCmdMsv::NewL(_L("Null"),iClientTest, CDoCmdMsv::ECmdInstantDefaultPop3), debugInfo); |
|
763 |
|
764 iCommandParsers->AppendL(CBioPop3SettingsCommandsParser::NewL(iClientTest)); |
|
765 } |
|
766 |
|
767 // |
|
768 // CBioPop3SettingsCommandsParser |
|
769 // Handles the commands in the |
|
770 // [check_pop3_defs] section of the script |
|
771 void CBioPop3SettingsCommandsParser::ProcessL() |
|
772 { |
|
773 |
|
774 if((*iCurrentCommand) == KCommandPop3ChkLoginName) |
|
775 { |
|
776 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkPop3LoginName), iDebugInfo); |
|
777 } |
|
778 else |
|
779 if((*iCurrentCommand) == KCommandPop3ChkPassword) |
|
780 { |
|
781 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkPop3Password), iDebugInfo); |
|
782 } |
|
783 else |
|
784 if((*iCurrentCommand) == KCommandPop3ChkServerAddress) |
|
785 { |
|
786 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkPop3ServerAddress), iDebugInfo); |
|
787 } |
|
788 else |
|
789 /*if((*iCurrentCommand) == KCommandPop3ChkAPop) |
|
790 { |
|
791 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkPop3Apop), iDebugInfo); |
|
792 } |
|
793 else*/ |
|
794 /*if((*iCurrentCommand) == KCommandPop3ChkAutoSendOnConnect) |
|
795 { |
|
796 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkPop3AutoSendOnConnect), iDebugInfo); |
|
797 } |
|
798 else*/ |
|
799 /*if((*iCurrentCommand) == KCommandPop3ChkPort) |
|
800 { |
|
801 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkPop3Port), iDebugInfo); |
|
802 } |
|
803 else*/ |
|
804 if((*iCurrentCommand) == KCommandPop3ChkUserAddress) |
|
805 { |
|
806 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkPop3UserAddress), iDebugInfo); |
|
807 } |
|
808 else |
|
809 /*if((*iCurrentCommand) == KCommandPop3ChkVersion) |
|
810 { |
|
811 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest, CDoCmdMsv::ECmdChkPop3Version), iDebugInfo); |
|
812 } |
|
813 else*/ |
|
814 { |
|
815 User::Leave(KErrNotFound); |
|
816 } |
|
817 } |
|
818 |
|
819 CBioPop3SettingsCommandsParser* CBioPop3SettingsCommandsParser::NewL(CClientTestHarness& aMainTest) |
|
820 { |
|
821 CBioPop3SettingsCommandsParser* self = new (ELeave) CBioPop3SettingsCommandsParser(aMainTest); |
|
822 CleanupStack::PushL(self); |
|
823 self->ConstructL(); |
|
824 CleanupStack::Pop(self); |
|
825 return self; |
|
826 } |
|
827 |
|
828 void CBioPop3SettingsCommandsParser::ConstructL() |
|
829 { |
|
830 CBaseCommandParser::ConstructL(); |
|
831 |
|
832 // |
|
833 // Add the commands |
|
834 AddCommandL(KCommandPop3ChkLoginName); |
|
835 AddCommandL(KCommandPop3ChkPassword); |
|
836 AddCommandL(KCommandPop3ChkServerAddress); |
|
837 //AddCommandL(KCommandPop3ChkAPop); |
|
838 //AddCommandL(KCommandPop3ChkAutoSendOnConnect); |
|
839 //AddCommandL(KCommandPop3ChkPort); |
|
840 AddCommandL(KCommandPop3ChkUserAddress); |
|
841 //AddCommandL(KCommandPop3ChkVersion); |
|
842 } |
|
843 |
|
844 // |
|
845 // CBioSmtpSettingsSectionParser |
|
846 // Handles the [check_smtp_defs] section of the script |
|
847 CBioSmtpSettingsSectionParser* CBioSmtpSettingsSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName) |
|
848 { |
|
849 CBioSmtpSettingsSectionParser* self = new (ELeave) CBioSmtpSettingsSectionParser(aTest, aScript); |
|
850 CleanupStack::PushL(self); |
|
851 self->ConstructL(aNewSectionName); |
|
852 CleanupStack::Pop(self); |
|
853 return self; |
|
854 } |
|
855 |
|
856 void CBioSmtpSettingsSectionParser::LogComment(const TDesC& aComment) |
|
857 { |
|
858 iClientTest.TestUtils().WriteComment(aComment); |
|
859 } |
|
860 |
|
861 void CBioSmtpSettingsSectionParser::ConstructL(const TDesC& aNewSectionName) |
|
862 { |
|
863 CBaseSectionParser::ConstructL(aNewSectionName); |
|
864 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
865 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
866 iClientTest.SetDebugInfo(debugInfo); |
|
867 iClientTest.AddStateL(CDoCmdMsv::NewL(_L("Null"),iClientTest, CDoCmdMsv::ECmdInstantDefaultSmtp), debugInfo); |
|
868 iCommandParsers->AppendL(CBioSmtpSettingsCommandsParser::NewL(iClientTest)); |
|
869 } |
|
870 |
|
871 // |
|
872 // CBioSmtpSettingsCommandsParser |
|
873 // Handles the commands in the |
|
874 // [check_Smtp_defs] section of the script |
|
875 void CBioSmtpSettingsCommandsParser::ProcessL() |
|
876 { |
|
877 /*if((*iCurrentCommand) == KCommandSmtpEmailAlias) |
|
878 { |
|
879 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpEmailAlias), iDebugInfo); |
|
880 } |
|
881 else */ |
|
882 if((*iCurrentCommand) == KCommandSmtpEmailAddress) |
|
883 { |
|
884 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpEmailAddress), iDebugInfo); |
|
885 } |
|
886 else |
|
887 /*if((*iCurrentCommand) == KCommandSmtpReplyToAddress) |
|
888 { |
|
889 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpReplyToAddress), iDebugInfo); |
|
890 } |
|
891 else */ |
|
892 /*if((*iCurrentCommand) == KCommandSmtpReceiptAddress) |
|
893 { |
|
894 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpReceiptAddress), iDebugInfo); |
|
895 } |
|
896 else */ |
|
897 /*if((*iCurrentCommand) == KCommandSmtpBodyEncoding) |
|
898 { |
|
899 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpBodyEncoding), iDebugInfo); |
|
900 } |
|
901 else */ |
|
902 /*if((*iCurrentCommand) == KCommandSmtpDefaultMsgCharSet) |
|
903 { |
|
904 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpDefaultMsgCharSet), iDebugInfo); |
|
905 } |
|
906 else */ |
|
907 /*if((*iCurrentCommand) == KCommandSmtpAddVCardToEmail) |
|
908 { |
|
909 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpAddVCardToEmail), iDebugInfo); |
|
910 } |
|
911 else */ |
|
912 /*if((*iCurrentCommand) == KCommandSmtpAddSignatureToEmail) |
|
913 { |
|
914 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpAddSignatureToEmail), iDebugInfo); |
|
915 } |
|
916 else */ |
|
917 /*if((*iCurrentCommand) == KCommandSmtpRequestReceipts) |
|
918 { |
|
919 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpRequestReceipts), iDebugInfo); |
|
920 } |
|
921 else */ |
|
922 /*if((*iCurrentCommand) == KCommandSmtpSendCopyToSelf) |
|
923 { |
|
924 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpSendCopyToSelf), iDebugInfo); |
|
925 } |
|
926 else */ |
|
927 /*if((*iCurrentCommand) == KCommandSmtpSendMessageOption) |
|
928 { |
|
929 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpSendMessageOption), iDebugInfo); |
|
930 } |
|
931 else */ |
|
932 if((*iCurrentCommand) == KCommandSmtpServerAddress) |
|
933 { |
|
934 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpServerAddress), iDebugInfo); |
|
935 } |
|
936 else |
|
937 /*if((*iCurrentCommand) == KCommandSmtpUserAddress) |
|
938 { |
|
939 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkSmtpUserAddress), iDebugInfo); |
|
940 } |
|
941 else*/ |
|
942 { |
|
943 User::Leave(KErrNotFound); |
|
944 } |
|
945 } |
|
946 |
|
947 CBioSmtpSettingsCommandsParser* CBioSmtpSettingsCommandsParser::NewL(CClientTestHarness& aMainTest) |
|
948 { |
|
949 CBioSmtpSettingsCommandsParser* self = new (ELeave) CBioSmtpSettingsCommandsParser(aMainTest); |
|
950 CleanupStack::PushL(self); |
|
951 self->ConstructL(); |
|
952 CleanupStack::Pop(self); |
|
953 return self; |
|
954 } |
|
955 |
|
956 void CBioSmtpSettingsCommandsParser::ConstructL() |
|
957 { |
|
958 CBaseCommandParser::ConstructL(); |
|
959 |
|
960 // |
|
961 // Add the commands |
|
962 //AddCommandL(KCommandSmtpEmailAlias); |
|
963 AddCommandL(KCommandSmtpEmailAddress); |
|
964 //AddCommandL(KCommandSmtpReplyToAddress); |
|
965 //AddCommandL(KCommandSmtpReceiptAddress); |
|
966 //AddCommandL(KCommandSmtpBodyEncoding); |
|
967 //AddCommandL(KCommandSmtpDefaultMsgCharSet); |
|
968 //AddCommandL(KCommandSmtpAddVCardToEmail); |
|
969 //AddCommandL(KCommandSmtpAddSignatureToEmail); |
|
970 //AddCommandL(KCommandSmtpRequestReceipts); |
|
971 //AddCommandL(KCommandSmtpSendCopyToSelf); |
|
972 //AddCommandL(KCommandSmtpSendMessageOption); |
|
973 AddCommandL(KCommandSmtpServerAddress); |
|
974 //AddCommandL(KCommandSmtpUserAddress); |
|
975 |
|
976 } |
|
977 |
|
978 // |
|
979 // CBioImapSettingsSectionParser |
|
980 // Handles the [check_Imap_defs] section of the script |
|
981 CBioImapSettingsSectionParser* CBioImapSettingsSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName) |
|
982 { |
|
983 CBioImapSettingsSectionParser* self = new (ELeave) CBioImapSettingsSectionParser(aTest, aScript); |
|
984 CleanupStack::PushL(self); |
|
985 self->ConstructL(aNewSectionName); |
|
986 CleanupStack::Pop(self); |
|
987 return self; |
|
988 } |
|
989 |
|
990 void CBioImapSettingsSectionParser::LogComment(const TDesC& aComment) |
|
991 { |
|
992 iClientTest.TestUtils().WriteComment(aComment); |
|
993 } |
|
994 |
|
995 void CBioImapSettingsSectionParser::ConstructL(const TDesC& aNewSectionName) |
|
996 { |
|
997 CBaseSectionParser::ConstructL(aNewSectionName); |
|
998 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
999 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
1000 iClientTest.SetDebugInfo(debugInfo); |
|
1001 iClientTest.AddStateL(CDoCmdMsv::NewL(_L("Null"),iClientTest, CDoCmdMsv::ECmdInstantDefaultImap), debugInfo); |
|
1002 iCommandParsers->AppendL(CBioImapSettingsCommandsParser::NewL(iClientTest)); |
|
1003 } |
|
1004 |
|
1005 // |
|
1006 // CBioImapSettingsCommandsParser |
|
1007 // Handles the commands in the |
|
1008 // [check_Imap_defs] section of the script |
|
1009 void CBioImapSettingsCommandsParser::ProcessL() |
|
1010 { |
|
1011 if((*iCurrentCommand) == KCommandImapServerAddress) |
|
1012 { |
|
1013 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapServerAddress), iDebugInfo); |
|
1014 } |
|
1015 else |
|
1016 /*if((*iCurrentCommand) == KCommandImapPort) |
|
1017 { |
|
1018 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapPort), iDebugInfo); |
|
1019 } else */ |
|
1020 if((*iCurrentCommand) == KCommandImapLoginName) |
|
1021 { |
|
1022 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapLoginName), iDebugInfo); |
|
1023 } |
|
1024 else |
|
1025 if((*iCurrentCommand) == KCommandImapPassword) |
|
1026 { |
|
1027 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapPassword), iDebugInfo); |
|
1028 } |
|
1029 else |
|
1030 if((*iCurrentCommand) == KCommandImapFolderPath) |
|
1031 { |
|
1032 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapFolderPath), iDebugInfo); |
|
1033 } |
|
1034 else |
|
1035 /*if((*iCurrentCommand) == KCommandImapPathSeparator) |
|
1036 { |
|
1037 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapPathSeparator), iDebugInfo); |
|
1038 } |
|
1039 else */ |
|
1040 /*if((*iCurrentCommand) == KCommandImapDisconnectedUserMode) |
|
1041 { |
|
1042 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapDisconnectedUserMode), iDebugInfo); |
|
1043 } |
|
1044 else */ |
|
1045 /*if((*iCurrentCommand) == KCommandImapSynchronise) |
|
1046 { |
|
1047 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapSynchronise), iDebugInfo); |
|
1048 } |
|
1049 else */ |
|
1050 /*if((*iCurrentCommand) == KCommandImapSubscribe) |
|
1051 { |
|
1052 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapSubscribe), iDebugInfo); |
|
1053 } |
|
1054 else */ |
|
1055 /*if((*iCurrentCommand) == KCommandImapAutoSendOnConnect) |
|
1056 { |
|
1057 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapAutoSendOnConnect), iDebugInfo); |
|
1058 } |
|
1059 else */ |
|
1060 /*if((*iCurrentCommand) == KCommandImapMaxEmailSize) |
|
1061 { |
|
1062 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapMaxEmailSize), iDebugInfo); |
|
1063 } |
|
1064 else */ |
|
1065 /*if((*iCurrentCommand) == KCommandImapDeleteEmailsWhenDisconnecting) |
|
1066 { |
|
1067 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapDeleteEmailsWhenDisconnecting), iDebugInfo); |
|
1068 } |
|
1069 else */ |
|
1070 /*if((*iCurrentCommand) == KCommandImapAcknowledgeReceipts) |
|
1071 { |
|
1072 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapAcknowledgeReceipts), iDebugInfo); |
|
1073 } |
|
1074 else */ |
|
1075 /*if((*iCurrentCommand) == KCommandImapGetMailOptions) |
|
1076 { |
|
1077 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapGetMailOptions), iDebugInfo); |
|
1078 } |
|
1079 else */ |
|
1080 /*if((*iCurrentCommand) == KCommandImapInboxSynchronisationLimit) |
|
1081 { |
|
1082 iClientTest.AddStateL(CDoCmdMsv::NewL(*iArgumentList,iClientTest,CDoCmdMsv::ECmdChkImapInboxSynchronisationLimit), iDebugInfo); |
|
1083 } |
|
1084 else*/ |
|
1085 { |
|
1086 User::Leave(KErrNotFound); |
|
1087 } |
|
1088 } |
|
1089 |
|
1090 CBioImapSettingsCommandsParser* CBioImapSettingsCommandsParser::NewL(CClientTestHarness& aMainTest) |
|
1091 { |
|
1092 CBioImapSettingsCommandsParser* self = new (ELeave) CBioImapSettingsCommandsParser(aMainTest); |
|
1093 CleanupStack::PushL(self); |
|
1094 self->ConstructL(); |
|
1095 CleanupStack::Pop(self); |
|
1096 return self; |
|
1097 } |
|
1098 |
|
1099 void CBioImapSettingsCommandsParser::ConstructL() |
|
1100 { |
|
1101 CBaseCommandParser::ConstructL(); |
|
1102 |
|
1103 // |
|
1104 // Add the commands |
|
1105 //AddCommandL(KCommandImapChkLoginName); |
|
1106 AddCommandL(KCommandImapServerAddress); |
|
1107 //AddCommandL(KCommandImapPort); |
|
1108 AddCommandL(KCommandImapLoginName); |
|
1109 AddCommandL(KCommandImapPassword); |
|
1110 AddCommandL(KCommandImapFolderPath); |
|
1111 //AddCommandL(KCommandImapPathSeparator); |
|
1112 //AddCommandL(KCommandImapDisconnectedUserMode); |
|
1113 //AddCommandL(KCommandImapSynchronise); |
|
1114 //AddCommandL(KCommandImapSubscribe); |
|
1115 //AddCommandL(KCommandImapAutoSendOnConnect); |
|
1116 //AddCommandL(KCommandImapMaxEmailSize); |
|
1117 //AddCommandL(KCommandImapDeleteEmailsWhenDisconnecting); |
|
1118 //AddCommandL(KCommandImapAcknowledgeReceipts); |
|
1119 //AddCommandL(KCommandImapGetMailOptions); |
|
1120 //AddCommandL(KCommandImapInboxSynchronisationLimit); |
|
1121 |
|
1122 } |
|
1123 |
|
1124 // |
|
1125 // CBioCommDBSectionParser |
|
1126 // Handles the [bio_commdb] section of the script |
|
1127 CBioCommDBSectionParser* CBioCommDBSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aTableName, const TDesC& aNewSectionName) |
|
1128 { |
|
1129 CBioCommDBSectionParser* self = new (ELeave) CBioCommDBSectionParser(aTest, aScript); |
|
1130 CleanupStack::PushL(self); |
|
1131 self->ConstructL(aTableName, aNewSectionName); |
|
1132 CleanupStack::Pop(self); |
|
1133 return self; |
|
1134 } |
|
1135 |
|
1136 void CBioCommDBSectionParser::LogComment(const TDesC& aComment) |
|
1137 { |
|
1138 iClientTest.TestUtils().WriteComment(aComment); |
|
1139 } |
|
1140 |
|
1141 void CBioCommDBSectionParser::ConstructL(const TDesC& aTableName, const TDesC& aNewSectionName) |
|
1142 { |
|
1143 CBaseSectionParser::ConstructL(aNewSectionName); |
|
1144 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
1145 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
1146 iClientTest.SetDebugInfo(debugInfo); |
|
1147 iCommandParsers->AppendL(CBioCommDBCommandParser::NewL(iClientTest, aTableName)); |
|
1148 } |
|
1149 |
|
1150 void CBioCommDBSectionParser::SectionFinishedL(TTestDebugInfo& aDebugInfo) |
|
1151 { |
|
1152 ((CBioCommDBCommandParser*)iCommandParsers->At(0))->SectionFinishedL(aDebugInfo); |
|
1153 } |
|
1154 |
|
1155 // |
|
1156 // CBioCommDBCommandParser |
|
1157 // Handles the commands in the |
|
1158 // [check_pop3_defs] section of the script |
|
1159 void CBioCommDBCommandParser::ProcessL() |
|
1160 { |
|
1161 if((*iCurrentCommand) == KCommandCommDbReadText) |
|
1162 { |
|
1163 CheckNumberOfArgumentsL(2); |
|
1164 |
|
1165 // |
|
1166 // Add the stored table name |
|
1167 iArgumentList->AppendL(iTableName); |
|
1168 iClientTest.AddStateL(CDoCmdCommDB::NewL(*iArgumentList,iClientTest, CDoCmdCommDB::ECmdCommDBReadText), iDebugInfo); |
|
1169 } |
|
1170 |
|
1171 else |
|
1172 if((*iCurrentCommand) == KCommandCommDbReadLongText) |
|
1173 { |
|
1174 CheckNumberOfArgumentsL(2); |
|
1175 |
|
1176 // |
|
1177 // Add the stored table name |
|
1178 iArgumentList->AppendL(iTableName); |
|
1179 iClientTest.AddStateL(CDoCmdCommDB::NewL(*iArgumentList,iClientTest, CDoCmdCommDB::ECmdCommDBReadLongText), iDebugInfo); |
|
1180 } |
|
1181 |
|
1182 else |
|
1183 if((*iCurrentCommand) == KCommandCommDbReadUint) |
|
1184 { |
|
1185 CheckNumberOfArgumentsL(2); |
|
1186 |
|
1187 // |
|
1188 // Add the stored table name |
|
1189 iArgumentList->AppendL(iTableName); |
|
1190 iClientTest.AddStateL(CDoCmdCommDB::NewL(*iArgumentList, iClientTest, CDoCmdCommDB::ECmdCommDBReadUint), iDebugInfo); |
|
1191 } |
|
1192 |
|
1193 else |
|
1194 if((*iCurrentCommand) == KCommandCommDbReadBool) |
|
1195 { |
|
1196 CheckNumberOfArgumentsL(2); |
|
1197 |
|
1198 // |
|
1199 // Add the stored table name |
|
1200 iArgumentList->AppendL(iTableName); |
|
1201 iClientTest.AddStateL(CDoCmdCommDB::NewL(*iArgumentList, iClientTest, CDoCmdCommDB::ECmdCommDBReadBool), iDebugInfo); |
|
1202 } |
|
1203 |
|
1204 else |
|
1205 if((*iCurrentCommand) == KCommandCommDbCheck) |
|
1206 { |
|
1207 CheckNumberOfArgumentsL(3); |
|
1208 |
|
1209 // |
|
1210 // Build up the SQL |
|
1211 const TPtrC& ptrFieldName = (*iArgumentList)[1]; |
|
1212 const TPtrC& ptrExpected = (*iArgumentList)[2]; |
|
1213 _LIT(KEquals, "="); |
|
1214 const TInt conditionPacking = 2+4; // 2x comma separators + 4 max length of type field (ie, bool, text or uint) |
|
1215 TInt conditionLength = 0; |
|
1216 if(iClientTest.iSQL == NULL) |
|
1217 { |
|
1218 conditionLength = ptrFieldName.Length() + ptrExpected.Length() + conditionPacking; |
|
1219 iClientTest.iSQL = HBufC::NewL(conditionLength); |
|
1220 |
|
1221 TPtr conditionDes = iClientTest.iSQL->Des(); |
|
1222 |
|
1223 // append field name |
|
1224 conditionDes.Append(ptrFieldName); |
|
1225 conditionDes.Append(KEquals); |
|
1226 |
|
1227 iClientTest.iSQL->Des().Append(ptrExpected); |
|
1228 } |
|
1229 else |
|
1230 { |
|
1231 conditionLength = iClientTest.iSQL->Length() + ptrFieldName.Length() + ptrExpected.Length() + conditionPacking + 3; |
|
1232 |
|
1233 iClientTest.iSQL = iClientTest.iSQL->ReAllocL(conditionLength); |
|
1234 |
|
1235 iClientTest.iSQL->Des().Append(KCommaSeparator); |
|
1236 TPtr conditionDes = iClientTest.iSQL->Des(); |
|
1237 |
|
1238 // append field name |
|
1239 conditionDes.Append(ptrFieldName); |
|
1240 conditionDes.Append(KEquals); |
|
1241 |
|
1242 iClientTest.iSQL->Des().Append(ptrExpected); |
|
1243 |
|
1244 conditionDes = iClientTest.iSQL->Des(); |
|
1245 } |
|
1246 |
|
1247 } |
|
1248 else |
|
1249 { |
|
1250 User::Leave(KErrNotFound); |
|
1251 } |
|
1252 } |
|
1253 |
|
1254 CBioCommDBCommandParser* CBioCommDBCommandParser::NewL(CClientTestHarness& aMainTest, const TDesC& aTableName) |
|
1255 { |
|
1256 CBioCommDBCommandParser* self = new (ELeave) CBioCommDBCommandParser(aMainTest, aTableName); |
|
1257 CleanupStack::PushL(self); |
|
1258 self->ConstructL(); |
|
1259 CleanupStack::Pop(self); |
|
1260 return self; |
|
1261 } |
|
1262 |
|
1263 void CBioCommDBCommandParser::ConstructL() |
|
1264 { |
|
1265 CBaseCommandParser::ConstructL(); |
|
1266 |
|
1267 // |
|
1268 // Add the commands |
|
1269 AddCommandL(KCommandCommDbReadText); |
|
1270 AddCommandL(KCommandCommDbReadLongText); |
|
1271 AddCommandL(KCommandCommDbReadUint); |
|
1272 AddCommandL(KCommandCommDbReadBool); |
|
1273 AddCommandL(KCommandCommDbCheck); |
|
1274 } |
|
1275 |
|
1276 void CBioCommDBCommandParser::SectionFinishedL(TTestDebugInfo& aDebugInfo) |
|
1277 { |
|
1278 iArgumentList->Reset(); |
|
1279 iArgumentList->AppendL(*iClientTest.iSQL); |
|
1280 iArgumentList->AppendL(iTableName); |
|
1281 iClientTest.AddStateL(CDoCmdCommDB::NewL(*iArgumentList,iClientTest, CDoCmdCommDB::ECmdCommDBCheck), aDebugInfo); |
|
1282 delete iClientTest.iSQL; |
|
1283 iClientTest.iSQL = NULL; |
|
1284 } |
|
1285 |
|
1286 |
|
1287 // |
|
1288 // CBioGenMsgSectionParser |
|
1289 // Handles the [gen_msg_from_section] section of the script |
|
1290 CBioGenMsgSectionParser* CBioGenMsgSectionParser::NewL(CClientTestHarness& aTest, CTestScript& aScript, const TDesC& aNewSectionName) |
|
1291 { |
|
1292 CBioGenMsgSectionParser* self = new (ELeave) CBioGenMsgSectionParser(aTest, aScript); |
|
1293 CleanupStack::PushL(self); |
|
1294 self->ConstructL(aNewSectionName); |
|
1295 CleanupStack::Pop(self); |
|
1296 return self; |
|
1297 } |
|
1298 |
|
1299 void CBioGenMsgSectionParser::LogComment(const TDesC& aComment) |
|
1300 { |
|
1301 iClientTest.TestUtils().WriteComment(aComment); |
|
1302 } |
|
1303 |
|
1304 void CBioGenMsgSectionParser::ConstructL(const TDesC& aNewSectionName) |
|
1305 { |
|
1306 CBaseSectionParser::ConstructL(aNewSectionName); |
|
1307 TTestDebugInfo debugInfo = iClientTest.GetDebugInfo(); |
|
1308 debugInfo.SetTestHarnessName(iSection->SectionPosition()); |
|
1309 iClientTest.SetDebugInfo(debugInfo); |
|
1310 iCmdParser = CBioGenMsgCommandParser::NewL(iClientTest); |
|
1311 iCommandParsers->AppendL(iCmdParser); // Transfer ownership |
|
1312 } |
|
1313 |
|
1314 void CBioGenMsgSectionParser::SectionFinishedL() |
|
1315 { |
|
1316 iCmdParser->SectionFinishedL(); |
|
1317 } |
|
1318 |
|
1319 // |
|
1320 // CBioGenMsgCommandParser |
|
1321 // Handles the commands in the |
|
1322 // [gen_msg_from_section] section of the script |
|
1323 void CBioGenMsgCommandParser::ProcessL() |
|
1324 { |
|
1325 if((*iCurrentCommand) == KCommandGenMsgAddLine) |
|
1326 { |
|
1327 // |
|
1328 // Append to buffer |
|
1329 TPtrC aString((*iArgumentList)[0]); |
|
1330 _LIT(KCrLf, "\r\n"); |
|
1331 |
|
1332 if(iBuffer == NULL) |
|
1333 { |
|
1334 iBuffer = HBufC::NewL(aString.Length() + KCrLf().Length()); |
|
1335 iBuffer->Des().Copy(aString); |
|
1336 iBuffer->Des().Append(KCrLf); |
|
1337 } |
|
1338 else |
|
1339 { |
|
1340 iBuffer = iBuffer->ReAllocL(iBuffer->Length() + aString.Length() + KCrLf().Length()); |
|
1341 iBuffer->Des().Append(aString); |
|
1342 iBuffer->Des().Append(KCrLf); |
|
1343 } |
|
1344 |
|
1345 } |
|
1346 else |
|
1347 if((*iCurrentCommand) == KCommandGenMsgType) |
|
1348 { |
|
1349 iMsgType = EBioIapSettingsMessage; |
|
1350 } |
|
1351 else |
|
1352 { |
|
1353 User::Leave(KErrNotFound); |
|
1354 } |
|
1355 } |
|
1356 |
|
1357 CBioGenMsgCommandParser* CBioGenMsgCommandParser::NewL(CClientTestHarness& aMainTest) |
|
1358 { |
|
1359 CBioGenMsgCommandParser* self = new (ELeave) CBioGenMsgCommandParser(aMainTest); |
|
1360 CleanupStack::PushL(self); |
|
1361 self->ConstructL(); |
|
1362 CleanupStack::Pop(self); |
|
1363 return self; |
|
1364 } |
|
1365 |
|
1366 void CBioGenMsgCommandParser::ConstructL() |
|
1367 { |
|
1368 CBaseCommandParser::ConstructL(); |
|
1369 |
|
1370 // |
|
1371 // Add the commands |
|
1372 AddCommandL(KCommandGenMsgAddLine); |
|
1373 AddCommandL(KCommandGenMsgType); |
|
1374 } |
|
1375 |
|
1376 void CBioGenMsgCommandParser::SectionFinishedL() |
|
1377 { |
|
1378 const HBufC* buf = iBuffer; |
|
1379 |
|
1380 iClientTest.AddStateL(CDoCmdGeneral::NewL(iClientTest, buf, iMsgType, CDoCmdGeneral::ECmdGeneralGenerateFromSection), iDebugInfo); |
|
1381 } |