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

START_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81107
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81107
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMPREQ 811
//! @SYMTestCaseDesc Low Disk space Test
//! @SYMTestActions Simulate disk being full (Create a file that is the same size as the free space available on the disk)
//! Attempt various CRUD requests (create, read, update and delete)
//! Attempt Compress, recover
//! Trap all these api calls
//! Store leave value in X	
//! Repeat test when the disk is no longer full
//! @SYMTestExpectedResults For CUD, compress and recover requests X should equal Disk full error
//! For read requests X should equal no error (KErrNone)
RUN_TEST_STEP 500 Te_PerformanceFunctionalitySuite LowDiskSpaceStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini
RUN_TEST_STEP 100 Te_PerformanceFunctionalitySuite LowDiskSpaceStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini cleanup
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81107

START_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81172
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81172
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMREQ
//! REQ5405 
//! REQ5406
//! REQ5400
//! @SYMTestCaseDesc Transaction commit low disk test
//! @SYMTestActions
//! start transaction
//! add new contacts Y
//! transition to lowdisk mode
//! add new contact X
//! commit transaction	
//! @SYMTestExpectedResults 
//! check that commit successful, 
//! check that only Y contact were added to the database, 
//! It is possible commit a transaction if in low disk mode, 
//! correct error is returned if performing crud operations 
//! within a transaction while in low disk mode
RUN_TEST_STEP 200 Te_PerformanceFunctionalitySuite LowDiskSpaceStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini FailCommitTransaction
RUN_TEST_STEP 100 Te_PerformanceFunctionalitySuite LowDiskSpaceStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini cleanup
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81172

START_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81173
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81173
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMREQ 
//! REQ5405 
//! REQ5406
//! REQ5400
//! @SYMTestCaseDesc Transaction rollback low disk test
//! @SYMTestActions
//! start transaction
//! add new contacts Y
//! transition to lowdisk mode
//! add new contact X
//! rollback transaction	
//! @SYMTestExpectedResults 
//! check that commit successful, check that no contact were added to the database, 
//! It is possible to rollback a transaction if in low disk mode, 
//! correct error is returned if performing crud operations 
//! within a transaction while in low disk mode
RUN_TEST_STEP 200 Te_PerformanceFunctionalitySuite LowDiskSpaceStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini FailRollbackTransaction
RUN_TEST_STEP 100 Te_PerformanceFunctionalitySuite LowDiskSpaceStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini cleanup
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81173

START_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81174
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81174
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMFssID <App-Engines>/<CntModel>/ CP.1
//! @SYMTestCaseDesc Load contact server in low disk test
//! @SYMTestActions
//! close all sessions to server
//! wait for server to close
//! transition to low disk mode
//! open new session
//! check that new session was opened successfully
//! @SYMTestExpectedResults 
//! check that new session was opened successfully and no errors were generated, 
//! It is possible to start the contact model server while in low disk mode
RUN_TEST_STEP 200 Te_PerformanceFunctionalitySuite LowDiskSpaceStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini StartServer
RUN_TEST_STEP 100 Te_PerformanceFunctionalitySuite LowDiskSpaceStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini cleanup
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81174
