//
// 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-MIGRATION1-0001

//! @SYMTestCaseID	MSG-IMAP-MIGRATION1-0001
//! @SYMTestCaseDesc	Positive: Successful bearer upgrade (at KMobilityTestMtmStateImapIdle) during IMAP IDLE state.
//! @SYMTestPriority	Critical
//! @SYMTestType	CIT
//! @SYMPREQ 		1307
//! @SYMREQ		6989, 6991, 6992
//! @SYMTestStatus	Implemented
//! @SYMTestCaseDependencies	requires comms database timeouts to allow imap idle.
//! @SYMTestActions	1.	Reset Message Store and Central Repository to default state.
//!			2.	Create an IMAP account and specify that it does support idle.
//!			3.	Connect to IMAP4 service and initialise account on remote IMAP4 server to default clean state
//!			4.	Disconnect the account.
//! @SYMTestExpectedResults	Bearer migration should occur when idle state is reached. Event handler check is successful.

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

RUN_TEST_STEP	300	T_MsgCommonServer  	StartUp
RUN_TEST_STEP	300	T_MsgImapServer	StartUp

RUN_TEST_STEP	20	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0001-InitNtRas
RUN_TEST_STEP	20	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0001-ResetMessageStore
RUN_TEST_STEP	20	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0001-CreateImapAccount_A
RUN_TEST_STEP	20	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0001-ChangeImapSettings_A
// Turn ON idle for account A
RUN_TEST_STEP 	20 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0001-SetImap4ServiceIdleParameters_A

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapIdle
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapIdle_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP	200	T_MsgImapServer		ConnectAndSyncImapServer	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0001-ConnectAndSyncImapServer_A
DELAY 1000
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP	20	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0001-DisConnectImap4Server_A

RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
RUN_TEST_STEP	300	T_MsgImapServer		ShutDown

PRINT Execute Completed ################################################

END_TESTCASE	MSG-IMAP-MIGRATION1-0001


START_TESTCASE MSG-IMAP-MIGRATION1-0002
//!	@SYMTestCaseID		MSG-IMAP-MIGRATION1-0002
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyFromLocal1 state.
//!	@SYMTestPriority	Critical
//!   	@SYMTestType		CIT
//!	@SYMPREQ 		1307
//!	@SYMREQ			6989, 6991, 6992
//!  	@SYMTestStatus		Implemented
//!
//!	@SYMComponent 		IMAP Protocol Controller 
//!				
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions		1.	Initialise the RAS connection
//!				2. 	Reset Message Store and Central Repository to default state
//!				3. 	Create an IMAP account by reading the settings from the file
//!				4. 	Connect to IMAP4 server
//!				5. 	Initialise IMAP account on remote IMAP4 server to the default clean state.
//!				6. 	Do perform full sync
//!				7. 	Disconnect IMAP4 server
//!				8. 	Create two SMTP Messages and then send it to server
//!				9. 	Connect to IMAP4 server
//!				10.	Invoke the IMAP4 client MTM copy command(KIMAP4MTMCopyMailSelectionWhenAlreadyConnected) to copy from local inbox to remote drafts
//!				11. 	Disconnect IMAP4 server
//!
//! @SYMTestExpectedResults	Bearer migration should occur when first copy from local state is reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini            0002-InitNtRas
RUN_TEST_STEP 300 T_MsgCommonServer 	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-ResetMessageStore
RUN_TEST_STEP 300 T_MsgImapServer	CreateImapAccount		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-CreateImapAccount
RUN_TEST_STEP 300 T_MsgImapServer	ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-ChangeSubAndSyncSettings
RUN_TEST_STEP 300 T_MsgImapServer	ConnectAndSyncImapServer	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-ConnectAndSyncImapServer
RUN_TEST_STEP 300 T_MsgImapServer	InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-InitialiseImap4Account
RUN_TEST_STEP 300 T_MsgImapServer	SubscribeImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-SubscribeImapFolder_Drafts
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-DisConnectImap4Server
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 300 T_MsgImapServer	SetImap4PartialDownloadLimits	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-SetImap4PartialDownloadLimits
RUN_TEST_STEP 300 T_MsgImapServer	ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-ConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-DoFullImap4Synchronisation

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyFromLocal1
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyFromLocal1_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 300 T_MsgImapServer	Imap4CopyAsyncFunction		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-Imap4CopyAsyncFunction
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-DisConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0002-CheckChildrenCountRemoteDrafts

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-MIGRATION1-0002


START_TESTCASE MSG-IMAP-MIGRATION1-0003
//!	@SYMTestCaseID		MSG-IMAP-MIGRATION1-0003
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapDeleteFolder4, KMobilityTestMtmStateImapCopyFromLocal2 state.
//!
//!	General descriptions: 
//!	=============================
//!		A client should be able to copy any message, or a selection of messages, from an IMAP service to 
//!	the local device or from the local device to the remote service, by invoking client MTM command
//!
//!	Client MTM Command:
//!	===========================
//!				KIMAP4MTMCopyMailSelectionWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyMailSelectionAndDisconnect
//!				KIMAP4MTMConnectAndCopyMailSelectionAndStayOnline
//!				KIMAP4MTMCopyNewMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyNewMailAndStayOnline
//!				KIMAP4MTMConnectAndCopyNewMailAndDisconnect
//!				KIMAP4MTMCopyAllMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyAllMailAndStayOnline
//!				KIMAP4MTMConnectAndCopyAllMailAndDisconnect
//!
//!	@SYMTestPriority	Critical
//!   	@SYMTestType		CIT
//!  	@SYMTestStatus		Implemented
//!  	
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!
//!	@SYMAPI 		CMsvEntrySelection::AppendL()
//!				CMsvEntrySelection::ResizeL()
//!				CMsvEntrySelection::InsertL()
//!				CImap4ClientMtm::InvokeAsyncFunctionL()
//!					
//!	@SYMComponent 		IMAP Protocol Controller 
//!				
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions		1.	Initialise the RAS connection
//!				2. 	Reset Message Store and Central Repository to default state
//!				3. 	Create an IMAP account by reading the settings from the file
//!				4. 	Connect to IMAP4 server
//!				5. 	Initialise IMAP account on remote IMAP4 server to the default clean state.
//!				6. 	Do perform full sync
//!				7. 	Disconnect IMAP4 server
//!				8. 	Create two SMTP Messages and then send it to server
//!				9.	Invoke the IMAP4 client MTM copy command(KIMAP4MTMConnectAndCopyMailSelectionAndDisconnect) to copy from local inbox to remote drafts
//!
//! @SYMTestExpectedResults	Bearer migration should occur when fourth delete folder state and second copy from local state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini            0003-InitNtRas
RUN_TEST_STEP 300 T_MsgCommonServer 	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-ResetMessageStore
RUN_TEST_STEP 300 T_MsgImapServer	CreateImapAccount		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-CreateImapAccount
RUN_TEST_STEP 300 T_MsgImapServer	ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-ChangeSubAndSyncSettings
RUN_TEST_STEP 300 T_MsgImapServer	ConnectAndSyncImapServer	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-ConnectAndSyncImapServer

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapDeleteFolder4
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapDeleteFolder4_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 300 T_MsgImapServer	InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-InitialiseImap4Account
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 300 T_MsgImapServer	SubscribeImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-SubscribeImapFolder_Drafts
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-DisConnectImap4Server
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 300 T_MsgImapServer	SetImap4PartialDownloadLimits	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-SetImap4PartialDownloadLimits
RUN_TEST_STEP 300 T_MsgImapServer	ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-ConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-DisConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyFromLocal2
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyFromLocal2_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 300 T_MsgImapServer	Imap4CopyAsyncFunction		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-Imap4CopyAsyncFunction
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0003-CheckChildrenCountRemoteDrafts

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-MIGRATION1-0003


