//
// 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 ST-MESS-OOM-0001

//!	@SYMTestCaseID			ST-MESS-OOM-0001
//!	@SYMTestCaseDesc		Send the message when out of memory condition
//!                                     	
//!	@SYMTestPriority		Critical
//!   	@SYMTestType			ST
//!  	@SYMTestStatus			Implemented
//!	@SYMPREQ 			PREQ1189   
//!	@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
//!					Connects to the IMAP server and performs a synchronisation
//!					Disconnects from the server
//!					
//!					Create a message
//!					Send the message in out of memory condition
//!					
//!	@SYMTestExpectedResults		Send should be returned with the error  -4 (KErrNoMemory)
//!	@SYMAuthor			Rajat Bal


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\sys\st-mess.ini 	0001-InitNtRas
RUN_TEST_STEP 300 T_MsgCommonServer 	ResetMessageStore		c:\msgtest\sys\st-mess.ini 	0001-ResetMessageStore
RUN_TEST_STEP 300 T_MsgImapServer 	CreateImapAccount		c:\msgtest\sys\st-mess.ini 	0001-CreateImapAccount

RUN_TEST_STEP 300 T_MsgImapServer	ChangeImap4SubAndSyncSettings	c:\msgtest\sys\st-mess.ini 	0001-ChangeImapSettings
RUN_TEST_STEP 300 T_MsgImapServer	ConnectAndSyncImapServer	c:\msgtest\sys\st-mess.ini 	0001-ConnectAndSyncImapServer
RUN_TEST_STEP 300 T_MsgImapServer	InitialiseImap4Account		c:\msgtest\sys\st-mess.ini 	0001-InitialiseImap4Account
RUN_TEST_STEP 300 T_MsgImapServer	DoFullImap4Synchronisation	c:\msgtest\sys\st-mess.ini 	0001-DoFullImap4Synchronisation
RUN_TEST_STEP 300 T_MsgImapServer	CheckChildrenCountImap		c:\msgtest\sys\st-mess.ini 	0001-CheckChildrenCountRemoteInbox
RUN_TEST_STEP 300 T_MsgImapServer	DisConnectImapServer		c:\msgtest\sys\st-mess.ini 	0001-DisConnectImap4Server

PRINT ################## demo: send in oom ###
RUN_TEST_STEP 300 T_MsgSmtpServer 	CreateSmtpMessageFromEmailFile	c:\msgtest\sys\st-mess.ini 	0001-CreateSmtpMessageFromEmailFile
RUN_TEST_STEP !OOM -1 T_MsgSmtpServer	SendSmtpMessage			c:\msgtest\sys\st-mess.ini 	0001-SendSmtpMessage

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

PRINT Execute Completed ################################################
END_TESTCASE ST-MESS-OOM-0001


