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

// Test script for testing IMAP commands using codenomicon test tool

START_TESTCASE	MSG-IMAP-CONNECT-0001


PRINT Setup Begins #####################################################
PRINT **** msg-imap-connect-0001 ****

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp

RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0001-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0001-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0001-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0001-ConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DoFullImap4Synchronisation	c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0001-DoFullImap4Synchronisation
RUN_TEST_STEP	100	T_MsgImapServer		FindEntryByName			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0001-FindEntryByName_Inbox

RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0001-DisConnectImap4Server

RUN_TEST_STEP	100	T_MsgImapServer		DeleteImapAccount			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0001-DeleteImapAccount

//! RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
//! RUN_TEST_STEP	300	T_MsgImapServer		ShutDown

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


START_TESTCASE	MSG-IMAP-CONNECT-0002


PRINT Setup Begins #####################################################
PRINT **** msg-imap-connect-0002 ****

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp

RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0002-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0002-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0002-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0002-ConnectImap4Server
RUN_TEST_STEP !Error=-16 300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0002-ConnectImap4Server_Fail
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0002-DisConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DeleteImapAccount			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0002-DeleteImapAccount
//! RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
//! RUN_TEST_STEP	300	T_MsgImapServer		ShutDown

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

START_TESTCASE	MSG-IMAP-DISCONNECT-0001


PRINT Setup Begins #####################################################
PRINT **** MSG-IMAP-DISCONNECT-0001 ****

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp

RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0003-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0003-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0003-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0003-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0003-DisConnectImap4Server
RUN_TEST_STEP	100	T_MsgImapServer		DeleteImapAccount			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0003-DeleteImapAccount

//! RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
//! RUN_TEST_STEP	300	T_MsgImapServer		ShutDown

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

START_TESTCASE	MSG-IMAP-DISCONNECT-0002


PRINT Setup Begins #####################################################
PRINT **** MSG-IMAP-DISCONNECT-0002 ****

RUN_TEST_STEP	300	T_MsgCommonServer	StartUp
RUN_TEST_STEP	300	T_MsgImapServer		StartUp

RUN_TEST_STEP	300	T_MsgCommonServer	InitNtRas			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0004-InitNtRas
RUN_TEST_STEP	300	T_MsgCommonServer	ResetMessageStore		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0004-ResetMessageStore
RUN_TEST_STEP 	300 	T_MsgImapServer		CreateImapAccount 		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0004-CreateImapAccount 
RUN_TEST_STEP 	300 	T_MsgImapServer		ConnectImap4Server		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0004-ConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0004-DisConnectImap4Server
RUN_TEST_STEP 	300 	T_MsgImapServer		DisConnectImapServer		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 		0004-DisConnectImap4Server_Fail
RUN_TEST_STEP	100	T_MsgImapServer		DeleteImapAccount			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0004-DeleteImapAccount

//! RUN_TEST_STEP	300	T_MsgCommonServer	ShutDown
//! RUN_TEST_STEP	300	T_MsgImapServer		ShutDown

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

START_TESTCASE MSG-IMAP-AccessPointApi-0001


RUN_TEST_STEP 300 T_MsgCommonServer	StartUp
RUN_TEST_STEP 300 T_MsgImapServer	StartUp

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

RUN_TEST_STEP 300 T_MsgCommonServer	InitNtRas		c:\msgtest\email\imap\connect\msg-imap-connect1.ini 0005-InitNtRas
RUN_TEST_STEP 300 T_MsgCommonServer	ResetMessageStore	c:\msgtest\email\imap\connect\msg-imap-connect1.ini 0005-ResetMessageStore
RUN_TEST_STEP 300 T_MsgImapServer	CreateImapAccount 	c:\msgtest\email\imap\connect\msg-imap-connect1.ini 0005-CreateImapAccount 
RUN_TEST_STEP 300 T_MsgImapServer	ConnectImap4Server	c:\msgtest\email\imap\connect\msg-imap-connect1.ini 0005-ConnectImap4Server
RUN_TEST_STEP 300 T_MsgImapServer	CheckImap4AccessPoint	c:\msgtest\email\imap\connect\msg-imap-connect1.ini 0005-CheckImap4AccessPoint
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer	c:\msgtest\email\imap\connect\msg-imap-connect1.ini 0005-DisConnectImap4Server

RUN_TEST_STEP	100	T_MsgImapServer		DeleteImapAccount			c:\msgtest\email\imap\connect\msg-imap-connect1.ini 	0005-DeleteImapAccount
RUN_TEST_STEP 300 T_MsgCommonServer	ShutDown
RUN_TEST_STEP 300 T_MsgImapServer	ShutDown

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

END_TESTCASE MSG-IMAP-AccessPointApi-0001
