//
// 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:
//
//!	@SYMTestCaseID			MSG_SCH_SEND_0007
//!	@SYMTestCaseDesc		The test aims to verify the message sent when the message is scheduled to be sent
//!					using command EReScheduleAllL
//!	@SYMTestPriority		High
//!   	@SYMTestType			CIT
//!  	@SYMTestStatus			Implemented   
//!	@SYMTestActions			1.GetBaseConstants IDs.
//!					2.Get the pigeon MTM constant.
//!					3.Set the default SMS settings.
//!					4.Set the schedule send settings.
//!					5.Create a pigeon message, setting the schedule send time to 2 mins.
//!					6.Schedule the message to be sent using the command EReScheduleAllL
//!					7.Sleep for 2 mins.
//!					8.Check if the schedule time is expired.
//!					9.Check of the message is Sent or present in Outbox folder.
//!	@SYMTestExpectedResults		EPass, The message is sent.
//!	@SYMAuthor			Kavyashree.D

RUN_UTILS DeleteFile c:\messaging.db
LOAD_SUITE MessagingTestServer -SharedData

RUN_TEST_STEP 350 MessagingTestServer	BEGIN_TEST_CASE
RUN_TEST_STEP 350 MessagingTestServer	SETUP_TEST_CASE
RUN_TEST_STEP 400 MessagingTestServer	GetBaseConstants 			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		GetBaseConstants
RUN_TEST_STEP 400 MessagingTestServer	GetPigeonMtmConstant			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		GetPigeonMtmConstant
RUN_TEST_STEP 400 MessagingTestServer	SetDefaultSmsSettings 			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		SetSettingsFile
RUN_TEST_STEP 400 MessagingTestServer	CreateSession 				c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		CreateSession
RUN_TEST_STEP 400 MessagingTestServer	ResetMessageStore			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		ResetMessageStore
RUN_TEST_STEP 400 MessagingTestServer	DeleteExistingService 			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		DeleteExistingService
RUN_TEST_STEP 400 MessagingTestServer	CreateService				c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		CreateService
RUN_TEST_STEP 400 MessagingTestServer	SetSchSendSettings 			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		SetSchSendSettings
RUN_TEST_STEP 400 MessagingTestServer	DeleteChildren 				c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		EmptyOutbox
RUN_TEST_STEP 400 MessagingTestServer	DeleteChildren 				c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		EmptySent
RUN_TEST_STEP 350 MessagingTestServer	EXECUTE_TEST_CASE
RUN_TEST_STEP 400 MessagingTestServer	CreatePigeonMessage			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		CreatePigeonMessage
//Schedule Message by Calling Command 2(ReSchedule)
RUN_TEST_STEP 400 MessagingTestServer	SchedulePigeonMessage			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini 		SchedulePigeonMessage
RUN_TEST_STEP 400 MessagingTestServer	Sleep 					c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		Sleep
RUN_TEST_STEP 350 MessagingTestServer	CHECK_POSTCONDITIONS
RUN_TEST_STEP 400 MessagingTestServer	CheckChildrenCount			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		CheckOutboxChildrenCount
RUN_TEST_STEP 400 MessagingTestServer	CheckChildrenCount			c:\msgtest\TestFramework\ScriptedTestCases\ScheduleSendScripts\MSG_SCH_SEND_0007.ini		CheckSentItemsChildrenCount
RUN_TEST_STEP 350 MessagingTestServer	END_TEST_CASE
