//
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
//! @file

RUN_UTILS DeleteFile c:\messaging.db

LOAD_SUITE	T_MsgCommonServer  	-SharedData
LOAD_SUITE	T_MsgImapServer		-SharedData
LOAD_SUITE	T_MsgSmtpServer		-SharedData

START_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0012
//!	@SYMTestCaseID			MSG-IMAP-SYNC-NEW-INBOXEMAILS-0012
//!	@SYMTestCaseDesc		Verification:
//!					The test aims to verify the mails synced when the command KIMAP4MTMInboxNewSync is used, for multiple
//!					messages.Download is with IMAP4 KIMAP4MTMConnectAndPopulateNewMailAndDisconnect
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMPREQ 			1160
//!	@SYMREQ				REQ 5565
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			1. Startup test steps are called for the different servers to creates session,
//!					   IMAP MTM and SMTP MTM objects.
//!					2. Initialises the RAS connection
//!					3. Resets the message store to clean up the central repository
//!					4. Creates an IMAP account by reading the settings from the file mentioned
//!					   thus setting the IMAP and SMTP service settings
//!					5. Connects to the IMAP server and performs full sync with IMAP4 server.
//!					6. Deletes all mails in the Inbox on the server.
//!					7. Creates messages from RFC822 file and sends the messages to the same IMAP account.
//!					8. Sets the full download limits.Performs a full synchronisation.
//!					9. Connects to the IMAP server, performs a sync on the INBOX to sync new emails.
//!					10. Download the mails with IMAP4 KIMAP4MTMConnectAndPopulateNewMailAndDisconnect command
//!					   and compares the received messages with sent messages based on the Download limits set.
//!	@SYMTestExpectedResults		EPass,The messages are sent and received with the respective flags set.	
//!	@SYMAuthor			Kavyashree.D

PRINT Setup Begins #####################################################

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer	StartUp

RUN_TEST_STEP	100	T_MsgCommonServer  	InitNtRas			c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-InitNtRas
RUN_TEST_STEP	100	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-ResetMessageStore
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-SetImap4ServiceIdleParamters_Off
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0001-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CreateSmtpMessageFromEmailFile_12
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountOutbox_12
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-SendSmtpMessage_12
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CreateSmtpMessageFromEmailFile1_12
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountOutbox1_12
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-SendSmtpMessage1_12
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountSentItems1_12
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-ConnectImap4Server
//Sync New Mails
RUN_TEST_STEP	100	T_MsgImapServer		InboxNewEmailsSync		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-InboxNewEmailsSync
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CreateSmtpMessageFromEmailFile_12
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountOutbox_12
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-SendSmtpMessage_12
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CreateSmtpMessageFromEmailFile1_12
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountOutbox1_12
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-SendSmtpMessage1_12
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountSentItems2_12
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-ConnectImap4Server
//Sync New Mails
RUN_TEST_STEP	100	T_MsgImapServer		InboxNewEmailsSync		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-InboxNewEmailsSync
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-SetImap4FullDownloadLimits_12
RUN_TEST_STEP 	100 	T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-ImapInvokeAsyncFunction_12
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountRemoteInbox4_12
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountFlagBase1_12
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0001-CheckChildrenCountFlagBase2_12

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer	ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer	ShutDown

PRINT Execute Completed ###################################################
END_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0012


START_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0013
//!	@SYMTestCaseID			MSG-IMAP-SYNC-NEW-INBOXEMAILS-0013
//!	@SYMTestCaseDesc		Verification:
//!					The test aims to verify the mails synced when the command KIMAP4MTMInboxNewSync is used.
//!					with the update seen flag set to ETrue for a single message sent.
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMPREQ 			1160
//!	@SYMREQ				REQ 5565
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			1.Startup test steps are called for the different servers to create session,
//!					  IMAP MTM and SMTP MTM objects.
//!					2. Initialises the RAS connection
//!					3. Resets the message store to clean up the central repository
//!					4. Creates an IMAP account by reading the settings from the file mentioned
//!					   thus setting the IMAP and SMTP service settings
//!					5. Connects to the IMAP server and performs full sync with IMAP4 server.
//!					6. Connects to the IMAP server and deletes all mails in the Inbox on the server.
//!					7. Creates messages from RFC822 file and sends the messages to the same IMAP account.
//!					8. Sets the full download limits.
//!					9. Connects to the IMAP server, performs a sync on the INBOX to sync new emails.
//!					11.Download the mails with IMAP4 KIMAP4MTMPopulate command.
//!					   and compares the received messages with sent messages based on the Download limits set.
//!					12. Sets the full download limits, with the update flag set to ETrue
//!					    ETrue if the seen flag is to be set on the IMAP4 server 
//!					    during synchronisation only when the message has been marked as read.
//!					13.Sets the message unread flag to ETrue.
//!					14.Performs a syncon INBOX.
//!					12.Verifies if the seen flag of the message is set after the sync.
//!	@SYMTestExpectedResults		EPass,The message is sent and received.The seen flag is set after the message is synced.	
//!	@SYMAuthor			Kavyashree.D

