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

LOAD_SERVER t_media  -SharedData

//! @file			
//! @SYMTestSuiteName		MSG-PREFERRED-DRIVELIST-OPS
//! @SYMScriptTestEnvironment   Details as in below:-
//!				1. nt-ras connection or winpcap
//!				2. email servers ( communigatePro or ms exchange)
//!				3. test driver
//!				4. testexecute framework(TEF3.0)
//!				
//! @SYMScriptPurpose		Integration testing of PREQ557-"Improved support in Messaging for removable media"
//! @SYMScriptCreationDate	04/04/2008


START_TESTCASE	MSG-PREFERRED-DRIVELIST-OPS-0001
//! 	@SYMTestCaseID		MSG-PREFERRED-DRIVELIST-OPS-0001
//! 	@SYMTestCaseDesc	Remove the drive from preferred drive list and add it again
//!				
//!	@SYMREQ			REQ9046 
//!	@SYMPREQ 		PREQ557
//!	@SYMAPI			void CMsvSession::CurrentDriveInfo (TDriveNumber& aDrive, Tint& aPriority)
//!				void CMsvSession::AddDriveL (TDriveNumber aDrive, Tint& aPriority)
//!				void CMsvSession::RemoveDriveL (TDriveNumber aDrive)
//!				void CMsvSession::DriveListL(RArray<TDriveNumber>& aDriveList)
//!				
//!	@SYMTestCaseDependencies ms-presetup-0001.script
//!				
//! 	@SYMTestPriority	High
//! 	@SYMTestActions		1. Intialize the preferred drives with accounts and messages(run the ms-presetup-0001.script)
//!				2. Get the current drive(C: drive)
//!				3. Remove a lesser priority drive(I: drive) from preferred drive list
//!				4. Check the drive(I: drive) is not present in preferred drive list
//!				5. Add the drive(I: drive) in the preferred drive list
//!				6. Check the drive(I: drive) is present in preferred drive list
//!				7. Remove the system drive(C: drive) from preferred drive list
//!				8. Update the drive (E: Drive) with high priority
//!				9. Get the current drive(E: drive)
//!				10. Remove current drive(E: drive) from preferred drive list
//!				11. Check the drive(E: drive) is not present in preferred drive list
//!				12. Get current drive (C: drive which is next higher priority drive)
//!				13. Add higher priority drive(E: drive) in the preferred drive list
//!				14. Check the drive(E: drive) is present in preferred drive list
//!				15. Get the current drive(E: drive)
//!				
//! 	@SYMTestExpectedResults 1. Accounts and messages should be created in all drives
//!				2. C: drive should be the current drive
//!				3. I: drive should be removed and capture EMsvRefeshMessageView notification
//!				4. I: drive should not be present in preferred drive list
//!				5. I: drive should be added and capture EMsvRefeshMessageView notification
//!				6. I: drive should be present in preferred drive list
//!				7. System drive(C: drive) should not be removed from preferred drive list and will though KErrArgument error
//!				8. E: drive should updated with high priority
//!				9. E: drive should be the current drive
//!				10. E: drive should be removed and capture EMsvCurrentDriveChanged notification
//!				11. E: drive should not be present in preferred drive list
//!				12. D: drive should be the current drive
//!				13. E: drive should be added and capture EMsvCurrentDriveChanged notification
//!				14. E: drive should be present in preferred drive list
//!				15. E: drive is the current drive
//!				
//!	@SYMAuthor		Rajat Bal
//!				
//! 	@SYMTestType		CIT
//! 	@SYMTestStatus 		Defined

START_TEST_BLOCK	100	t_media		c:\msgtest\email\imap\exploratorytesting\msg-adddrive-corruptedmmc.ini
	CREATE_OBJECT	CenRepTestWrapper	0100_obj
	COMMAND		0100_obj		ResetCentralRepository	0100_ResetCentralRepository
END_TEST_BLOCK


RUN_UTILS  CopyFile   		c:\private\1000484b\msgprioritydrivelist.ini	c:\private\1000484b\msgprioritydrivelist.bak
RUN_UTILS  MakeReadWrite  	c:\private\1000484b\msgprioritydrivelist.ini
RUN_UTILS  CopyFile   		c:\msgtest\email\imap\exploratorytesting\msg-preferred-0002.ini		c:\private\1000484b\msgprioritydrivelist.ini
						
	START_TEST_BLOCK	100	t_media		c:\msgtest\email\imap\exploratorytesting\msg-adddrive-corruptedmmc.ini
		CREATE_OBJECT	MediaTestWrapper	0001_obj_1
		COMMAND		0001_obj_1		GetCurrentDrive	0001_GetCurrentDrive_1
		COMMAND		0001_obj_1		GetDrivelist	0001_GetDrivelist_1
		COMMAND		0001_obj_1		AddDrive	0001_AddDrive_high
		COMMAND		0001_obj_1		GetDrivelist	0001_GetDrivelist_2
		COMMAND		0001_obj_1		GetCurrentDrive	0001_GetCurrentDrive_2	
	END_TEST_BLOCK

RUN_UTILS  MakeReadWrite  	c:\private\1000484b\msgprioritydrivelist.ini
RUN_UTILS  CopyFile   		c:\private\1000484b\msgprioritydrivelist.bak	c:\private\1000484b\msgprioritydrivelist.ini
RUN_UTILS  DeleteFile		c:\private\1000484b\msgprioritydrivelist.bak
	
END_TESTCASE	MSG-PREFERRED-DRIVELIST-OPS-0001