//
// 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-SRCH-0001
//!	@SYMTestCaseID			MSG-IMAP-SRCH-0001
//!	@SYMTestCaseDesc		Retrieves all messages on the IMAP account, no search string is defined.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			UT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			First clean out the remote inbox and local message store, send the test emails, 
//!					get all messages and check they were all retrieved.
//!	@SYMTestExpectedResults		The number of emails retrieved should match the number of emails that was sent
//!	@SYMAuthor			Kavyashree.D

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

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

PRINT Running Test 1, no search string
// First clean out the remote inbox and local message store
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini	0001-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini	0001-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini	0001-DoFullImap4Synchronisation0
RUN_TEST_STEP 	300 	T_MsgImapServer		DeleteAllImapChildren		c:\msgtest\email\imap\search\msg-imap-search1.ini	0001-DeleteAllImapChildren
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini	0001-ResetMessageStore
// Send the test emails
RUN_TEST_STEP 	100 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	0001-InitNtRas
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0001-CreateImapAccount
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0001-ResetMessageStore
// get all messages and check they we're all retreived
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CheckChildrenCount0
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		ImapInvokeAsyncFunction		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-ImapInvokeAsyncFunction
RUN_TEST_STEP 	300 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0001-ResetMessageStore

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-SRCH-0001




START_TESTCASE		MSG-IMAP-SRCH-0002
//!	@SYMTestCaseID			MSG-IMAP-SRCH-0002
//!	@SYMTestCaseDesc		Retrieves messages that match the specified search string on the IMAP account.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			UT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			First clean out the remote inbox and local message store, send the test emails, 
//!					get messages matching the search string and check they were the only ones retrieved
//!	@SYMTestExpectedResults		The number of emails retrieved should match the number of emails that were send 
//!					and that match the search string.
//!	@SYMAuthor			Kavyashree.D

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

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

PRINT Running Test 2, search string is defined
// First clean out the remote inbox and local message store
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-DoFullImap4Synchronisation0
RUN_TEST_STEP 	300 	T_MsgImapServer		DeleteAllImapChildren		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-DeleteAllImapChildren
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-ResetMessageStore
// Send the test emails
RUN_TEST_STEP 	100 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-InitNtRas
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-CreateImapAccount
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-ResetMessageStore
// get messages matching search string and check they we're the only ones retreived
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-CheckChildrenCount0
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		ImapInvokeAsyncFunction		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-ImapInvokeAsyncFunction
RUN_TEST_STEP 	300 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0002-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0002-ResetMessageStore

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




START_TESTCASE		MSG-IMAP-SRCH-0003
//!	@SYMTestCaseID			MSG-IMAP-SRCH-0003
//!	@SYMTestCaseDesc		Retrieves first all messages, then retrieves messages that match the 
//!					specified search string on the IMAP account.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			UT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			First clean out the remote inbox and local message store, send the test emails, get all messages and check, 
//!					then get messages matching the search string and check they were the only ones retrieved
//!	@SYMTestExpectedResults		 On the first retrieval the inbox should contain 10 messages, after the second retrieval the inbox should contain only 5 messages
//!	@SYMAuthor			Kavyashree.D

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

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

PRINT Running Test 3, verify that local inbox matches fetch operation
// First clean out the remote inbox and local message store
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-DoFullImap4Synchronisation0
RUN_TEST_STEP 	300 	T_MsgImapServer		DeleteAllImapChildren		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-DeleteAllImapChildren
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-ResetMessageStore
// Send the test emails
RUN_TEST_STEP 	100 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	InitNtRas
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-CreateImapAccount
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-ResetMessageStore
// get all messages, should have 10 messages after this step
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-CheckChildrenCount0
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		ImapInvokeAsyncFunction		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-ImapInvokeAsyncFunction
RUN_TEST_STEP 	300 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-ResetMessageStore
// get only messages matching search string, should have only 5 messages after this step
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-CheckChildrenCount0
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		ImapInvokeAsyncFunction		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-ImapInvokeAsyncFunction
RUN_TEST_STEP 	300 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0003-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0003-ResetMessageStore

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




START_TESTCASE		MSG-IMAP-SRCH-0004
//!	@SYMTestCaseID			MSG-IMAP-SRCH-0004
//!	@SYMTestCaseDesc		Retrieves messages matching the specified search string. No email matches the search string.
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			UT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestCaseDependencies	requires ced -i c:\ced_default_ras.cfg to set comms.
//!	@SYMTestActions			First clean out the remote inbox and local message store, send the test emails, get messages matching the search string and check.
//!	@SYMTestExpectedResults		The account should contain NO messages.
//!	@SYMAuthor			Kavyashree.D

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

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

PRINT Running Test 4, non-matching search string is defined
// First clean out the remote inbox and local message store
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	0004-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0004-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini    	0004-DoFullImap4Synchronisation0
RUN_TEST_STEP 	300 	T_MsgImapServer		DeleteAllImapChildren		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0004-DeleteAllImapChildren
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0004-ResetMessageStore
// Send the test emails
RUN_TEST_STEP 	100 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini    	0004-InitNtRas
RUN_TEST_STEP 	100 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0004-CreateImapAccount
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_1
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		CreateSmtpMessageFromEmailFile	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateSmtpMessageFromEmailFile_2
RUN_TEST_STEP 	100 	T_MsgSmtpServer		SendSmtpMessage 		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SendSmtpMessage_2
RUN_TEST_STEP 	100 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini    	0004-ResetMessageStore
// get messages matching search string and check they we're the only ones retreived
RUN_TEST_STEP 	300 	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-InitNtRas
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CreateImapAccount
RUN_TEST_STEP 	300 	T_MsgCommonServer	CheckChildrenCount		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CheckChildrenCount0
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		SetImap4FullDownloadLimits	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-SetImap4FullDownloadLimits
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-DoFullImap4Synchronisation
RUN_TEST_STEP 	300 	T_MsgImapServer		CheckChildrenCountImap		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\search\msg-imap-search1.ini   	0004-ResetMessageStore


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-SRCH-0004