START_TESTCASE MSG-IMAP-MIGRATION1-0004
//!	@SYMTestCaseID		MSG-IMAP-MIGRATION1-0004
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyFromLocal3 state.
//!
//!	General descriptions: 
//!	=============================
//!		A client should be able to copy any message, or a selection of messages, from an IMAP service to 
//!	the local device or from the local device to the remote service, by invoking client MTM command
//!
//!	Client MTM Command:
//!	===========================
//!				KIMAP4MTMCopyMailSelectionWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyMailSelectionAndDisconnect
//!				KIMAP4MTMConnectAndCopyMailSelectionAndStayOnline
//!				KIMAP4MTMCopyNewMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyNewMailAndStayOnline
//!				KIMAP4MTMConnectAndCopyNewMailAndDisconnect
//!				KIMAP4MTMCopyAllMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyAllMailAndStayOnline
//!				KIMAP4MTMConnectAndCopyAllMailAndDisconnect
//!
//!	@SYMTestPriority	Critical
//!   	@SYMTestType		CIT
//!  	@SYMTestStatus		Implemented
//!  	
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!
//!	@SYMAPI 		CMsvEntrySelection::AppendL()
//!				CMsvEntrySelection::ResizeL()
//!				CMsvEntrySelection::InsertL()
//!				CImap4ClientMtm::InvokeAsyncFunctionL()
//!					
//!	@SYMComponent 		IMAP Protocol Controller 
//!				
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions		1.	Initialise the RAS connection
//!				2. 	Reset Message Store and Central Repository to default state
//!				3. 	Create an IMAP account by reading the settings from the file
//!				4. 	Connect to IMAP4 server
//!				5. 	Initialise IMAP account on remote IMAP4 server to the default clean state.
//!				6. 	Do perform full sync
//!				7. 	Disconnect IMAP4 server
//!				8. 	Create two SMTP Messages and then send it to server
//!				9.	Invoke the IMAP4 client MTM copy command(KIMAP4MTMConnectAndCopyMailSelectionAndStayOnline) to copy from local inbox to remote drafts
//!				10. 	Disconnect IMAP4 server
//!
//! @SYMTestExpectedResults	Bearer migration should occur when third copy from local state reached. Event handler check is successful.
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992

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\migration\msg-imap-migration1.ini            0004-InitNtRas
RUN_TEST_STEP 300 T_MsgCommonServer 	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-ResetMessageStore
RUN_TEST_STEP 300 T_MsgImapServer	CreateImapAccount		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-CreateImapAccount
RUN_TEST_STEP 300 T_MsgImapServer	ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-ChangeSubAndSyncSettings
RUN_TEST_STEP 300 T_MsgImapServer	ConnectAndSyncImapServer	c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-ConnectAndSyncImapServer
RUN_TEST_STEP 300 T_MsgImapServer	InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-InitialiseImap4Account
RUN_TEST_STEP 300 T_MsgImapServer	SubscribeImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-SubscribeImapFolder_Drafts
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-DisConnectImap4Server
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 300 T_MsgImapServer	SetImap4PartialDownloadLimits	c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-SetImap4PartialDownloadLimits
RUN_TEST_STEP 300 T_MsgImapServer	ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-ConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-DisConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyFromLocal3
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyFromLocal3_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 300 T_MsgImapServer	Imap4CopyAsyncFunction		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-Imap4CopyAsyncFunction
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-CheckChildrenCountRemoteDrafts
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini             0004-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-MIGRATION1-0004


START_TESTCASE	MSG-IMAP-MIGRATION1-0005
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0005
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmImapSyncEInboxSync, KMobilityTestMtmImapSyncESyncTree, KMobilityTestMtmStateImapCopyToLocal1 state.
//!					from the RFC822 file and sends the message to the same account.
//!					Downloads the mails with IMAP4 KIMAP4MTMConnectAndPopulateAllMailAndStayOnline 
//!					command and Compares the received messages with sent messages based on the 
//!					Download limits set.It then checks the count of the messages based on the various flags set.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!  	@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 performs full sync with IMAP4 server.
//!					Connects to the IMAP server and deletes all mails in the Inbox on the server.
//!					Creates messages from RFC822 file and sends the messages to the same IMAP account.
//!					Sets the full download limits.
//!					Download the mails with IMAP4 KIMAP4MTMConnectAndPopulateAllMailAndStayOnline command
//!					and compares the received messages with sent messages based on the Download limits set.
//! @SYMTestExpectedResults	Bearer migration should occur when syncing the inbox and folder tree and the first copy from local state reached. Event handler check is successful.


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\migration\msg-imap-migration1.ini        	0005-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		DeleteAllImapChildren 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-DeleteAllImapChildren
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-DisConnectImap4Server
PRINT Setup Completed
PRINT Execute begins
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountOutbox1
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-SendSmtpMessage1
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountSentItems1
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-ConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmImapSyncEInboxSync
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapSyncEInboxSync_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-DoFullImap4Synchronisation
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountOutbox1
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-SendSmtpMessage1
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountSentItems2
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-ConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmImapSyncESyncTree
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapSyncESyncTree_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-DoFullImap4Synchronisation
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-SetImap4FullDownloadLimits

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyToLocal1
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyToLocal1_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 	T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-ImapInvokeAsyncFunction
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountRemoteInbox4
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountFlagBase1
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0005-CheckChildrenCountFlagBase2
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.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-MIGRATION1-0005


START_TESTCASE	MSG-IMAP-MIGRATION1-0006
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0006
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmImapSyncESyncSubscriptions, KMobilityTestMtmStateImapCopyToLocal2 state.
//!					Downloads the mails with IMAP4 KIMAP4MTMConnectAndPopulateNewMailAndDisConnect
//!					command and Compares the received messages with sent messages based on the 
//!					Download limits set.It then checks the count of the messages based on the various flags set.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!  	@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 performs full sync with IMAP4 server.
//!					Connects to the IMAP server and deletes all mails in the Inbox on the server.
//!					Creates messages from RFC822 file and sends the messages to the same IMAP account.
//!					Sets the full download limits.
//!					Download the mails with IMAP4 KIMAP4MTMConnectAndPopulateNewMailAndDisConnect command
//!					and compares the received messages with sent messages based on the Download limits set.
//! @SYMTestExpectedResults	Bearer migration should occur when syncing subscriptions and second copy from local state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini        	0006-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		DeleteAllImapChildren 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-DeleteAllImapChildren
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-DisConnectImap4Server
PRINT Setup Completed
PRINT Execute begins
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountOutbox1
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-SendSmtpMessage1
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountSentItems1
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-ConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmImapSyncESyncSubscriptions
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapSyncESyncSubscriptions_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-DoFullImap4Synchronisation
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountOutbox1
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-SendSmtpMessage1
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountSentItems2
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-SetImap4FullDownloadLimits

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyToLocal2
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyToLocal2_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 	T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-ImapInvokeAsyncFunction
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountRemoteInbox4
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountFlagBase1
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountFlagBase	c:\msgtest\email\imap\migration\msg-imap-migration1.ini        	0006-CheckChildrenCountFlagBase2

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-MIGRATION1-0006