PRINT Setup Begins #####################################################

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer	StartUp

RUN_TEST_STEP	100	T_MsgCommonServer  	InitNtRas			c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-InitNtRas
RUN_TEST_STEP	100	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-ResetMessageStore
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-SetImap4ServiceIdleParamters_Off
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0002-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-CreateSmtpMessageFromEmailFile_13
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-CheckChildrenCountOutbox_13
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-SendSmtpMessage_13
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-CheckChildrenCountSentItems1_13
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-SetImap4FullDownloadLimits0_13
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-ConnectImap4Server
//Sync New Mails
RUN_TEST_STEP	100	T_MsgImapServer		InboxNewEmailsSync		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-InboxNewEmailsSync
RUN_TEST_STEP 	100 	T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-ImapInvokeAsyncFunction_13
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-SetImap4FullDownloadLimits1_13
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-ConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		SetUnReadFlag			c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-SetUnReadFlag_13
//Sync New Mails
RUN_TEST_STEP	100	T_MsgImapServer		InboxNewEmailsSync		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-InboxNewEmailsSync
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-DisConnectImap4Server
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-CheckChildrenCountRemoteInbox4_13
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0002-CheckChildrenCountFlagBase1_13

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer	ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer	ShutDown

PRINT Execute Completed ###################################################
END_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0013


START_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0014
//!	@SYMTestCaseID			MSG-IMAP-SYNC-NEW-INBOXEMAILS-0014
//!	@SYMTestCaseDesc		Verification:
//!					The test aims to verify the mails synced when the command KIMAP4MTMInboxNewSync is used.
//!					when the update seen flag is set to ETrue, for multiple messages sent.
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMPREQ 			1160
//!	@SYMREQ				REQ 5565
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			1. Startup test steps are called for the different servers to creates session,
//!					   IMAP MTM and SMTP MTM objects.
//!					2. Initialises the RAS connection
//!					3. Resets the message store to clean up the central repository
//!					4. Creates an IMAP account by reading the settings from the file mentioned
//!					   thus setting the IMAP and SMTP service settings
//!					5. Connects to the IMAP server and performs full sync with IMAP4 server.
//!					6. Deletes all mails in the Inbox on the server.
//!					7. Creates messages from RFC822 file and sends the messages to the same IMAP account.
//!					8. Sets the full download limits.Performs a full synchronisation.
//!					9. Connects to the IMAP server, performs a sync on the INBOX to sync new emails.
//!					10. Download the mails with IMAP4 KIMAP4MTMPopulate command.
//!					    and compares the received messages with sent messages based on the Download limits set.
//!					11. Verify if the seen flag of the message is set after download.
//!	@SYMTestExpectedResults		EPass,The messages sent are received.The seen flag is set after the messages are downloaded.	
//!	@SYMAuthor			Kavyashree.D

PRINT Setup Begins #####################################################

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer	StartUp

RUN_TEST_STEP	100	T_MsgCommonServer  	InitNtRas			c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-InitNtRas
RUN_TEST_STEP	100	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-ResetMessageStore
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-SetImap4ServiceIdleParamters_Off
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0003-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-CreateSmtpMessageFromEmailFile_14
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-SendSmtpMessage_14
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-CreateSmtpMessageFromEmailFile1_14
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-SendSmtpMessage1_14
RUN_TEST_STEP 	100 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-CheckChildrenCountSentItems_14
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-SetImap4FullDownloadLimits_14
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-ConnectImap4Server
//Sync New Mails
RUN_TEST_STEP	100	T_MsgImapServer		InboxNewEmailsSync		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-InboxNewEmailsSync
RUN_TEST_STEP  	100 	T_MsgImapServer		ImapInvokeAsyncFunction		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-ImapInvokeAsyncFunction_14
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-DoFullImap4Synchronisation
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-CheckChildrenCountFlagBase_14
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0003-DisConnectImap4Server

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer	ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer	ShutDown

