messagingfw/msgtest/integration/email/src/emailsmokeparse.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 1999-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 "emailsmokeparse.h"
       
    17 #include "emailsmokecommands.h"
       
    18 #include "smtptestparsers.h"
       
    19 #include "poptestparsers.h"
       
    20 #include "imaptestparsers.h"
       
    21 #include <commsdattypesv1_1.h>
       
    22 #include <commsdat.h>
       
    23 using namespace CommsDat;
       
    24 
       
    25 #ifndef _NO_IAP_PREFS
       
    26 #include <iapprefs.h>
       
    27 #endif
       
    28 
       
    29 // New test commands
       
    30 _LIT(KCommandEmailClientTest,		"email_client_test");
       
    31 
       
    32 // Msv client commands
       
    33 _LIT(KCommandStartClientSession,	"start_client_session");		// 0 parameters, initialises CMsvTestUtils, and frees resources. Should be called at the start of every section
       
    34 _LIT(KCommandResetClient,			"reset_client");				// 0 parameters, resets CMsvTestUtils, and frees resources. Should be called at the end of every section
       
    35 
       
    36 // Msv utility commands
       
    37 _LIT(KCommandCleanMessageFolder,	"clean_message_folder");		// 0 parameters, deletes message store
       
    38 _LIT(KCommandCheckMessageStore,		"check_message_store");
       
    39 _LIT(KCommandAddComment,			"add_comment");					// n parameters, adds a comment to the log, concatenates parameters
       
    40 _LIT(KCommandCountChildren,			"count_children");				// 0 parameters, counts entries in current folder
       
    41 _LIT(KCommandCheckService,			"check_service");				// 0 parameters, checks that a service has been created or selected
       
    42 _LIT(KCommandWait,					"wait");						// 1 parameter, waits for n seconds...
       
    43 _LIT(KCommandTestEntry,				"test_entry");					// 1 parameter, tests the attributes of the currently selected message
       
    44 _LIT(KCommandChangeDrive,			"change_to_drive");				// 1 parameter, changes mail location to specified drive
       
    45 _LIT(KCommandRemoveFileOrDir,		"remove_file_or_dir");			// 1 parameter, removes the specified directory
       
    46 _LIT(KCommandDumpMailStore,			"dump_mail_store");				// 1 parameter, dumps the contents of the mail store into specified directory
       
    47 _LIT(KCommandCompareFiles,			"compare_files");				// 2 parameters, compares the contents of MsgLogs\T_EMAIL\dump\[param1] with MsgTest\emailsmoke\reference\[param2]
       
    48 _LIT(KCommandDumpBodyText,			"dump_body_text");				// 1 parameter, dumps the body text of the selected messages into \MsgLogs\T_EMAIL\dump\param1 file
       
    49 _LIT(KCommandChangeCharset,			"change_charset");				// 1 parameter, sets the new charset info on the selected messages to the specified value.
       
    50 _LIT(KCommandGetAttachmentName,		"dump_attachment_names");		// 1 parameter, dumps the attachment names of the selected entries into \MsgLogs\T_EMAIL\dump\param1 file
       
    51 _LIT(KCommandDumpHeaders,			"dump_header_fields");			// 1 parameter, dumps the header fields of the selected entries into \MsgLogs\T_EMAIL\dump\param1 file
       
    52 
       
    53 // Msv selection commands
       
    54 _LIT(KCommandSelectFolder,			"select_folder");				// 1 parameter, selects a folder
       
    55 _LIT(KCommandSelectEntry,			"select_entry");				// 1 parameter, select an entry by looking in iDetails and iDescription (Note: can only take 1 parameter)
       
    56 _LIT(KCommandSelectRootFolder,		"select_root_folder");			// 0 parameters, selects root
       
    57 _LIT(KCommandSelectAllMessages,		"select_all_messages");			// 0 parameters, selects all entries in current folder
       
    58 _LIT(KCommandSelectDestination,		"select_destination_folder");	// 1 parameter, selects a destination folder used for copying and moving
       
    59 _LIT(KCommandCheckSelectionCount,	"check_selection_count");		// 1 parameter, tests the current selection count == parameter
       
    60 _LIT(KCommandSelectLastInSelection,	"select_last_in_selection");	// 1 parameter, reduces the current selection to its last N entries
       
    61 _LIT(KCommandSelectFirstInSelection,"select_first_in_selection");	// 1 parameter, reduces the current selection to its first N entries
       
    62 _LIT(KCommandCheckRemoteFolderSize,	"check_remote_folder_size");	// 1 parameter, checks the remote folder size is what is expected
       
    63 _LIT(KCommandSelectPopulated,		"select_populated");			// 0 parameter, selects populated messages in the current selection
       
    64 _LIT(KCommandCheckNewFlag,			"check_new_flag");				// 2 parameters, tests if the selected entry(with the index Parameter1) has its New flag == parameter2
       
    65 _LIT(KCommandCheckPriority,			"check_priority");				// 2 parameters, tests if the selected entry(with the index Parameter1) has its Priority flag == parameter2
       
    66 _LIT(KCommandCheckAttachment,		"check_attachment");			// 2 parameters, tests if the selected entry(with the index Parameter1) has its Attachment flag == parameter2
       
    67 _LIT(KCommandCheckBodyText,			"check_body_text");				// 2 parameters, tests if the selected entry(with the index Parameter1) has Body Text == parameter2
       
    68 _LIT(KCommandCheckChildren,			"check_children");				// 2 parameters, tests if the selected entry(with the index Parameter1) has children == parameter2
       
    69 
       
    70 // The main section
       
    71 _LIT(KMainSectionName, "main");
       
    72 
       
    73 // Email utility commands
       
    74 _LIT(KCommandEmailCreateMessage,	"create_email_message");		// 2 parameters, creates a message from a text file (param 2) from directory (param 1)
       
    75 																	// Optional param howmany messages, if not specified it is 1
       
    76 
       
    77 _LIT(KCommandEmailAddIAP,			"add_iap");						// 1 parameter, uses an IAP (internet access point) as defined in CommDB
       
    78 _LIT(KCommandEmailAddIAPByName,		"add_iap_by_name");				// 1 parameter, finds an IAP in CommDB using its name
       
    79 
       
    80 // Msv client operations
       
    81 _LIT(KCommandMsvCopySelection,		"copy");						// 0 parameters, copies a 'selection' to a 'destination folder'
       
    82 _LIT(KCommandMsvMoveSelection,		"move");						// 0 parameters, moves a 'selection' to a 'destination folder'
       
    83 _LIT(KCommandMsvDeleteSelection,	"delete");
       
    84 _LIT(KCommandDeleteChildren,		"delete_children");				// 1 parameter, deletes the children of the selected entry (with the index Parameter).
       
    85 																	// NOTE: this command sets 'selection' to the selected entry's children.
       
    86 // Test entry commands
       
    87 _LIT(KCommandTestEntryVisible,		"visible");						// 0 parameters, copies a 'selection' to a 'destination folder'
       
    88 _LIT(KCommandTestEntryComplete,		"complete");					// 0 parameters, moves a 'selection' to a 'destination folder'
       
    89 
       
    90 // True or False ?
       
    91 _LIT(KParameterETrue,				"true");	// !EFalse
       
    92 _LIT(KParameterEFalse,				"false");	// EFalse
       
    93 
       
    94 //
       
    95 //
       
    96 // CMainSectionParser
       
    97 //
       
    98 
       
    99 CMainSectionParser* CMainSectionParser::NewL(CMainTestHarness& aMainTest, CTestScript& aScript, TBool aKeepLogFile)
       
   100 	{
       
   101 	CMainSectionParser* self = new (ELeave) CMainSectionParser(aMainTest, aScript, aKeepLogFile);
       
   102 	CleanupStack::PushL(self);
       
   103 	self->ConstructL();
       
   104 	CleanupStack::Pop(self);
       
   105 	return self;
       
   106 	}
       
   107 
       
   108 void CMainSectionParser::LogComment(const TDesC& aComment)
       
   109 	{
       
   110 	iMainTest.TestConsole().Printf(aComment);
       
   111 	}
       
   112 
       
   113 void CMainSectionParser::ConstructL()
       
   114 	{
       
   115 	CBaseSectionParser::ConstructL(KMainSectionName);
       
   116 	iCommandParsers->AppendL(CNewEmailTestCommandParser::NewL(iScript, iMainTest,iKeepLogFile));
       
   117 	}
       
   118 
       
   119 CMainSectionParser::CMainSectionParser(CMainTestHarness& aMainTest, CTestScript& aScript, TBool aKeepLogFile) : CBaseSectionParser(aScript), iMainTest(aMainTest), iKeepLogFile(aKeepLogFile)
       
   120 	{
       
   121 	}
       
   122 
       
   123 
       
   124 
       
   125 
       
   126 //
       
   127 //
       
   128 // CEmailClientSectionParser
       
   129 //
       
   130 
       
   131 CEmailClientSectionParser* CEmailClientSectionParser::NewL(CEmailClientTest& aEmailClientTest, CTestScript& aScript, const TDesC& aNewSectionName)
       
   132 	{
       
   133 	CEmailClientSectionParser* self = new (ELeave) CEmailClientSectionParser(aEmailClientTest, aScript);
       
   134 	CleanupStack::PushL(self);
       
   135 	self->ConstructL(aNewSectionName);
       
   136 	CleanupStack::Pop(self);
       
   137 	return self;
       
   138 	}
       
   139 
       
   140 void CEmailClientSectionParser::LogComment(const TDesC& aComment)
       
   141 	{
       
   142 	iEmailTest.EmailTestUtils().WriteComment(aComment);
       
   143 	}
       
   144 
       
   145 void CEmailClientSectionParser::ConstructL(const TDesC& aNewSectionName)
       
   146 	{
       
   147 	CBaseSectionParser::ConstructL(aNewSectionName);
       
   148 	TTestDebugInfo debugInfo = iEmailTest.GetDebugInfo();
       
   149 	debugInfo.SetTestHarnessName(iSection->SectionPosition());
       
   150 	iEmailTest.SetDebugInfo(debugInfo);
       
   151 	iCommandParsers->AppendL(CNewSmtpTestCommandParser::NewL(iScript, iEmailTest));
       
   152 	iCommandParsers->AppendL(CNewPop3TestCommandParser::NewL(iScript, iEmailTest));
       
   153 	iCommandParsers->AppendL(CNewImapTestCommandParser::NewL(iScript, iEmailTest));
       
   154 	iCommandParsers->AppendL(CMsvSelectParser::NewL(iEmailTest));
       
   155 	iCommandParsers->AppendL(CMsvUtilitiesParser::NewL(iEmailTest));
       
   156 	iCommandParsers->AppendL(CEmailUtilitiesParser::NewL(iEmailTest));
       
   157 	iCommandParsers->AppendL(CMsvOperationParser::NewL(iEmailTest));
       
   158 	}
       
   159 
       
   160 CEmailClientSectionParser::CEmailClientSectionParser(CEmailClientTest& aEmailTest, CTestScript& aScript) : CBaseSectionParser(aScript), iEmailTest(aEmailTest)
       
   161 	{
       
   162 	}
       
   163 
       
   164 
       
   165 
       
   166 //
       
   167 //
       
   168 // CNewEmailTestCommandParser
       
   169 //
       
   170 
       
   171 CNewEmailTestCommandParser* CNewEmailTestCommandParser::NewL(CTestScript& aScript, CMainTestHarness& aMainTest, TBool aKeepLogFile)
       
   172 	{
       
   173 	CNewEmailTestCommandParser* self = new (ELeave) CNewEmailTestCommandParser(aScript, aMainTest, aKeepLogFile);
       
   174 	CleanupStack::PushL(self);
       
   175 	self->ConstructL();
       
   176 	CleanupStack::Pop(self);
       
   177 	return self;
       
   178 	}
       
   179 
       
   180 void CNewEmailTestCommandParser::ProcessL()
       
   181 	{
       
   182 	// Create an email test utilities
       
   183 	CEmailTestUtils* emailTestUtils = CEmailTestUtils::NewL(iMainTest.TestConsole(),iKeepLogFile? ETuKeepLogFile:0);
       
   184 	CleanupStack::PushL(emailTestUtils);
       
   185 	if (iKeepLogFile)
       
   186 		emailTestUtils->WriteComment(KTestHeader);
       
   187 
       
   188 	// Create an email test, give it the test utilities
       
   189 	CEmailClientTest* emailTest = CEmailClientTest::NewL(emailTestUtils, iMainTest.TestConsole());
       
   190 	CleanupStack::Pop(emailTestUtils); // emailTest has taken ownership
       
   191 	CleanupStack::PushL(emailTest);
       
   192 
       
   193 	// Attach the email test to the main test
       
   194 	iMainTest.AddStateL(emailTest, iDebugInfo);
       
   195 	CleanupStack::Pop(emailTest); // emailTest is now owned by the iMainTest
       
   196 
       
   197 	// Check that there is one argument, the email test section name
       
   198 	CheckNumberOfArgumentsL(1);
       
   199 
       
   200 	// Create an email section parser
       
   201 	CEmailClientSectionParser* sectionParser = CEmailClientSectionParser::NewL(*emailTest, iScript, (*iArgumentList)[0]);
       
   202 	CleanupStack::PushL(sectionParser);
       
   203 	sectionParser->ParseL();
       
   204 	CleanupStack::PopAndDestroy(sectionParser);
       
   205 	}
       
   206 
       
   207 void CNewEmailTestCommandParser::ConstructL()
       
   208 	{
       
   209 	CBaseCommandParser::ConstructL();
       
   210 	AddCommandL(KCommandEmailClientTest);
       
   211 	}
       
   212 
       
   213 CNewEmailTestCommandParser::CNewEmailTestCommandParser(CTestScript& aScript, CMainTestHarness& aMainTest, TBool aKeepLogFile) : iMainTest(aMainTest), iScript(aScript), iKeepLogFile(aKeepLogFile)
       
   214 	{
       
   215 	}
       
   216 
       
   217 //
       
   218 //
       
   219 // CMsvUtilitiesParser
       
   220 //
       
   221 
       
   222 CMsvUtilitiesParser* CMsvUtilitiesParser::NewL(CMsvClientTest& aMsvClientTest)
       
   223 	{
       
   224 	CMsvUtilitiesParser* self = new (ELeave) CMsvUtilitiesParser(aMsvClientTest);
       
   225 	CleanupStack::PushL(self);
       
   226 	self->ConstructL();
       
   227 	CleanupStack::Pop(self);
       
   228 	return self;
       
   229 	}
       
   230 
       
   231 void CMsvUtilitiesParser::ProcessL()
       
   232 	{
       
   233 	if ((*iCurrentCommand) == KCommandCleanMessageFolder)
       
   234 		{
       
   235 		iMsvClientTest.AddStateL(new (ELeave) CCleanMessageFolder(iMsvClientTest.MsvTestUtils()), iDebugInfo);
       
   236 		}
       
   237 	else if ((*iCurrentCommand) == KCommandDumpMailStore)
       
   238 		{
       
   239 		CheckNumberOfArgumentsL(1); // directory where to dump the mail store contents
       
   240 		iMsvClientTest.AddStateL(new (ELeave) CDumpMailStore(iMsvClientTest.MsvTestUtils(), (*iArgumentList)[0]), iDebugInfo);
       
   241 		}
       
   242 	else if ((*iCurrentCommand) == KCommandCompareFiles)
       
   243 		{
       
   244 		CheckNumberOfArgumentsL(2); // files to compare
       
   245 		iMsvClientTest.AddStateL(new (ELeave) CCompareFiles(iMsvClientTest.MsvTestUtils(), (*iArgumentList)[0], (*iArgumentList)[1]), iDebugInfo);
       
   246 		}
       
   247 	else if ((*iCurrentCommand) == KCommandDumpBodyText)
       
   248 		{
       
   249 		CheckNumberOfArgumentsL(1); // file where to dump the body text
       
   250 		iMsvClientTest.AddStateL(new (ELeave) CDumpBodyText(*(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils(), (*iArgumentList)[0]), iDebugInfo);
       
   251 		}
       
   252 	else if ((*iCurrentCommand) == KCommandGetAttachmentName)
       
   253 	{
       
   254 		CheckNumberOfArgumentsL(1); // file where to dump the subject
       
   255 		iMsvClientTest.AddStateL(new (ELeave) CGetAttachmentNames(*(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils(), (*iArgumentList)[0]), iDebugInfo);
       
   256 	}
       
   257 	else if ((*iCurrentCommand) == KCommandDumpHeaders)
       
   258 	{
       
   259 		CheckNumberOfArgumentsL(1); // file where to dump the subject
       
   260 		iMsvClientTest.AddStateL(new (ELeave) CDumpHeaderFields(*(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils(), (*iArgumentList)[0]), iDebugInfo);
       
   261 	}
       
   262 	else if ((*iCurrentCommand) == KCommandChangeCharset)
       
   263 		{
       
   264 		CheckNumberOfArgumentsL(1);
       
   265 		TLex lex((*iArgumentList)[0]);
       
   266 		TUint newCharset;
       
   267 		User::LeaveIfError(lex.Val(newCharset));
       
   268 		iMsvClientTest.AddStateL(new (ELeave) CChangeCharset(newCharset, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   269 									, iDebugInfo);
       
   270 		}
       
   271 	else if ((*iCurrentCommand) == KCommandCheckMessageStore)
       
   272 		{
       
   273 		CheckNumberOfArgumentsL(2);
       
   274 		TParse fileName;
       
   275 		ResolveFile(iMsvClientTest.MsvTestUtils().FileSession(), (*iArgumentList)[0], (*iArgumentList)[1], fileName);
       
   276 		iMsvClientTest.AddStateL(new (ELeave) CCheckMessageFolder(fileName.FullName(), iMsvClientTest.MsvTestUtils()), iDebugInfo);
       
   277 		}
       
   278 	else if ((*iCurrentCommand) == KCommandStartClientSession)
       
   279 		{
       
   280 		iMsvClientTest.AddStateL(new (ELeave) CGoClientSide(iMsvClientTest.MsvTestUtils()), iDebugInfo);
       
   281 		}
       
   282 	else if ((*iCurrentCommand) == KCommandAddComment)
       
   283 		{
       
   284 		iMsvClientTest.AddStateL(CAddComment::NewL(*iArgumentList, iMsvClientTest.MsvTestUtils()), iDebugInfo);
       
   285 		}
       
   286 	else if ((*iCurrentCommand) == KCommandResetClient)
       
   287 		{
       
   288 		iMsvClientTest.AddStateL(new (ELeave) CLongWait(), iDebugInfo);
       
   289 		iMsvClientTest.AddStateL(new (ELeave) CResetMessageServer(iMsvClientTest.MsvTestUtils()), iDebugInfo);
       
   290 		}
       
   291 	else if ((*iCurrentCommand) == KCommandTestEntry)
       
   292 		{
       
   293 		iMsvClientTest.AddStateL(new (ELeave) CMsvTestEntry(iMsvClientTest), iDebugInfo);
       
   294 
       
   295 		// eh xxxx, set up section parser for the details
       
   296 		}
       
   297 	else if ((*iCurrentCommand) == KCommandChangeDrive)
       
   298 		{
       
   299 		CheckNumberOfArgumentsL(1);
       
   300 		
       
   301 		TDriveUnit driveUnit((*iArgumentList)[0]);
       
   302 		
       
   303 		iMsvClientTest.AddStateL(new (ELeave) CChangeMsvDrive(iMsvClientTest, TInt(driveUnit)), iDebugInfo);
       
   304 		}
       
   305 	else if ((*iCurrentCommand) == KCommandRemoveFileOrDir)
       
   306 		{
       
   307 		CheckNumberOfArgumentsL(1);
       
   308 		
       
   309 		iMsvClientTest.AddStateL(new (ELeave) CRemoveFileOrDir(iMsvClientTest.MsvTestUtils(), (*iArgumentList)[0]), iDebugInfo);
       
   310 		}
       
   311 	else
       
   312 		{
       
   313 		User::Leave(KErrNotFound);
       
   314 		}
       
   315 	}
       
   316 
       
   317 void CMsvUtilitiesParser::ConstructL()
       
   318 	{
       
   319 	CBaseCommandParser::ConstructL();
       
   320 	AddCommandL(KCommandCleanMessageFolder);
       
   321 	AddCommandL(KCommandCheckMessageStore);
       
   322 	AddCommandL(KCommandAddComment);
       
   323 	AddCommandL(KCommandStartClientSession);
       
   324 	AddCommandL(KCommandResetClient);
       
   325 	AddCommandL(KCommandTestEntry);
       
   326 	AddCommandL(KCommandChangeDrive);
       
   327 	AddCommandL(KCommandRemoveFileOrDir);
       
   328 	AddCommandL(KCommandDumpMailStore);
       
   329 	AddCommandL(KCommandCompareFiles);
       
   330 	AddCommandL(KCommandDumpBodyText);
       
   331 	AddCommandL(KCommandChangeCharset);
       
   332 	AddCommandL(KCommandGetAttachmentName);
       
   333 	AddCommandL(KCommandDumpHeaders);
       
   334 	}
       
   335 
       
   336 CMsvUtilitiesParser::CMsvUtilitiesParser(CMsvClientTest& aMsvClientTest) : iMsvClientTest(aMsvClientTest)
       
   337 	{
       
   338 	}
       
   339 
       
   340 
       
   341 
       
   342 
       
   343 
       
   344 
       
   345 
       
   346 
       
   347 //
       
   348 //
       
   349 // CMsvSelectParser
       
   350 //
       
   351 
       
   352 CMsvSelectParser* CMsvSelectParser::NewL(CMsvClientTest& aMsvClientTest)
       
   353 	{
       
   354 	CMsvSelectParser* self = new (ELeave) CMsvSelectParser(aMsvClientTest);
       
   355 	CleanupStack::PushL(self);
       
   356 	self->ConstructL();
       
   357 	CleanupStack::Pop(self);
       
   358 	return self;
       
   359 	}
       
   360 
       
   361 
       
   362 void CMsvSelectParser::ProcessL()
       
   363 	{
       
   364 	if ((*iCurrentCommand) == KCommandSelectFolder)
       
   365 		{
       
   366 		CheckNumberOfArgumentsL(1);
       
   367 //		iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, iMsvClientTest.iSelectedFolder, iMsvClientTest.MsvTestUtils())
       
   368 //									, iDebugInfo);
       
   369 		iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, &(iMsvClientTest.iSelectedFolder), iMsvClientTest.MsvTestUtils())
       
   370 									, iDebugInfo);
       
   371 		}
       
   372 	else if ((*iCurrentCommand) == KCommandSelectEntry)
       
   373 		{
       
   374 		CheckNumberOfArgumentsL(1);
       
   375 //		iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, iMsvClientTest.iSelectedFolder, iMsvClientTest.MsvTestUtils())
       
   376 //									, iDebugInfo);
       
   377 		iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, iMsvClientTest.iCurrentSelection, iMsvClientTest.MsvTestUtils())
       
   378 									, iDebugInfo);
       
   379 		}
       
   380 	else if ((*iCurrentCommand) == KCommandSelectRootFolder)
       
   381 		{
       
   382 		CheckNumberOfArgumentsL(0);
       
   383 		iMsvClientTest.AddStateL(new (ELeave) CSelectEntryById(KMsvRootIndexEntryId, iMsvClientTest.iSelectedFolder, iMsvClientTest.MsvTestUtils())
       
   384 									, iDebugInfo);
       
   385 		}
       
   386 	else if ((*iCurrentCommand) == KCommandSelectAllMessages)
       
   387 		{
       
   388 		CheckNumberOfArgumentsL(0);
       
   389 		iMsvClientTest.AddStateL(new (ELeave) CSelectAllMessages(iMsvClientTest.iSelectedFolder, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   390 									, iDebugInfo);
       
   391 		}
       
   392 	else if ((*iCurrentCommand) == KCommandSelectDestination)
       
   393 		{
       
   394 		CheckNumberOfArgumentsL(1);
       
   395 //		iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, iMsvClientTest.iDestinationFolder, iMsvClientTest.MsvTestUtils() )
       
   396 //									, iDebugInfo);
       
   397 		iMsvClientTest.AddStateL(CSelectEntry::NewL((*iArgumentList)[0], iMsvClientTest.iSelectedFolder, &(iMsvClientTest.iDestinationFolder), iMsvClientTest.MsvTestUtils() )
       
   398 									, iDebugInfo);
       
   399 		}
       
   400 	else if ((*iCurrentCommand) == KCommandCheckSelectionCount)
       
   401 		{
       
   402 		CheckNumberOfArgumentsL(1);
       
   403 		TLex lex((*iArgumentList)[0]);
       
   404 		TInt expectedCount;
       
   405 		User::LeaveIfError(lex.Val(expectedCount));
       
   406 		iMsvClientTest.AddStateL(new (ELeave) CCheckSelectionCount(expectedCount, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   407 									, iDebugInfo);
       
   408 		}
       
   409 	else if ((*iCurrentCommand) == KCommandCheckNewFlag)
       
   410 		{
       
   411 		CheckNumberOfArgumentsL(2);
       
   412 
       
   413 		// Get the index of the Selected Entry to Test
       
   414 		TLex lex((*iArgumentList)[0]);
       
   415 		TInt selectedIndex;
       
   416 		User::LeaveIfError(lex.Val(selectedIndex));
       
   417 
       
   418 		// Get the expected New Status for this entry
       
   419 		lex = ((*iArgumentList)[1]);
       
   420 		TInt argumentValue;
       
   421 		User::LeaveIfError(lex.Val(argumentValue));
       
   422 		TBool expectedNewStatus = STATIC_CAST(TBool, argumentValue);
       
   423 		iMsvClientTest.AddStateL(new (ELeave) CCheckNewFlag(selectedIndex, expectedNewStatus, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   424 									, iDebugInfo);
       
   425 		}
       
   426 	else if ((*iCurrentCommand) == KCommandCheckPriority)
       
   427 		{
       
   428 		CheckNumberOfArgumentsL(2);
       
   429 
       
   430 		// Get the index of the Selected Entry to Test
       
   431 		TLex lex((*iArgumentList)[0]);
       
   432 		TInt selectedIndex;
       
   433 		User::LeaveIfError(lex.Val(selectedIndex));
       
   434 
       
   435 		// Get the expected New Status for this entry
       
   436 		lex = ((*iArgumentList)[1]);
       
   437 		TInt priority;
       
   438 		User::LeaveIfError(lex.Val(priority));
       
   439 		iMsvClientTest.AddStateL(new (ELeave) CCheckPriority(selectedIndex, priority, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   440 									, iDebugInfo);
       
   441 		}
       
   442 	else if ((*iCurrentCommand) == KCommandCheckAttachment)
       
   443 		{
       
   444 		CheckNumberOfArgumentsL(2);
       
   445 
       
   446 		// Get the index of the Selected Entry to Test
       
   447 		TLex lex((*iArgumentList)[0]);
       
   448 		TInt selectedIndex;
       
   449 		User::LeaveIfError(lex.Val(selectedIndex));
       
   450 
       
   451 		// Get the expected Attachment Status for this entry
       
   452 		lex = ((*iArgumentList)[1]);
       
   453 		TInt argumentValue;
       
   454 		User::LeaveIfError(lex.Val(argumentValue));
       
   455 		TBool testAttachment = STATIC_CAST(TBool, argumentValue);
       
   456 		iMsvClientTest.AddStateL(new (ELeave) CCheckAttachment(selectedIndex, testAttachment, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   457 									, iDebugInfo);
       
   458 		}
       
   459 	else if ((*iCurrentCommand) == KCommandCheckBodyText)
       
   460 		{
       
   461 		CheckNumberOfArgumentsL(2);
       
   462 
       
   463 		// Get the index of the Selected Entry to Test
       
   464 		TLex lex((*iArgumentList)[0]);
       
   465 		TInt selectedIndex;
       
   466 		User::LeaveIfError(lex.Val(selectedIndex));
       
   467 
       
   468 		// Get the expected Body Text
       
   469 		TBuf<KMaxTestBodyTxt> bodyText = (*iArgumentList)[1];
       
   470 		iMsvClientTest.AddStateL(CCheckBodyText::NewL(selectedIndex, bodyText, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   471 									, iDebugInfo);
       
   472 		}
       
   473 	else if ((*iCurrentCommand) == KCommandCheckChildren)
       
   474 		{
       
   475 		CheckNumberOfArgumentsL(2);
       
   476 
       
   477 		// Get the index of the Selected Entry to Test
       
   478 		TLex lex((*iArgumentList)[0]);
       
   479 		TInt selectedIndex;
       
   480 		User::LeaveIfError(lex.Val(selectedIndex));
       
   481 
       
   482 		// Get the expected children Status for this entry
       
   483 		lex = ((*iArgumentList)[1]);
       
   484 		TInt argumentValue;
       
   485 		User::LeaveIfError(lex.Val(argumentValue));
       
   486 		TBool testChildren = STATIC_CAST(TBool, argumentValue);
       
   487 		iMsvClientTest.AddStateL(new (ELeave) CCheckChildren(selectedIndex, testChildren, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   488 									, iDebugInfo);
       
   489 		}
       
   490 	else if ((*iCurrentCommand) == KCommandSelectLastInSelection)
       
   491 		{
       
   492 		CheckNumberOfArgumentsL(1);
       
   493 		TLex lex((*iArgumentList)[0]);
       
   494 		TInt expectedCount;
       
   495 		User::LeaveIfError(lex.Val(expectedCount));
       
   496 		iMsvClientTest.AddStateL(new (ELeave) CSelectLastInSelection(expectedCount, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   497 									, iDebugInfo);
       
   498 		}
       
   499 	else if ((*iCurrentCommand) == KCommandSelectFirstInSelection)
       
   500 		{
       
   501 		CheckNumberOfArgumentsL(1);
       
   502 		TLex lex((*iArgumentList)[0]);
       
   503 		TInt expectedCount;
       
   504 		User::LeaveIfError(lex.Val(expectedCount));
       
   505 		iMsvClientTest.AddStateL(new (ELeave) CSelectFirstInSelection(expectedCount, *(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   506 									, iDebugInfo);
       
   507 		}
       
   508 	else if ((*iCurrentCommand) == KCommandCheckRemoteFolderSize)
       
   509 		{
       
   510 		CheckNumberOfArgumentsL(1);
       
   511 		TLex lex((*iArgumentList)[0]);
       
   512 		TInt expectedCount;
       
   513 		User::LeaveIfError(lex.Val(expectedCount));
       
   514 		iMsvClientTest.AddStateL(new (ELeave) CCheckRemoteFolderSize(expectedCount, iMsvClientTest.MsvTestUtils())
       
   515 									, iDebugInfo);
       
   516 		}
       
   517 	else if ((*iCurrentCommand) == KCommandSelectPopulated)
       
   518 		{
       
   519 		CheckNumberOfArgumentsL(0);
       
   520 		iMsvClientTest.AddStateL(new (ELeave) CSelectPopulatedInSelection(*(iMsvClientTest.iCurrentSelection), iMsvClientTest.MsvTestUtils())
       
   521 									, iDebugInfo);
       
   522 		}
       
   523 	else
       
   524 		{
       
   525 		User::Leave(KErrNotFound);
       
   526 		}
       
   527 	}
       
   528 
       
   529 void CMsvSelectParser::ConstructL()
       
   530 	{
       
   531 	CBaseCommandParser::ConstructL();
       
   532 	AddCommandL(KCommandSelectRootFolder);
       
   533 	AddCommandL(KCommandSelectFolder);
       
   534 	AddCommandL(KCommandSelectEntry);
       
   535 	AddCommandL(KCommandSelectAllMessages);
       
   536 	AddCommandL(KCommandSelectDestination);
       
   537 	AddCommandL(KCommandCheckSelectionCount);
       
   538 	AddCommandL(KCommandSelectLastInSelection);
       
   539 	AddCommandL(KCommandSelectFirstInSelection);
       
   540 	AddCommandL(KCommandCheckRemoteFolderSize);
       
   541 	AddCommandL(KCommandSelectPopulated);
       
   542 	AddCommandL(KCommandCheckNewFlag);
       
   543 	AddCommandL(KCommandCheckPriority);
       
   544 	AddCommandL(KCommandCheckAttachment);
       
   545 	AddCommandL(KCommandCheckBodyText);
       
   546 	AddCommandL(KCommandCheckChildren);
       
   547 	}
       
   548 
       
   549 CMsvSelectParser::CMsvSelectParser(CMsvClientTest& aMsvClientTest) : iMsvClientTest(aMsvClientTest)
       
   550 	{
       
   551 	}
       
   552 
       
   553 
       
   554 
       
   555 //
       
   556 //
       
   557 // CEmailUtilitiesParser
       
   558 //
       
   559 
       
   560 CEmailUtilitiesParser* CEmailUtilitiesParser::NewL(CEmailClientTest& aEmailClientTest)
       
   561 	{
       
   562 	CEmailUtilitiesParser* self = new (ELeave) CEmailUtilitiesParser(aEmailClientTest);
       
   563 	CleanupStack::PushL(self);
       
   564 	self->ConstructL();
       
   565 	CleanupStack::Pop(self);
       
   566 	return self;
       
   567 	}
       
   568 
       
   569 void CEmailUtilitiesParser::ProcessL()
       
   570 	{
       
   571 	TInt howMany;
       
   572 
       
   573 	if ((*iCurrentCommand) == KCommandEmailCreateMessage)
       
   574 		{
       
   575 		if (iArgumentList->Count() == 3) // If optional howmany is specified
       
   576 			{
       
   577 			TPtrC param = (*iArgumentList)[2];
       
   578 			TLex lex(param);
       
   579 			if (lex.Val(howMany)!=KErrNone)
       
   580 				howMany=1;
       
   581 			}
       
   582 		else
       
   583 			{
       
   584 			howMany = 1;
       
   585 			CheckNumberOfArgumentsL(2);
       
   586 			}
       
   587 		iEmailClientTest.AddStateL(new (ELeave) CLongWait(), iDebugInfo);
       
   588 		iEmailClientTest.AddStateL(new (ELeave) CResetMessageServer(iEmailClientTest.EmailTestUtils()), iDebugInfo);
       
   589 		TParse fileName;
       
   590 		ResolveFile(iEmailClientTest.MsvTestUtils().FileSession(), (*iArgumentList)[0], (*iArgumentList)[1], fileName);
       
   591 		iEmailClientTest.AddStateL(new (ELeave) CCreateEmailMessage(iEmailClientTest.iSelectedFolder, iEmailClientTest.iCurrentServiceId, fileName.FullName(), iEmailClientTest.EmailTestUtils(),howMany), iDebugInfo);
       
   592 		}
       
   593 	else if ((*iCurrentCommand) == KCommandCountChildren)
       
   594 		{
       
   595 		iEmailClientTest.AddStateL(new (ELeave) CCountChildren(iEmailClientTest.iSelectedFolder, iEmailClientTest), iDebugInfo);
       
   596 		}
       
   597 	else if ((*iCurrentCommand) == KCommandCheckService)
       
   598 		{
       
   599 		iEmailClientTest.AddStateL(new (ELeave) CCheckService(iEmailClientTest), iDebugInfo);
       
   600 		}
       
   601 	else if ((*iCurrentCommand) == KCommandWait)
       
   602 		{
       
   603 		CheckNumberOfArgumentsL(1);
       
   604 
       
   605 		// Get the Wait Time
       
   606 		TLex lex((*iArgumentList)[0]);
       
   607 		TInt waitTime;
       
   608 		User::LeaveIfError(lex.Val(waitTime));
       
   609 
       
   610 		iEmailClientTest.AddStateL(new (ELeave) CLongWait(waitTime), iDebugInfo);
       
   611 		}
       
   612 	else
       
   613 		{
       
   614 		User::Leave(KErrNotFound);
       
   615 		}
       
   616 	}
       
   617 
       
   618 void CEmailUtilitiesParser::ConstructL()
       
   619 	{
       
   620 	CBaseCommandParser::ConstructL();
       
   621 	AddCommandL(KCommandEmailCreateMessage);
       
   622 	AddCommandL(KCommandCountChildren);
       
   623 	AddCommandL(KCommandCheckService);
       
   624 	AddCommandL(KCommandWait);
       
   625 	}
       
   626 
       
   627 CEmailUtilitiesParser::CEmailUtilitiesParser(CEmailClientTest& aEmailClientTest) : iEmailClientTest(aEmailClientTest)
       
   628 	{
       
   629 	}
       
   630 
       
   631 
       
   632 
       
   633 
       
   634 
       
   635 
       
   636 //
       
   637 //
       
   638 // CMsvOperationParser
       
   639 //
       
   640 
       
   641 CMsvOperationParser* CMsvOperationParser::NewL(CMsvClientTest& aMsvClientTest)
       
   642 	{
       
   643 	CMsvOperationParser* self = new (ELeave) CMsvOperationParser(aMsvClientTest);
       
   644 	CleanupStack::PushL(self);
       
   645 	self->ConstructL();
       
   646 	CleanupStack::Pop(self);
       
   647 	return self;
       
   648 	}
       
   649 
       
   650 void CMsvOperationParser::ProcessL()
       
   651 	{
       
   652 	if ((*iCurrentCommand) == KCommandMsvCopySelection)
       
   653 		{
       
   654 		CheckNumberOfArgumentsL(0);
       
   655 		iMsvClientTest.AddStateL(new (ELeave) CCopySelection(iMsvClientTest), iDebugInfo);
       
   656 		}
       
   657 	else if ((*iCurrentCommand) == KCommandMsvMoveSelection)
       
   658 		{
       
   659 		CheckNumberOfArgumentsL(0);
       
   660 		iMsvClientTest.AddStateL(new (ELeave) CMoveSelection(iMsvClientTest), iDebugInfo);
       
   661 		}
       
   662 	else if ((*iCurrentCommand) == KCommandMsvDeleteSelection)
       
   663 		{
       
   664 		CheckNumberOfArgumentsL(0);
       
   665 		iMsvClientTest.AddStateL(new (ELeave) CDeleteSelection(iMsvClientTest), iDebugInfo);
       
   666 		}
       
   667 	else if ((*iCurrentCommand) == KCommandDeleteChildren)
       
   668 		{
       
   669 		CheckNumberOfArgumentsL(1);
       
   670 		// Get the index of the Selected Entry to Test
       
   671 		TLex lex((*iArgumentList)[0]);
       
   672 		TInt selectedIndex;
       
   673 		User::LeaveIfError(lex.Val(selectedIndex));
       
   674 
       
   675 		iMsvClientTest.AddStateL(new (ELeave) CDeleteChildren(iMsvClientTest, selectedIndex), iDebugInfo);
       
   676 		}
       
   677 	else
       
   678 		{
       
   679 		User::Leave(KErrNotFound);
       
   680 		}
       
   681 	}
       
   682 
       
   683 void CMsvOperationParser::ConstructL()
       
   684 	{
       
   685 	CBaseCommandParser::ConstructL();
       
   686 	AddCommandL(KCommandMsvCopySelection);
       
   687 	AddCommandL(KCommandMsvMoveSelection);
       
   688 	AddCommandL(KCommandMsvDeleteSelection);
       
   689 	AddCommandL(KCommandDeleteChildren);
       
   690 	}
       
   691 
       
   692 CMsvOperationParser::CMsvOperationParser(CMsvClientTest& aMsvClientTest) : iMsvClientTest(aMsvClientTest)
       
   693 	{
       
   694 	}
       
   695 
       
   696 
       
   697 
       
   698 
       
   699 
       
   700 //
       
   701 //
       
   702 // CEmailServiceSectionParser
       
   703 //
       
   704 
       
   705 
       
   706 CEmailServiceSectionParser::~CEmailServiceSectionParser()
       
   707 	{
       
   708 	}
       
   709 
       
   710 void CEmailServiceSectionParser::LogComment(const TDesC& aComment)
       
   711 	{
       
   712 	iTestHarness.EmailTestUtils().WriteComment(aComment);
       
   713 	}
       
   714 
       
   715 void CEmailServiceSectionParser::ConstructL(const TDesC& /* aSectionName */, CCreateEmailService& aCreateServiceState)
       
   716 	{
       
   717 	// Set up the command parser that will add the IAP details to the state created above
       
   718 	AddCommandParserL(CEmailServiceCommands::NewL(aCreateServiceState));
       
   719 	}
       
   720 
       
   721 CEmailServiceSectionParser::CEmailServiceSectionParser(CTestScript& aScript, CEmailClientTest& aTestHarness) : CBaseSectionParser(aScript), iTestHarness(aTestHarness)
       
   722 	{
       
   723 	}
       
   724 
       
   725 
       
   726 
       
   727 //
       
   728 //
       
   729 // CEmailServiceCommands
       
   730 //
       
   731 
       
   732 TInt CEmailServiceCommands::FindIAPByNameL()
       
   733 	{
       
   734 	TInt found=KErrNotFound;
       
   735 
       
   736 	CMDBSession* dbSession = CMDBSession::NewL(CMDBSession::LatestVersion());
       
   737 	CleanupStack::PushL(dbSession);
       
   738 	CCDIAPRecord *iapRecord = static_cast<CCDIAPRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
       
   739 	CleanupStack::PushL(iapRecord);
       
   740 	
       
   741 	iapRecord->iRecordName.SetMaxLengthL(((*iArgumentList)[0]).Length());
       
   742 	iapRecord->iRecordName = ((*iArgumentList)[0]);
       
   743 	if(iapRecord->FindL(*dbSession))
       
   744 		{
       
   745 		found = iapRecord->iRecordTag.RecordId();	
       
   746 		}	
       
   747 	else
       
   748 		{
       
   749 		User::Leave(KErrNotFound);	
       
   750 		}	
       
   751 		
       
   752 	CleanupStack::PopAndDestroy(2);//dbSession, iapRecord
       
   753 	return found;
       
   754 	}
       
   755 
       
   756 void CEmailServiceCommands::ProcessL()
       
   757 	{
       
   758 
       
   759 	if ((*iCurrentCommand) == KCommandEmailAddIAP)
       
   760 		{
       
   761 #ifndef _NO_IAP_PREFS
       
   762 // eh xxxx
       
   763 // Out of date code that needs updating.
       
   764 // The new code should set the iCreateEmailServiceState so that it creates the IAP preferences.
       
   765 // The CCreateEmailService state will need to be changed to support this
       
   766 /*
       
   767 		CheckNumberOfArgumentsL(1);
       
   768 		TImIAPChoice iap;
       
   769 		TLex lex((*iArgumentList)[0]);
       
   770 		User::LeaveIfError(lex.Val(iap.iIAP, EDecimal));
       
   771 		iap.iDialogPref = ECommDbDialogPrefDoNotPrompt;
       
   772 		CImIAPPreferences& iapPreferences = iIapDetails.IAPPreferences();
       
   773 		iapPreferences.AddIAPL(iap, iapPreferences.NumberOfIAPs());
       
   774 */
       
   775 #else // _NO_IAP_PREFS
       
   776 
       
   777 		CheckNumberOfArgumentsL(1);
       
   778 		TUint8 iap;
       
   779 		TLex lex((*iArgumentList)[0]);
       
   780 		User::LeaveIfError(lex.Val(iap, EDecimal));
       
   781 		iCreateEmailServiceState.Entry().iMtmData1 = iap;
       
   782 #endif
       
   783 		}
       
   784 	else if ((*iCurrentCommand) == KCommandEmailAddIAPByName)
       
   785 		{
       
   786 #ifndef _NO_IAP_PREFS
       
   787 		CheckNumberOfArgumentsL(1);
       
   788 		iCreateEmailServiceState.Entry().SetMtmData1(FindIAPByNameL());
       
   789 #endif
       
   790 		}
       
   791 	}
       
   792 
       
   793 CEmailServiceCommands* CEmailServiceCommands::NewL(CCreateEmailService& aCreateServiceState)
       
   794 	{
       
   795 	CEmailServiceCommands* self = new (ELeave) CEmailServiceCommands(aCreateServiceState);
       
   796 	CleanupStack::PushL(self);
       
   797 	self->ConstructL();
       
   798 	CleanupStack::Pop(self);
       
   799 	return self;
       
   800 	}
       
   801 
       
   802 void CEmailServiceCommands::ConstructL()
       
   803 	{
       
   804 	CBaseCommandParser::ConstructL();
       
   805 	AddCommandL(KCommandEmailAddIAP);
       
   806 	AddCommandL(KCommandEmailAddIAPByName);
       
   807 	}
       
   808 
       
   809 CEmailServiceCommands::CEmailServiceCommands(CCreateEmailService& aCreateServiceState) : iCreateEmailServiceState(aCreateServiceState)
       
   810 	{
       
   811 	}
       
   812 
       
   813 
       
   814 
       
   815 //
       
   816 //
       
   817 // CMsvTestEntryCommandParser
       
   818 //
       
   819 
       
   820 void CMsvTestEntryCommandParser::ProcessL()
       
   821 	{
       
   822 	if ((*iCurrentCommand) == KCommandTestEntryVisible)
       
   823 		{
       
   824 		iTestEntry.TestVisible(GetBooleanArgumentL());
       
   825 		}
       
   826 	else if ((*iCurrentCommand) == KCommandTestEntryComplete)
       
   827 		{
       
   828 		iTestEntry.TestComplete(GetBooleanArgumentL());
       
   829 		}
       
   830 	}
       
   831 
       
   832 CMsvTestEntryCommandParser* CMsvTestEntryCommandParser::NewL(CMsvTestEntry& aTestEntry)
       
   833 	{
       
   834 	CMsvTestEntryCommandParser* self = CMsvTestEntryCommandParser::NewL(aTestEntry);
       
   835 	CleanupStack::PushL(self);
       
   836 	self->ConstructL();
       
   837 	CleanupStack::Pop(self);
       
   838 	return self;
       
   839 	}
       
   840 
       
   841 void CMsvTestEntryCommandParser::ConstructL()
       
   842 	{
       
   843 	CBaseCommandParser::ConstructL();
       
   844 	AddCommandL(KCommandTestEntryVisible);
       
   845 	AddCommandL(KCommandTestEntryComplete);
       
   846 	}
       
   847 
       
   848 CMsvTestEntryCommandParser::CMsvTestEntryCommandParser(CMsvTestEntry& aTestEntry) : iTestEntry(aTestEntry)
       
   849 	{
       
   850 	}
       
   851 
       
   852 TBool CMsvTestEntryCommandParser::GetBooleanArgumentL()
       
   853 	{
       
   854 	TBool result = ETrue;
       
   855 
       
   856 	CheckNumberOfArgumentsL(1);
       
   857 	
       
   858 	if ((*iArgumentList)[0] == KParameterETrue)
       
   859 		{
       
   860 		result = ETrue;
       
   861 		}
       
   862 	else if ((*iArgumentList)[0] == KParameterEFalse)
       
   863 		{
       
   864 		result = EFalse;
       
   865 		}
       
   866 	else
       
   867 		{
       
   868 		User::Leave(KErrArgument);
       
   869 		}
       
   870 
       
   871 	return result;
       
   872 	}
       
   873 
       
   874 
       
   875 
       
   876 //
       
   877 //
       
   878 // CMsvTestEntrySectionParser
       
   879 //
       
   880 
       
   881 CMsvTestEntrySectionParser* CMsvTestEntrySectionParser::NewL(const TDesC& aSectionName, CTestScript& aScript, CMsvTestEntry& aTestState)
       
   882 	{
       
   883 	CMsvTestEntrySectionParser* self = new (ELeave) CMsvTestEntrySectionParser(aScript, aTestState);
       
   884 	CleanupStack::PushL(self);
       
   885 	self->ConstructL(aSectionName);
       
   886 	CleanupStack::Pop(self);
       
   887 	return self;
       
   888 	}
       
   889 
       
   890 CMsvTestEntrySectionParser::~CMsvTestEntrySectionParser()
       
   891 	{
       
   892 	}
       
   893 
       
   894 void CMsvTestEntrySectionParser::ConstructL(const TDesC& aSectionName)
       
   895 	{
       
   896 	CBaseSectionParser::ConstructL(aSectionName);
       
   897 	AddCommandParserL(CMsvTestEntryCommandParser::NewL(iTestState));
       
   898 	}
       
   899 
       
   900 CMsvTestEntrySectionParser::CMsvTestEntrySectionParser(CTestScript& aScript, CMsvTestEntry& aTestState) 
       
   901 : CBaseSectionParser(aScript),
       
   902   iTestState(aTestState)
       
   903 	{
       
   904 	}
       
   905 	
       
   906 void CMsvTestEntrySectionParser::LogComment(const TDesC& /*aComment*/)
       
   907 	{
       
   908 	// Log comment
       
   909 	}