START_TESTCASE MSG-IMAP-MIGRATION1-0007
//!	@SYMTestCaseID		MSG-IMAP-MIGRATION1-0007
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyToLocal3 state.
//!
//!	General descriptions: 
//!	=============================
//!		A client should be able to copy any message, or a selection of messages, from an IMAP service to 
//!	the local device or from the local device to the remote service, by invoking client MTM command
//!
//!	Client MTM Command:
//!	===========================
//!				KIMAP4MTMCopyMailSelectionWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyMailSelectionAndDisconnect
//!				KIMAP4MTMConnectAndCopyMailSelectionAndStayOnline
//!				KIMAP4MTMCopyNewMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyNewMailAndStayOnline
//!				KIMAP4MTMConnectAndCopyNewMailAndDisconnect
//!				KIMAP4MTMCopyAllMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndCopyAllMailAndStayOnline
//!				KIMAP4MTMConnectAndCopyAllMailAndDisconnect
//!
//!	@SYMTestPriority	Critical
//!   	@SYMTestType		CIT
//!  	@SYMTestStatus		Implemented
//!  	
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!
//!	@SYMAPI 		CMsvEntrySelection::AppendL()
//!				CMsvEntrySelection::ResizeL()
//!				CMsvEntrySelection::InsertL()
//!				CImap4ClientMtm::InvokeAsyncFunctionL()
//!					
//!	@SYMComponent 		IMAP Protocol Controller 
//!				
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions		1.	Initialise the RAS connection
//!				2. 	Reset Message Store and Central Repository to default state
//!				3. 	Create an IMAP account by reading the settings from the file
//!				4. 	Connect to IMAP4 server
//!				5. 	Initialise IMAP account on remote IMAP4 server to the default clean state.
//!				6. 	Do perform full sync
//!				7. 	Disconnect IMAP4 server
//!				8. 	Create two SMTP Messages and then send it to server
//!				10.	Invoke the IMAP4 client MTM copy command(KIMAP4MTMConnectAndCopyAllMailAndDisconnect) to copy from remote inbox to local drafts
//!
//! @SYMTestExpectedResults	Bearer migration should occur when second copy to local state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini            0007-InitNtRas
RUN_TEST_STEP 300 T_MsgCommonServer 	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-ResetMessageStore
RUN_TEST_STEP 300 T_MsgImapServer	CreateImapAccount		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-CreateImapAccount
RUN_TEST_STEP 300 T_MsgImapServer	ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-ChangeSubAndSyncSettings
RUN_TEST_STEP 300 T_MsgImapServer	ConnectAndSyncImapServer	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-ConnectAndSyncImapServer
RUN_TEST_STEP 300 T_MsgImapServer	InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-InitialiseImap4Account
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-DisConnectImap4Server
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	SendSmtpMessage			c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-SendSmtpMessage_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 300 T_MsgSmtpServer    	SendSmtpMessage			c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-SendSmtpMessage_2
RUN_TEST_STEP 300 T_MsgImapServer	SetImap4PartialDownloadLimits	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-SetImap4PartialDownloadLimits
RUN_TEST_STEP 300 T_MsgImapServer	ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-ConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-DisConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyToLocal3
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyToLocal3_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 300 T_MsgImapServer	Imap4CopyAsyncFunction		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-Imap4CopyAsyncFunction
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 300 T_MsgCommonServer 	CheckChildrenCount		c:\msgtest\email\imap\migration\msg-imap-migration1.ini            0007-CheckChildrenCountDrafts

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-MIGRATION1-0007


START_TESTCASE	MSG-IMAP-MIGRATION1-0008
//!	@SYMTestCaseID		MSG-IMAP-MIGRATION1-0008
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyToLocal4 state.
//!
//!	@SYMTestPriority	Critical
//!   	@SYMTestType		CIT
//!  	@SYMTestStatus		Implemented 
//!
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!
//!	@SYMAPI 		CMsvEntry::MoveL()
//!					
//!	@SYMComponent 		IMAP Protocol Controller 
//!				
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions		1. 	Initialise the RAS connection
//!				2. 	Reset Message Store and Central Repository to default state
//!				3. 	Create an IMAP account by reading the settings from the file
//!				4. 	Connect to the IMAP4 server 
//!				5. 	Initialise IMAP account on remote IMAP4 server to the default clean state and then perform full sync 
//!				6. 	Disconnect IMAP4 server
//!				7. 	Create a message and send the message to account
//!				8. 	Connect to IMAP4 server using account settings
//!				9. 	Move this message from the remote inbox to local drafts folder
//!				10.	Confirm that the message has been deleted from the remote inbox
//!				11.	Confirm if the message has moved to the local drafts folder
//!				12.	Disconnect IMAP4 Server
//!
//! @SYMTestExpectedResults	Bearer migration should occur when fourth copy to local state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini		0008-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-ChangeSubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-ConnectAndSyncImapServer
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-InitialiseImap4Account
RUN_TEST_STEP  	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-DoFullImap4Synchronisation

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyToLocal4
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyToLocal4_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 	T_MsgImapServer		MoveMessage			c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-MoveMessage
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-CheckChildrenCountRemoteInboxAfterMoveMsg
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0008-CheckChildrenCountDrafts
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.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-MIGRATION1-0008


START_TESTCASE	MSG-IMAP-MIGRATION1-0009
//!	@SYMTestCaseID		MSG-IMAP-MIGRATION1-0009
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyToLocal6, KMobilityTestMtmStateImapCopyToLocal7 state.
//!
//!	@SYMTestPriority	Critical
//!   	@SYMTestType		CIT
//!  	@SYMTestStatus		Implemented 
//!
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!
//!	@SYMAPI 		CMsvEntry::MoveL()
//!					
//!	@SYMComponent 		IMAP Protocol Controller 
//!				
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions		1. 	Initialise the RAS connection
//!				2. 	Reset Message Store and Central Repository to default state
//!				3. 	Create an IMAP account by reading the settings from the file
//!				4. 	Connect to the IMAP4 server
//!				5. 	Initialise IMAP account on remote IMAP4 server to the default clean state and then perform full sync 
//!				6. 	Disconnect IMAP4 server
//!				7. 	Create two messages and send the messages to account
//!				8. 	Connect to IMAP4 server using account settings
//!				9. 	Move these messages from the remote inbox to local drafts folder
//!				10.	Disconnect IMAP4 Server
//!
//! @SYMTestExpectedResults	Bearer migration should occur when sixth and seventh copy to local state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini		0009-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-ChangeSubAndSyncSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-ConnectAndSyncImapServer
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CheckChildrenCountSentItems
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CheckChildrenCountOutbox1
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-SendSmtpMessage1
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CheckChildrenCountSentItems1
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-DoFullImap4Synchronisation

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyToLocal6
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyToLocal6_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 	T_MsgImapServer		MoveMessage			c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-MoveMessage
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyToLocal7
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyToLocal7_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 	T_MsgImapServer		MoveMessage			c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-MoveMessage1
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CheckChildrenCountRemoteInboxAfterMoveMsg
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-CheckChildrenCountDrafts
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		0009-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-MIGRATION1-0009