PRINT Execute Completed ###################################################
END_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0014


START_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0015
//!	@SYMTestCaseID			MSG-IMAP-SYNC-NEW-INBOXEMAILS-0015
//!	@SYMTestCaseDesc		Verification:
//!					The test aims to check whether the seen flag is set when the messages are synced and not read.
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMPREQ 			1160
//!	@SYMREQ				REQ 5565
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			1. Startup test steps are called for the different servers to creates session,
//!					   IMAP MTM and SMTP MTM objects.
//!					2. Initialises the RAS connection
//!					3. Resets the message store to clean up the central repository
//!					4. Creates an IMAP account by reading the settings from the file mentioned
//!					   thus setting the IMAP and SMTP service settings
//!					5. Connects to the IMAP server and performs full sync with IMAP4 server.
//!					6. Deletes all mails in the Inbox on the server.
//!					7. Creates messages from RFC822 file and sends the messages to the same IMAP account.
//!					8. Sets the full download limits.Performs a synchronisation on the INBOX.
//!					9. Connects to the IMAP server, performs a sync on the INBOX to sync new emails.
//!					10. Verifies of the seen flag of the message is not set after download.
//!	@SYMTestExpectedResults		Epass, The seen flag is not set when the messages are just synced.	
//!	@SYMAuthor			Kavyashree.D

PRINT Setup Begins #####################################################

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer	StartUp

RUN_TEST_STEP	100	T_MsgCommonServer  	InitNtRas			c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-InitNtRas
RUN_TEST_STEP	100	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-ResetMessageStore
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-SetImap4ServiceIdleParamters_Off
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0004-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-CreateSmtpMessageFromEmailFile_15
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-CheckChildrenCountOutbox_15
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-SendSmtpMessage_15
RUN_TEST_STEP 	100 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-CheckChildrenCountSentItems1_15
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-SetImap4FullDownloadLimits_15
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-ConnectImap4Server
//Sync New Mails
RUN_TEST_STEP	100	T_MsgImapServer		InboxNewEmailsSync		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-InboxNewEmailsSync
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-DisConnectImap4Server
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-CheckChildrenCountRemoteInbox4_15
RUN_TEST_STEP   100 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0004-CheckChildrenCountFlagBase1_15

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer	ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer	ShutDown

PRINT Execute Completed ###################################################
END_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0015


START_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0016
//!	@SYMTestCaseID			MSG-IMAP-SYNC-NEW-INBOXEMAILS-0016
//!	@SYMTestCaseDesc		Negative:
//!					The test aims to verify the mails synced when the command KIMAP4MTMInboxNewSync is used.
//!					when an INVAILD search String is given.
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMPREQ 			1160
//!	@SYMREQ				REQ 5565
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			1.Startup test steps are called for the different servers to create session,
//!					  IMAP MTM and SMTP MTM objects.
//!					2.Initialises the RAS connection.
//!					3.Resets the message store and central repository to default state.
//!					4.Creates an IMAP account by reading the settings from the file mentioned in the 
//!					  ini config file thus setting the IMAP and SMTP service settings.
//!					5. Connects to the IMAP server and performs full sync with IMAP4 server.
//!					6. Deletes all mails in the Inbox of the IMAP server.
//!					7. Connects to the server.
//!					8. Creates a message from RFC822 file and sends the message to the IMAP account.
//!					9. Sets the full download limits, with an INVALID Search String specified for INBOX.
//!					10. Connects to the IMAP server, performs a full synchronisation.
//!					11. Verifies the count of the messages received in INBOX.
//!					12. Shutdown test steps are called to destroy the session, IMAP and SMTP MTM objects.
//!	@SYMTestExpectedResults		EPass, No message is synced, due to the INVALID Search String specified.
//!	@SYMAuthor			Kavyashree.D

PRINT Setup Begins #####################################################

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer	StartUp

