//
// 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_0008
//!	@SYMTestCaseDesc		The test aims to verify multiple messages are sent when the messages are 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 1 mins.
//!					6.Create another pigeon message, setting the schedule send time to 2 mins.
//!					6.Schedule the messages to be sent using the command EReScheduleAllL.
//!					7.Sleep for 1 mins.
//!					8.Check if the schedule time is expired.
//!					9.Check if the message is Sent or present in Outbox folder.
//!	@SYMTestExpectedResults		EPass, The messages are sent.
//!	@SYMAuthor			Kavyashree.D

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

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