START_TESTCASE	MSG-IMAP-MIGRATION1-0010
//!	@SYMTestCaseID				MSG-IMAP-MIGRATION1-0010
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyWithinService1 state.
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using settings from a configuration file.
//!								3.	Connect to IMAP4 service using Account Settings and initialise account on remote IMAP4 server to default clean state.
//!								4.	Create remote root-level folder with multiple messages.
//!								5.	Delete the folder created in step 4.
//!								6.	Check if the folder created in step 4 is removed with all its contents deleted.
//!								7.	Disconnect from IMAP4 service.
//!
//! @SYMTestExpectedResults	Bearer migration should occur when first copy within service state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini  	0010-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-ResetMessageStore
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-ChangeImapSettings
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CheckChildrenCountRemoteInbox
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-DisConnectImap4Server
PRINT Setup Completed ##################################################
PRINT Sub-Setup Begins #################################################
//Following set of test steps create multiple messages from file and send it using SMTP to remote INBOX
RUN_TEST_STEP 	300 T_MsgImapServer		SetImap4FullDownloadLimits 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-SetImap4FullDownloadLimits
//Sending first message
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-SendSmtpMessage1
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-ConnectAndSyncImapServer
RUN_TEST_STEP 	300 T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-DisConnectImap4Server
//Sending second message
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-SendSmtpMessage2
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-ConnectAndSyncImapServer
RUN_TEST_STEP 	300 T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-DisConnectImap4Server
//ConnectAndPopulateAllMailAndStayOnline
RUN_TEST_STEP 	300 T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-ImapInvokeAsyncFunction
RUN_TEST_STEP  	300 T_MsgImapServer		CheckChildrenCountImap 			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP 	300 T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-DisConnectImap4Server
PRINT Sub-Setup Completed ##############################################
PRINT Execute Begins ###################################################
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		CreateImap4Folder				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CreateFolder
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-FindEntryByName

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyWithinService1
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyWithinService1_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 T_MsgImapServer		CopyImapSelectionRemote			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CopyImapSelectionRemote
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-CheckChildrenCountImap
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-DisConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		DeleteImap4Folder				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-DeleteFolder
RUN_TEST_STEP	!Error=-1	300	T_MsgImapServer		FindEntryByName			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-FindEntryByName
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0010-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-MIGRATION1-0010


START_TESTCASE	MSG-IMAP-MIGRATION1-0011
//!	@SYMTestCaseID				MSG-IMAP-MIGRATION1-0011
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyWithinService2, KMobilityTestMtmStateImapCopyWithinService5 state.
//!	@SYMTestPriority			Critical
//!	@SYMTestType				CIT
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions				1.	Reset Message Store and Central Repository to default state.
//!								2.	Create IMAP account in Central Repository using settings from a configuration file.
//!								3.	Connect to IMAP4 service using Account Settings and initialise account on remote IMAP4 server to default clean state.
//!								4.	Create remote root-level folder with multiple messages.
//!								5.	Create sub folder under the folder created in step 4 with multiple messages. 
//!								6.	Delete the folder created in step 4.
//!								7.	If IMAP4 server responds OK/NO then check if the folder created in step 4 still exists, but all its contents deleted 
//!									and that the sub folder with all its messages still exists.
//!								8.	Disconnect from IMAP4 service.
//!								
//! @SYMTestExpectedResults	Bearer migration should occur when second and fifth copy within service state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini  	0011-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ResetMessageStore
RUN_TEST_STEP	300	T_MsgImapServer		CreateImapAccount				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CreateImapAccount
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ChangeImapSettings1
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		InitialiseImap4Account			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CheckChildrenCountRemoteInbox
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DisConnectImap4Server
PRINT Setup Completed ##################################################
PRINT Sub-Setup Begins #################################################
//Following set of test steps create multiple messages from file and send it using SMTP to remote INBOX
RUN_TEST_STEP 	300 T_MsgImapServer		SetImap4FullDownloadLimits 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-SetImap4FullDownloadLimits
//Sending first message
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-SendSmtpMessage1
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ConnectAndSyncImapServer
RUN_TEST_STEP 	300 T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DisConnectImap4Server
//Sending second message
RUN_TEST_STEP 	300 T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 T_MsgCommonServer  	CheckChildrenCount 				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 T_MsgSmtpServer		SendSmtpMessage 				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-SendSmtpMessage2
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ConnectAndSyncImapServer
RUN_TEST_STEP 	300 T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DisConnectImap4Server
//ConnectAndPopulateAllMailAndStayOnline
RUN_TEST_STEP 	300 T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ImapInvokeAsyncFunction
RUN_TEST_STEP  	300 T_MsgImapServer		CheckChildrenCountImap 			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP 	300 T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DisConnectImap4Server
PRINT Sub-Setup Completed ##############################################
PRINT Execute Begins ###################################################
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		CreateImap4Folder				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CreateFolder1
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-FindEntryByName1

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyWithinService2
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyWithinService2_CarrierUpgrade
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 T_MsgImapServer		CopyImapSelectionRemote			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CopyImapSelectionRemote1
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CheckChildrenCountTargetFolder1
RUN_TEST_STEP	300	T_MsgImapServer		CreateImap4Folder				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CreateFolder2
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-FindEntryByName2

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyWithinService5
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyWithinService5_CarrierUpgrade
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 T_MsgImapServer		CopyImapSelectionRemote			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CopyImapSelectionRemote2
//RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CheckChildrenCountTargetFolder2
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DisConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		DeleteImap4Folder				c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DeleteFolder
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-FindEntryByName1
RUN_TEST_STEP	300	T_MsgImapServer		FindEntryByName					c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-FindEntryByName2
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DisConnectImap4Server
// Need to subscribe to sub folder for its contents to be synchronised!
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ChangeImapSettings2
RUN_TEST_STEP	300	T_MsgImapServer		ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-ConnectAndSyncImapServer
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-SubscribeImap4Folder1
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-SubscribeImap4Folder2
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CheckChildrenCountTargetFolder1a
RUN_TEST_STEP	300	T_MsgImapServer		CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-CheckChildrenCountTargetFolder2
RUN_TEST_STEP	300	T_MsgImapServer		DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini  	0011-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-MIGRATION1-0011


START_TESTCASE	MSG-IMAP-MIGRATION1-0012
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0012
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyWithinService6, KMobilityTestMtmStateImapDelete5 state.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialise the RAS connection
//!					Reset the message store to clean up the central repository
//!					Create an IMAP account by reading the settings from the file mentioned
//!					thus setting the IMAP and SMTP service settings
//!					Connect to the IMAP server and performs full sync with IMAP4 server.
//!					Initialises Imap Account
//!					Create messages from RFC822 file and sends the messages to the same IMAP account.
//!					Set the full download limits.
//!					Download Limits:
//!						MaxEmailSize = Default( KMaxInt)
//!						ImapMailOption = TImap4GetMailOptions::EGetImap4EmailBodyTextAndAttachments
//!					DoFullSynchronisation
//!					Disconnect
//!					Now Move the mails to "Drafts"
//!					Connect
//!					Download the mails with IMAP4 KIMAP4MTMConnectAndPopulateAllMailAndStayOnline command
//!					and compares the received messages with sent messages based on the Download limits set.
//!					Delete the (1) message from the specified folder(Drafts)
//!					Do Full synchronisation
//!					Check the message is deleted from the "Drafts" folder.
//!					Disconnect from the Server
//! @SYMTestExpectedResults	Bearer migration should occur when sixth copy within service and fifth delete state reached. Event handler check is successful.
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
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\migration\msg-imap-migration1.ini           		0012-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-CheckChildrenCountRemoteInbox
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-SubscribeImapFolder_Drafts
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DisConnectImap4Server
PRINT Setup Completed
PRINT Execute begins
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DisConnectImap4Server
//Moving Message to Drafts folder
RUN_TEST_STEP  	300 	T_MsgImapServer		MoveMessage	 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-MoveMessage
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-ConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyWithinService6
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyWithinService6_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DoFullImap4Synchronisation
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-ImapInvokeAsyncFunction
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-CheckChildrenCountRemoteDrafts1
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-CheckChildrenCountRemoteInbox
//Deleting Message from Drafts folder

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapDelete5
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapDelete5_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 	T_MsgImapServer		DeleteMessage			c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DeleteMessage
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DoFullImap4Synchronisation
//Chking whether the message is being deleted
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-CheckChildrenCountRemoteDrafts0
RUN_TEST_STEP	300	T_MsgImapServer		UnsubscribeImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-UnsubscribeImapFolder_Drafts
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0012-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-MIGRATION1-0012