RUN_TEST_STEP	100	T_MsgCommonServer  	InitNtRas			c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-InitNtRas
RUN_TEST_STEP	100	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-ResetMessageStore
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-SetImap4ServiceIdleParamters_Off
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0005-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	100 	T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-CreateSmtpMessageFromEmailFile_16
RUN_TEST_STEP 	100 	T_MsgSmtpServer    	SendSmtpMessage			c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-SendSmtpMessage_16
RUN_TEST_STEP 	100 	T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-CreateSmtpMessageFromEmailFile1_16
RUN_TEST_STEP 	100 	T_MsgSmtpServer    	SendSmtpMessage			c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-SendSmtpMessage1_16
// Set the download limits with an INVALID Search String specified.
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits	c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-SetImap4FullDownloadLimits_16
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-ConnectImap4Server
//Sync New Mails
RUN_TEST_STEP 	100 	T_MsgImapServer		InboxNewEmailsSync		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-InboxNewEmailsSync
// NO mails are synced, due to the INVALID Search String Specified.
RUN_TEST_STEP_RESULT 106 100 T_MsgImapServer	CheckChildrenCountImap		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-CheckChildrenCountRemoteInbox1_16
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini    		0005-DisConnectImap4Server

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer	ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer	ShutDown

PRINT Execute Completed ###################################################
END_TESTCASE	MSG-IMAP-SYNC-NEW-INBOXEMAILS-0016


START_TESTCASE	MSG-IMAP-CancelBkgroundSync-0001
//!	@SYMTestCaseID			MSG-IMAP-CancelBkgroundSync-0001
//!	@SYMTestCaseDesc		Verification test:
//!					This testcase  shall test the the cancel banckground synchronisation command
//!					while the client is recieving bulk emails. Here the inbox is mailbox that is 
//!					to recieve bulk emails.
//!
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!     @SYMREQ                         5559 Cancel Background Synchronisation
//!     @SYMPREQ                        1160
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialises the RAS connection
//!					Resets the message store to clean up the central repository

//!					We Initialise the RAS connection
//!					We reset the message store to clean up the central repository
//!					We create an IMAP account by reading the settings from the file mentioned
//!					Thus setting the IMAP and SMTP service settings.
//!					We connect to the IMAP server and initialise the account deleting all
//!				        user created mailboxes and emails.
//! 					we delete all mails in the inbox.
//!					We create bulk smtp messages within the outbox (Total 350 mails) .
//! 					We send these bulk smtp email messages created to the account
//!					and disconnect form the service. 
//!					End of set up actions: 
//!					We connect to the IMAP server and perform a background synchronisation with it. Using 
//!					KIMAP4MTMConnectAndSynchronise. We cancel this synchronisation 
//!					using KIMAP4MTMCancelBackgroundSynchronise	
//!
//!	@SYMTestExpectedResults		EPass-The local inbox should not contain the total number of emails 
//!					sent in bulk during set up.   
//!   
//!					
//!	@SYMAuthor			Rehana Anwar

PRINT Setup begins #############################################################################

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer	StartUp

RUN_TEST_STEP	300	T_MsgCommonServer  InitNtRas c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0006-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0006-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0006-CreateImapAccount 
//RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-ChangeImapSettings1
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0006-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-InitialiseImap4Account
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-DoFullImap4Synchronisation
PRINT Disconnecting from imap service
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0006-DisConnectImap4Server
PRINT Create and send bulk emails (Total 70)
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini     0006-bulk repeat
PRINT Create mutiple emails
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile7 
//PRINT Send bulk emails to account.
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-SendSmtpMessage1 
PRINT EMAIL : SENT
END_REPEAT
PRINT Create and send bulk emails (Total 70)
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini     0006-bulk repeat
PRINT Create mutiple emails
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile7 
//PRINT Send bulk emails to account.
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-SendSmtpMessage1 
PRINT EMAIL : SENT
END_REPEAT
PRINT Create and send bulk emails (Total 70)
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini     0006-bulk repeat
PRINT Create mutiple emails
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile7 
//PRINT Send bulk emails to account.
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-SendSmtpMessage1 
PRINT EMAIL: SENT
END_REPEAT
PRINT Create and send bulk emails (Total 70)
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini    0006- bulk repeat
PRINT Create mutiple emails
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile7 
//PRINT Send bulk emails to account.
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-SendSmtpMessage1 
PRINT EMAIL : SENT
END_REPEAT
PRINT Create and send bulk emails (Total 70)
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini     0006-bulk repeat
PRINT Create mutiple emails
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-CreateSmtpMessageFromEmailFile7 
//PRINT Send bulk emails to account.
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-SendSmtpMessage1 
PRINT EMAIL : SENT
END_REPEAT
PRINT Setup Completed ######################################################################################
PRINT Execute begin
PRINT Connect & sync and wait for bkground sync to complete
RUN_TEST_STEP 	500 	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0006-ConnectAndSyncImapServer
//count inbox children ensure inbox it contains less than 350 emails
RUN_TEST_STEP 300   T_MsgImapServer  CheckChildrenCountImap c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	   0006-CheckChildrenCountImap
PRINT Disconnecting from imap service
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0006-DisConnectImap4Server

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer	ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer	ShutDown