START_TESTCASE MSG-IMAP-MIGRATION1-0013
//!	@SYMTestCaseID		MSG-IMAP-MIGRATION1-0013
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyWithinService7 state.
//!
//!	General descriptions: 
//!	=============================
//!		A client should be able to move any message, or a selection of messages, from an IMAP service to 
//!	the local device or from the local device to the remote service, by invoking client MTM command
//!
//!	Client MTM Command:
//!	===========================
//!				KIMAP4MTMMoveMailSelectionWhenAlreadyConnected
//!				KIMAP4MTMConnectAndMoveMailSelectionAndDisconnect
//!				KIMAP4MTMConnectAndMoveMailSelectionAndStayOnline
//!				KIMAP4MTMMoveNewMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndMoveNewMailAndStayOnline
//!				KIMAP4MTMConnectAndMoveNewMailAndDisconnect
//!				KIMAP4MTMMoveAllMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndMoveAllMailAndStayOnline
//!				KIMAP4MTMConnectAndMoveAllMailAndDisconnect
//!
//!	@SYMTestPriority	Critical
//!   	@SYMTestType		CIT
//!  	@SYMTestStatus		Implemented
//!				
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!
//!	@SYMAPI 		CMsvEntrySelection::AppendL()
//!				CMsvEntrySelection::ResizeL()
//!				CMsvEntrySelection::InsertL()
//!				CImap4ClientMtm::InvokeAsyncFunctionL()
//!					
//!	@SYMComponent 		IMAP Protocol Controller 
//!				
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions		1. 	Initialise the RAS connection
//!				2. 	Reset Message Store and Central Repository to default state
//!				3. 	Create an IMAP account by reading the settings from the file
//!				4. 	Connect to IMAP4 server using Account Settings and then Sycronises IMAP account
//!				5. 	Initialise IMAP account on remote IMAP4 server to the default clean state.
//!				6. 	Synchronise IMAP account
//!				7. 	Disconnect IMAP4 server
//!				8. 	Create two SMTP Messages and send it to server
//!				9.	Invoke the IMAP4 client MTM move command(KIMAP4MTMConnectAndMoveMailSelectionAndDisconnect) to 
//!					move from remote inbox to remote drafts
//!
//! @SYMTestExpectedResults	Bearer migration should occur when seventh copy within service state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini   0013-InitNtRas
RUN_TEST_STEP 300 T_MsgCommonServer 	ResetMessageStore			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-ResetMessageStore
RUN_TEST_STEP 300 T_MsgImapServer	CreateImapAccount			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-CreateImapAccount
RUN_TEST_STEP 300 T_MsgImapServer	ChangeImap4SubAndSyncSettings		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-ChangeSubAndSyncSettings
RUN_TEST_STEP 300 T_MsgImapServer	ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-ConnectAndSyncImapServer
RUN_TEST_STEP 300 T_MsgImapServer	InitialiseImap4Account			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-InitialiseImap4Account
RUN_TEST_STEP 300 T_MsgImapServer	SubscribeImap4Folder			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-SubscribeImapFolder_Drafts
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-DisConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	SendSmtpMessage				c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-SendSmtpMessage_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 300 T_MsgSmtpServer    	SendSmtpMessage				c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-SendSmtpMessage_2
RUN_TEST_STEP 300 T_MsgImapServer	SetImap4PartialDownloadLimits		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-SetImap4PartialDownloadLimits
RUN_TEST_STEP 300 T_MsgImapServer	ConnectImap4Server			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-ConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-DisConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyWithinService7
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyWithinService7_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 300 T_MsgImapServer	Imap4MoveAsyncFunction			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-Imap4MoveAsyncFunction
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0013-CheckChildrenCountRemoteDrafts

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-MIGRATION1-0013


START_TESTCASE MSG-IMAP-MIGRATION1-0014
//!	@SYMTestCaseID		MSG-IMAP-MIGRATION1-0014
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCopyWithinService state.
//!
//!	General descriptions: 
//!	=============================
//!		A client should be able to move any message, or a selection of messages, from an IMAP service to 
//!	the local device or from the local device to the remote service, by invoking client MTM command
//!
//!	Client MTM Command:
//!	===========================
//!				KIMAP4MTMMoveMailSelectionWhenAlreadyConnected
//!				KIMAP4MTMConnectAndMoveMailSelectionAndDisconnect
//!				KIMAP4MTMConnectAndMoveMailSelectionAndStayOnline
//!				KIMAP4MTMMoveNewMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndMoveNewMailAndStayOnline
//!				KIMAP4MTMConnectAndMoveNewMailAndDisconnect
//!				KIMAP4MTMMoveAllMailWhenAlreadyConnected
//!				KIMAP4MTMConnectAndMoveAllMailAndStayOnline
//!				KIMAP4MTMConnectAndMoveAllMailAndDisconnect
//!
//!	@SYMTestPriority	Critical
//!   	@SYMTestType		CIT
//!  	@SYMTestStatus		Implemented
//!				
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!
//!	@SYMAPI 		CMsvEntrySelection::AppendL()
//!				CMsvEntrySelection::ResizeL()
//!				CMsvEntrySelection::InsertL()
//!				CImap4ClientMtm::InvokeAsyncFunctionL()
//!					
//!	@SYMComponent 		IMAP Protocol Controller 
//!				
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions		1. 	Initialise the RAS connection
//!				2. 	Reset Message Store and Central Repository to default state
//!				3. 	Create an IMAP account by reading the settings from the file
//!				4. 	Connect to IMAP4 server using Account Settings and then Sycronises IMAP account
//!				5. 	Initialise IMAP account on remote IMAP4 server to the default clean state.
//!				6. 	Synchronise IMAP account
//!				7. 	Disconnect IMAP4 server
//!				8. 	Create two SMTP Messages and send it to server
//!				9. 	Connect to IMAP4 server
//!				10.	Invoke the IMAP4 client MTM move command(KIMAP4MTMConnectAndMoveMailSelectionAndStayOnline) to 
//!					move from remote inbox to remote drafts
//!				11.	Disconnect IMAP4 server
//!
//! @SYMTestExpectedResults	Bearer migration should occur when eighth copy within service state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini   0014-InitNtRas
RUN_TEST_STEP 300 T_MsgCommonServer 	ResetMessageStore			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-ResetMessageStore
RUN_TEST_STEP 300 T_MsgImapServer	CreateImapAccount			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-CreateImapAccount
RUN_TEST_STEP 300 T_MsgImapServer	ChangeImap4SubAndSyncSettings		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-ChangeSubAndSyncSettings
RUN_TEST_STEP 300 T_MsgImapServer	ConnectAndSyncImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-ConnectAndSyncImapServer
RUN_TEST_STEP 300 T_MsgImapServer	InitialiseImap4Account			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-InitialiseImap4Account
RUN_TEST_STEP 300 T_MsgImapServer	SubscribeImap4Folder			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-SubscribeImapFolder_Drafts
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-DisConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	SendSmtpMessage				c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-SendSmtpMessage_1
RUN_TEST_STEP 300 T_MsgSmtpServer    	CreateSmtpMessageFromEmailFile		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 300 T_MsgSmtpServer    	SendSmtpMessage				c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-SendSmtpMessage_2
RUN_TEST_STEP 300 T_MsgImapServer	SetImap4PartialDownloadLimits		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-SetImap4PartialDownloadLimits
RUN_TEST_STEP 300 T_MsgImapServer	ConnectImap4Server			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-ConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-DisConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCopyWithinService8
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCopyWithinService8_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 300 T_MsgImapServer	Imap4MoveAsyncFunction			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-Imap4MoveAsyncFunction
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-CheckChildrenCountRemoteDrafts
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   0014-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-MIGRATION1-0014


START_TESTCASE	MSG-IMAP-MIGRATION1-0015
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0015
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapCreateFolder state.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!	@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 performs full sync with IMAP4 server.
//!					Connects to the IMAP server and deletes all mails in the Inbox on the server.
//!					Disconnect from the IMAP Service.
//!
//!
//! @SYMTestExpectedResults	Bearer migration should occur when create folder state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini 		0015-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		DeleteAllImapChildren 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-DeleteAllImapChildren
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-DisConnectImap4Server
PRINT Setup Completed
PRINT Execute begins
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-CheckChildrenCountRemoteInbox

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapCreateFolder
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapCreateFolder_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-CreateImap4Folder
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 	300 	T_MsgImapServer  	CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-CheckChildrenCountRemoteInbox1
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0015-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-MIGRATION1-0015


START_TESTCASE	MSG-IMAP-MIGRATION1-0017
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0017
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapDelete2 state.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialise the RAS connection
//!					Reset the message store to clean up the central repository
//!					Create an IMAP account by reading the settings from the file mentioned
//!					thus setting the IMAP and SMTP service settings
//!					Connect to the IMAP server and performs full sync with IMAP4 server.
//!					Initialises Imap account
//!					Create messages from RFC822 file and sends the messages to the same IMAP account.
//!					Set the full download limits.
//!					Download Limits:
//!						MaxEmailSize = Default( KMaxInt)
//!						ImapMailOption = TImap4GetMailOptions::EGetImap4EmailBodyTextAndAttachments
//!					DoFullSynchronisation
//!					Delete the (1) message from specified folder(Inbox)
//!					Do Full synchronisation
//!					Check the message is deleted from the Inbox.
//!					Disconnect from the Server
//! @SYMTestExpectedResults	Bearer migration should occur when second delete state reached. Event handler check is successful.
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992

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\migration\msg-imap-migration1.ini           		0017-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-DisConnectImap4Server
PRINT Setup Completed
PRINT Execute begins
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-CheckChildrenCountOutbox
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-ImapInvokeAsyncFunction
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-CheckChildrenCountRemoteInbox1

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapDelete2
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapDelete2_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
//Deleting Message
RUN_TEST_STEP 	300 	T_MsgImapServer		DeleteMessage			c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-DeleteMessage
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-DoFullImap4Synchronisation
//Check the Messages are deleted
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0017-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-MIGRATION1-0017


START_TESTCASE	MSG-IMAP-MIGRATION1-0018
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0018
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapDelete4 state.
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialise the RAS connection
//!					Reset the message store to clean up the central repository
//!					Create an IMAP account
//!					Connect to the IMAP server 
//!					Perform full sync with IMAP4 server.
//!					Initialises Imap Account
//!					Disconnect
//!					Create multiple messages from RFC822 file and sends the messages to the same IMAP account.
//!					Set the full download limits.
//!					Download Limits:
//!						MaxEmailSize = Default( KMaxInt)
//!						ImapMailOption = TImap4GetMailOptions::EGetImap4EmailBodyTextAndAttachments
//!					Connect to the Imap Server
//!					Download the mails
//!					Check the Children Count on Imap remote Folder
//!					Delete (5) Messages from specified Folder(Inbox)
//!					Do full Synchronisation
//!					Check the messages are deleted from Inbox.
//! @SYMTestExpectedResults	Bearer migration should occur when fourth delete state reached. Event handler check is successful.
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992

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\migration\msg-imap-migration1.ini           		0018-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-DisConnectImap4Server
PRINT Setup Completed
PRINT Execute begins
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CreateSmtpMessageFromEmailFile0
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CreateSmtpMessageFromEmailFile3
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CreateSmtpMessageFromEmailFile4
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CheckChildrenCountOutbox5
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-DoFullImap4Synchronisation
RUN_TEST_STEP	300	T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-ImapInvokeAsyncFunction
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CheckChildrenCountRemoteInbox5
//Deleting Messages

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapDelete4
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapDelete4_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP  	300 	T_MsgImapServer		DeleteAllImapChildren 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-DeleteAllImapChildren
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-DoFullImap4Synchronisation
//Chking if the messages are deleted
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini           		0018-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-MIGRATION1-0018


START_TESTCASE	MSG-IMAP-MIGRATION1-0019
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0019
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapDeleteFolder1 state.
//!					
//!					
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialises 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 set the IMAP service parameters.
//!					The IMAP service parameters are set as follows: IsImapIdleSelected is set as EFALSE,
//!					ImapIdleTimeout is NOT SET, and ImapSyncRate is NOT SET.
//!					We connect to the IMAP server and initialise the account deleting all
//!				        user created mailboxes and emails.
//!					We create mutiple smtp messages within the outbox.
//!					and disconnect form the service. 
//!					End of set up actions:
//!					
//!					We connect to the IMAP server and perform a full imap synchronisation with it. Using 
//!					KIMAP4MTMConnect and KIMAP4MTMFullSync.
//!					We set up the observer on the inbox, and send the messages created in set up. 
//!					We confirm if client has been notified of new mail and count them via the observer,
//!				        We remove this observer.
//!					We disconnect from the IMAP service. 		
//!
//! @SYMTestExpectedResults	Bearer migration should occur when first delete folder state reached. Event handler check is successful.
//!                                    
//!					
//!					

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\migration\msg-imap-migration1.ini 		0019-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0019-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0019-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\migration\msg-imap-migration1.ini      0019-SetImap4ServiceIdleParamters 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0019-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 	0019-DoFullImap4Synchronisation

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapDeleteFolder1
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapDeleteFolder1_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 	0019-InitialiseImap4Account
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini 		0019-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-MIGRATION1-0019