PRINT Execute Completed ###################################################
END_TESTCASE	MSG-IMAP-CancelBkgroundSync-0001


START_TESTCASE	MSG-IMAP-CancelBkgroundSync-0002
//!	@SYMTestCaseID			MSG-IMAP-CancelBkgroundSync-0002
//!	@SYMTestCaseDesc		Verification test:
//!					This testcase  shall test the the cancel banckground synchronisation command
//!					while the client is recieving bulk emails. Here the inbox is mailbox that is 
//!					to recieve bulk emails, and the drafts mailbox is to contain bulk emails.
//!					
//!
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!     @SYMREQ                         5559 Cancel Background Synchronisation
//!     @SYMPREQ                        1160
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialises the RAS connection
//!					Resets the message store to clean up the central repository
//!					Creates an IMAP account by reading the settings from the file mentioned
//!					thus setting the IMAP and SMTP service settings
//!					Connects to the IMAP server and checks if connected, then disconnects from the
//!                                      Start of set up actions: 
//!					We Initialise the RAS connection
//!					We reset the message store to clean up the central repository
//!					We create an IMAP account by reading the settings from the file mentioned
//!					Thus setting the IMAP and SMTP service settings.
//!					We connect to the IMAP server and initialise the account deleting all
//!				        user created mailboxes and emails.
//!					We subscribe to the remote mirror drafts folder and update subscription list 
//!					and synchronise the account.
//!					We create and send mutiple emails to the inbox ( 140 in total).
//!					We copy all mails from the inbox into drafts folder.
//!					We create bulk smtp messages within the outbox (Total 140 mails) .
//! 					We send these bulk smtp email messages created to the account
//!					and disconnect form the service. 
//!					End of set up actions: 
//!					We connect to the IMAP server and perform a background synchronisation with it. Using 
//!					KIMAP4MTMConnectAndSynchronise. We cancel this synchronisation 
//!					using KIMAP4MTMCancelBackgroundSynchronise	
//!
//!	@SYMTestExpectedResults		EPass-The local drafts folder should not contain
//!					the total number of messages copied remotely during set up
//!					( if background sync has successfully cancelled)   
//!					
//!	@SYMAuthor			Rehana Anwar

PRINT Setup Begins #####################################################

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer	StartUp

RUN_TEST_STEP	300	T_MsgCommonServer  InitNtRas c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-CreateImapAccount 
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-ChangeImapSettings1
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-InitialiseImap4Account
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-DisConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-ChangeImapSettings2
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-DoFullImap4Synchronisation
//create and send mutiple bulk (140) emails to inbox #####################################################
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini     0007-bulk repeat
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile7 
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-SendSmtpMessage1 
PRINT EMAIL : SENT
END_REPEAT
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini     0007-bulk repeat
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile7 
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-SendSmtpMessage1 
PRINT EMAIL : SENT
END_REPEAT
//copy messages in from inbox to drafts folder 
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder	        c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-SubscribeImapFolder
RUN_TEST_STEP  	300 	T_MsgImapServer		CopyImapSelectionRemote		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-CopyImapSelectionRemote
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-DoFullImap4Synchronisation
//create and send mutiple bulk (70) emails to inbox ##############################################################
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini     0007-bulk repeat
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile7 
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-SendSmtpMessage1 
PRINT EMAIL : SENT
END_REPEAT
//create and send mutiple bulk (70) emails to inbox ##############################################################
START_REPEAT c:\msgtest\email\imap\sync\msg-imap-sync3.ini     0007-bulk repeat
PRINT EMAIL 1: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile1 
PRINT EMAIL 2: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile2 
PRINT EMAIL 3: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile3 
PRINT EMAIL 4: CREATING
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile4 
PRINT EMAIL 5: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile5
PRINT EMAIL 6: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile6  
PRINT EMAIL 7: CREATING 
RUN_TEST_STEP 300 T_MsgSmtpServer CreateSmtpMessageFromEmailFile c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-CreateSmtpMessageFromEmailFile7 
//Send emails created
RUN_TEST_STEP 300 T_MsgSmtpServer SendSmtpMessage c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-SendSmtpMessage1 
PRINT EMAIL : SENT
END_REPEAT
PRINT Disconnecting from imap service
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-DisConnectImap4Server
PRINT Setup Completed ################################################
PRINT Execute begin ###################################################
PRINT Connect & sync and wait for bkground sync to complete
RUN_TEST_STEP 	500 	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0007-ConnectAndSyncImapServer
//count drafts children ensure drafts it contains less than 140 emails
RUN_TEST_STEP 300   T_MsgImapServer  CheckChildrenCountImap c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	   0007-CheckChildrenCountImap2
PRINT Disconnecting from imap service
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0007-DisConnectImap4Server

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer	ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer	ShutDown