START_TESTCASE	MSG-IMAP-MIGRATION1-0020
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0020
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapDeleteFolder2 state.
//!					
//!					
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialises 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 set the IMAP service parameters.
//!					The IMAP service parameters are set as follows: IsImapIdleSelected is set as EFALSE,
//!					ImapIdleTimeout is NOT SET, and ImapSyncRate is NOT SET.
//!					We connect to the IMAP server and initialise the account deleting all
//!				        user created mailboxes and emails.
//!					We create mutiple smtp messages within the outbox (7 IN TOTAL).
//!					We send these messages created.
//!					and disconnect form the service. 
//!					End of set up actions:
//!					
//!					We connect to the IMAP server and perform a full imap synchronisation with it. Using 
//!					KIMAP4MTMConnect and KIMAP4MTMFullSync.
//!					We set up the observer on the inbox. 
//!					we confirm that the inbox contains 7 emails, sent during setup.
//!					We create mutiple smtp messages within the outbox (7 IN TOTAL).
//!					We send these messages created.
//!					we synchronise the account.
//!					We confirm if client has been notified of new mail and count them via the observer,
//!				        We remove this observer.We count all mail in the inbox.
//!					We disconnect from the IMAP service. 		
//!
//! @SYMTestExpectedResults	Bearer migration should occur when second delete folder state reached. Event handler check is successful.
//!                                    
//!					
//!					

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\migration\msg-imap-migration1.ini    		0020-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0020-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0020-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\migration\msg-imap-migration1.ini         0020-SetImap4ServiceIdleParamters 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0020-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    	0020-DoFullImap4Synchronisation

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapDeleteFolder2
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapDeleteFolder2_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    	0020-InitialiseImap4Account
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0020-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-MIGRATION1-0020  


START_TESTCASE	MSG-IMAP-MIGRATION1-0021
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0021
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapDeleteFolder3 state.
//!					
//!					
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialises 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 set the IMAP service parameters.
//!					The IMAP service parameters are set as follows: IsImapIdleSelected is set as EFALSE,
//!					ImapIdleTimeout is NOT SET, and ImapSyncRate is NOT SET.
//!					We connect to the IMAP server and initialise the account deleting all
//!				        user created mailboxes and emails.
//!					We create mutiple smtp messages within the outbox (7 IN TOTAL).
//!					We send these messages created.
//!					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 also wait for this background synchronisation to complete 
//!					using KIMAP4MTMWaitForBackground.
//!					we count the number of messages within the inbox
//!					we disconnect from the IMAP service.
//!					We connect to the IMAP server and perform a background synchronisation with it. Using 
//!					KIMAP4MTMConnectAndSynchronise.We also wait for this background synchronisation to complete 
//!					using KIMAP4MTMWaitForBackground.
//!					we count the number of messages within the inbox
//!					We set up the observer on the inbox. 
//!					we confirm that the inbox contains 7 emails, sent during setup.
//!					We create mutiple smtp messages within the outbox (7 IN TOTAL).
//!					We send these messages created.
//!					we synchronise the account.
//!					We confirm if client has been notified of new mail and count them via the observer,
//!				        We remove this observer.We count all mail in the inbox.
//!					We disconnect from the IMAP service. 		
//!
//! @SYMTestExpectedResults	Bearer migration should occur when third delete folder state reached. Event handler check is successful.
//!                                    
//!					
//!					

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\migration\msg-imap-migration1.ini    		0021-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0021-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0021-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4ServiceIdleParamters	c:\msgtest\email\imap\migration\msg-imap-migration1.ini         0021-SetImap4ServiceIdleParamters 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0021-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    	0021-DoFullImap4Synchronisation

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapDeleteFolder3
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapDeleteFolder3_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    	0021-InitialiseImap4Account
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0021-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-MIGRATION1-0021


START_TESTCASE	MSG-IMAP-MIGRATION1-0023
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0023
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapSyncFolder1 state.
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!	@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.Creates a message from RFC822 file and sends the message to the same IMAP account.
//!					8.Sets the full download limits with the destination folder as INBOX.
//!					9.Connects to the IMAP server, performs a synchronisation on the INBOX.
//!					10.Verifies the count of the messages received in the Inbox.
//!					11.Shutdown test steps are called to destroy the session, IMAP and SMTP MTM objects.
//! @SYMTestExpectedResults	Bearer migration should occur when first sync folder state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini   		0023-InitNtRas
RUN_TEST_STEP	100	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-ResetMessageStore
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0023-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0023-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-CreateSmtpMessageFromEmailFile1_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-SendSmtpMessage1_1
RUN_TEST_STEP 	100 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-CheckChildrenCountSentItems_1
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-SetImap4FullDownloadLimits_1
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-DoFullImap4Synchronisation

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapSyncFolder1
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapSyncFolder1_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
// Sync on INBOX
RUN_TEST_STEP	100	T_MsgImapServer		Imap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-Imap4Synchronisation_1
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

// Verify if all the messages sent are synced
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-CheckChildrenCountRemoteInbox1_1
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0023-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-MIGRATION1-0023


START_TESTCASE	MSG-IMAP-MIGRATION1-0024
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0024
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmStateImapSyncFolder2 state.
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!	@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.Creates a message from RFC822 file and sends the message to the same IMAP account.
//!					8.Sets the full download limits.
//!					9.Connects to the IMAP server
//!					10.Performs a synchronisation.
//!					11.Downloads the mails.
//!					12.Copies the mails to the DRAFTS folder.
//!					13.DoFullSynchronisation on to delete mails on UnSubscribed folders(esp Draft in this case)
//!					14.Select Drafts Folder
//!					15.Synchronise with Selected Folder Using KIMAP4MTMSynchronise
//!					16.Verifies the count of the messages received in the DRAFTS.
//!					17.Shutdown test steps are called to destroy the session, IMAP and SMTP MTM objects.
//! @SYMTestExpectedResults	Bearer migration should occur when second sync folder state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini   		0024-InitNtRas
RUN_TEST_STEP	100	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-ResetMessageStore
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0024-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0024-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-CreateSmtpMessageFromEmailFile1_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-SendSmtpMessage1_2
RUN_TEST_STEP 	100 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-CheckChildrenCountSentItems_2
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-SetImap4FullDownloadLimits_2
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-DoFullImap4Synchronisation
RUN_TEST_STEP	100	T_MsgImapServer		ImapInvokeAsyncFunction		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-ImapInvokeAsyncFunction_2
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-ConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		CopyImapSelectionRemote		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-CopyImapSelectionRemote_2
//2 Messages are copied to Drafts folder
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0024-CheckChildrenCountRemoteDrafts_2
//Ensure that Messages in drafts is 0 as  a result of FULLSYNC.
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0024-CheckChildrenCountRemoteDrafts_20
//Select Drafts Folder
RUN_TEST_STEP 	100 	T_MsgImapServer		SelectImapFolder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-SelectImapFolder_2

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapSyncFolder2
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapSyncFolder2_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
//Synchronise to Ensure that Message in remote Folder is synced to Drafts
RUN_TEST_STEP	100	T_MsgImapServer		Imap4Synchronisation		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-Imap4Synchronisation_2
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

// Verify if all the messages sent are synced into DRAFTS
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-CheckChildrenCountRemoteDrafts_2
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0024-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-MIGRATION1-0024