PRINT Execute Completed ###################################################
END_TESTCASE	MSG-IMAP-CancelBkgroundSync-0002


START_TESTCASE	MSG-IMAP-CancelBkgroundSync-0003
//!	@SYMTestCaseID			MSG-IMAP-CancelBkgroundSync-0003
//!	@SYMTestCaseDesc		Verification test:
//!					This testcase  shall test the the cancel banckground synchronisation command
//!					A drafts folder will be created, and all folders in account will be subscribed to.
//!					In this case both the inbox and drafts folders are empty.
//!					
//!
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!     @SYMREQ                         5559 Cancel Background Synchronisation
//!     @SYMPREQ                        1160
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			
//!                                     Start of set up actions: 
//!					We Initialise the RAS connection
//!					We reset the message store to clean up the central repository
//!					We create an IMAP account by reading the settings from the file mentioned
//!					Thus setting the IMAP and SMTP service settings.
//!					We connect to the IMAP server and initialise the account deleting all
//!				        user created mailboxes and emails.
//!					We subscribe to the remote mirror drafts folder  and synchronise the
//!					account,
//!					and disconnect form the service. 
//!					End of set up actions: 
//!					We connect to the IMAP server and perform a background synchronisation with it. Using 
//!					KIMAP4MTMConnectAndSynchronise. We cancel this synchronisation 
//!					using KIMAP4MTMCancelBackgroundSynchronise	
//!
//!	@SYMTestExpectedResults		EPass-KIMAP4MTMCancelBackgroundSynchronise should successfully cancel, 
//!					both folders should be empty
//!					
//!	@SYMAuthor			Rehana Anwar

PRINT Setup begins ##########################################

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp
RUN_TEST_STEP	300	T_MsgSmtpServer	StartUp

RUN_TEST_STEP	300	T_MsgCommonServer  InitNtRas c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-CreateImapAccount 
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0008-ChangeImapSettings1
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0008-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0008-InitialiseImap4Account
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0008-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-DisConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0008-ChangeImapSettings2
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0008-DoFullImap4Synchronisation
//copy messages in from inbox to drafts folder
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder			c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-SubscribeImapFolder
PRINT Disconnecting from imap service
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-DisConnectImap4Server
PRINT Setup Completed ########################################
PRINT Execute begin #########################################
PRINT Connect & sync and wait for bkground sync to complete & cancel bk sync
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	0008-ConnectAndSyncImapServer
//count inbox children ensure inbox & ensure it is empty
RUN_TEST_STEP 300   T_MsgImapServer  CheckChildrenCountImap c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	   0008-CheckChildrenCountImap1
//count drafts children ensure drafts & ensure it is empty
RUN_TEST_STEP 300   T_MsgImapServer  CheckChildrenCountImap c:\msgtest\email\imap\sync\msg-imap-sync3.ini   	   0008-CheckChildrenCountImap2
PRINT Disconnecting from imap service
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\sync\msg-imap-sync3.ini   		0008-DisConnectImap4Server

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer	ShutDown
RUN_TEST_STEP	300	T_MsgSmtpServer	ShutDown

PRINT Execute Completed ###################################################
END_TESTCASE	MSG-IMAP-CancelBkgroundSync-0003