START_TESTCASE	MSG-IMAP-MIGRATION1-0025
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0025
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmImapSyncEInboxEarlyDeletes state.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992
//!	@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.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, with the above flag disabled.
//!					9.Download the mails with IMAP4 KIMAP4MTMConnectAndPopulateAllMailAndStayOnline command
//!					  and compares the received messages with sent messages based on the Download limits set.
//!					10.Disconnect from the server
//!					11.Delete the message.
//!					12.Connect to the Imap Server.
//!					13.Do Full synchronisation.
//!					14.Disconnect from the Server.
//!					15.Verify if the mesage has been deleted.
//!					16.Shutdown test steps are called to destroy the session, IMAP and SMTP MTM objects.
//! @SYMTestExpectedResults	Bearer migration should occur when early delete state reached. Event handler check is successful.

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\migration\msg-imap-migration1.ini   		0025-InitNtRas
RUN_TEST_STEP	100	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-ResetMessageStore
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-CreateImapAccount 
RUN_TEST_STEP 	100 	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini    		0025-ChangeSubAndSyncSettings
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-InitialiseImap4Account
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-DoFullImap4Synchronisation
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-CreateSmtpMessageFromEmailFile_20
RUN_TEST_STEP 	100 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-CheckChildrenCountOutbox_20
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-SendSmtpMessage_20
// Enable the flag KImap4EmailDeleteEmailsWhenDisconnecting 
RUN_TEST_STEP 	100 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-SetImap4FullDownloadLimits_20
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-DoFullImap4Synchronisation
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-DisConnectImap4Server
RUN_TEST_STEP 	100 	T_MsgImapServer		ImapInvokeAsyncFunction      	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-ImapInvokeAsyncFunction_20
RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-CheckChildrenCountRemoteInbox1_20
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-DisConnectImap4Server
// Mark the message for delete while offline
RUN_TEST_STEP 	100 	T_MsgImapServer		DeleteMessage			c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-DeleteMessage_20
RUN_TEST_STEP 	100 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-ConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmImapSyncEInboxEarlyDeletes
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapSyncEInboxEarlyDeletes_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-DoFullImap4Synchronisation
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP  	100 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-CheckChildrenCountRemoteInbox_20
RUN_TEST_STEP 	100 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini   		0025-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-MIGRATION1-0025


START_TESTCASE	MSG-IMAP-MIGRATION1-0026
//!	@SYMTestCaseID			MSG-IMAP-MIGRATION1-0026
//!	@SYMTestCaseDesc	Verification Test: Successful bearer upgrade at KMobilityTestMtmImapSyncESyncFolder, KMobilityTestMtmImapSyncEInboxEarlyExpunge, KMobilityTestMtmStateImapDelete1 state.
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			Initialise the RAS connection
//!					Reset the message store to clean up the central repository
//!					Create an IMAP account
//!					Connect to the IMAP server 
//!					Perform full sync with IMAP4 server.
//!					Initialises the Imap Account
//!					Create multiple messages from RFC822 file and sends the messages to the same IMAP account.
//!					Set the full download limits.
//!					Download Limits:
//!						MaxEmailSize = Default( KMaxInt)
//!						ImapMailOption = TImap4GetMailOptions::EGetImap4EmailBodyTextAndAttachments
//!					Connect to the Imap Server
//!					Create folder Named "MyFolder" under Inbox
//!					Download the mails
//!					Disconnect
//!					Now Move the mails to "MyFolder"
//!					Connect
//!					Check the Children Count on Imap remote Folder
//!					Delete (5) Messages from specified Folder (MyFolder)
//!					Do full Synchronisation
//!					Check the messages are deleted.
//! @SYMTestExpectedResults	Bearer migration should occur when sync folder, early expunge and first delete state reached. Event handler check is successful.
//! @SYMPREQ	1307
//! @SYMREQ		6989, 6991, 6992

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\migration\msg-imap-migration1.ini	0026-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer  	ResetMessageStore		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CreateImapAccount 
RUN_TEST_STEP	300	T_MsgImapServer		ChangeImap4SubAndSyncSettings	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-ChangeSubAndSyncSettings
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		InitialiseImap4Account		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-InitialiseImap4Account
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CheckChildrenCountRemoteInbox0
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DisConnectImap4Server
PRINT Setup Completed
PRINT Execute begins
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CreateImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CreateImap4Folder
RUN_TEST_STEP	300	T_MsgImapServer		SubscribeImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-SubscribeImapFolder_MyFolder

//Bearer upgrade, accept immediately at KMobilityTestMtmImapSyncESyncFolder
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapSyncESyncFolder_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DoFullImap4Synchronisation
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP  	300 	T_MsgImapServer		FindEntryByName 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-FindEntryByName
RUN_TEST_STEP  	300 	T_MsgImapServer		DeleteAllImapChildren 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DeleteAllImapChildrenMyFolder
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CheckChildrenCountRemoteMyFolder
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CreateSmtpMessageFromEmailFile0
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CreateSmtpMessageFromEmailFile1
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CreateSmtpMessageFromEmailFile2
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CreateSmtpMessageFromEmailFile3
RUN_TEST_STEP 	300 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CreateSmtpMessageFromEmailFile4
RUN_TEST_STEP 	300 	T_MsgCommonServer  	CheckChildrenCount 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CheckChildrenCountOutbox5
RUN_TEST_STEP 	300 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-SendSmtpMessage
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits 	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-ConnectImap4Server
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DoFullImap4Synchronisation
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CheckChildrenCountRemoteInbox5
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DisConnectImap4Server
//Moving Messages to "MyFolder"
RUN_TEST_STEP  	300 	T_MsgImapServer		MoveMessage	 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-MoveMessage1
RUN_TEST_STEP  	300 	T_MsgImapServer		MoveMessage	 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-MoveMessage2
RUN_TEST_STEP  	300 	T_MsgImapServer		MoveMessage	 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-MoveMessage3
RUN_TEST_STEP  	300 	T_MsgImapServer		MoveMessage	 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-MoveMessage4
RUN_TEST_STEP  	300 	T_MsgImapServer		MoveMessage	 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-MoveMessage5
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-ConnectImap4Server

//Bearer upgrade, accept immediately at KMobilityTestMtmImapSyncEInboxEarlyExpunge
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapSyncEInboxEarlyExpunge_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DoFullImap4Synchronisation
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CheckChildrenCountRemoteMyFolder5
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CheckChildrenCountRemoteInbox0

//Bearer upgrade, accept immediately at KMobilityTestMtmStateImapDelete1
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerInit	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerInit
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		ImapDelete1_CarrierUpgrade
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		CarrierUpgrade_AcceptImmediately
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrateToPreferred_NewCarrierActive
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		NewCarrierAccepted_InitialValue
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerAdd		c:\msgtest\email\imap\migration\msg-imap-migration1.ini		MigrationCompleteMigrateOK_InitialValue
//Deleting Messages from "MyFolder"
RUN_TEST_STEP  	300 	T_MsgImapServer		DeleteAllImapChildren 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DeleteAllImapChildrenMyFolder
RUN_TEST_STEP	30	T_MsgCommonServer	EventHandlerCheck	c:\msgtest\email\imap\migration\msg-imap-migration1.ini		EventHandlerCheck

RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DoFullImap4Synchronisation
//Verifying the Messages are deleted
RUN_TEST_STEP  	300 	T_MsgImapServer		CheckChildrenCountImap 		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-CheckChildrenCountRemoteMyFolder
RUN_TEST_STEP	300	T_MsgImapServer		UnsubscribeImap4Folder		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-UnsubscribeImapFolder_MyFolder
RUN_TEST_STEP	300	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\migration\msg-imap-migration1.ini	0026-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-MIGRATION1-0026
