//
// 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-P81101
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81101
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMPREQ 811
//! @SYMTestCaseDesc Contact Locking Test
//! @SYMTestActions Set time out to X
//! Open contact A
//! Register time.
//! Open contact A in a trap
//! Register time difference in Y.
//! Store leave error in Z
//! Repeat test where second open occurs for different instance of database accessing the same file (database session)
//! 
//! @SYMTestExpectedResults Y should equal X
//! Z should equal time out error
RUN_TEST_STEP 500 Te_PerformanceFunctionalitySuite TimeoutStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini ContactLock
RUN_TEST_STEP 500 Te_PerformanceFunctionalitySuite TimeoutStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini MultipleSessionContactLock
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81101

START_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81104
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81104
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMPREQ 811
//! @SYMTestCaseDesc Transaction Internal locking Test
//! @SYMTestActions Start Transaction 
//! Attempt all CRUD operations
//! Trap all operations
//! Store leave error in Z
//! revert transaction 	
//! @SYMTestExpectedResults For CRUD requests Z should equal no error (KErrorNone)
RUN_TEST_STEP 500 Te_PerformanceFunctionalitySuite TimeoutStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini TransactionLock
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81104

START_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81103
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81103
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMPREQ 811
//! @SYMTestCaseDesc Transaction External Locking Test
//! @SYMTestActions Open database session A
//! Open database session B	
//! Start Transaction using session B
//! Use session A for all following operations	
//! Set time out to X
//! Register time
//! Attempt all CRUD operations
//! Trap all operations
//! Store leave error in Z
//! Register time difference in Y.
//! revert transaction using session B
//! close sessions
//! @SYMTestExpectedResults For CUD requests Z should equal lock error and Y should equal X
//! For read requests Z should equal no error (KErrorNone) and Y should equal 0
RUN_TEST_STEP 500 Te_PerformanceFunctionalitySuite TimeoutStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini MultipleSessionTransactionLock
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81103

START_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81102
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81102
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMPREQ 811
//! @SYMTestCaseDesc Template Locking Test
//! @SYMTestActions Set time out to X
//! Open template A
//! Register time
//! Open template A in a trap
//! Register time difference in Y.
//! Store leave error in Z
//! 
//! Register time
//! Open contact B based on A in a trap
//! Register time difference in Y2
//! Store leave error in Z2
//! Repeat test where second and third opens occurs for different database sessions
//! @SYMTestExpectedResults Y =X and Y2 = 0
//! Z = error and Z2 = 0
RUN_TEST_STEP 500 Te_PerformanceFunctionalitySuite TimeoutStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini TemplateLock
RUN_TEST_STEP 500 Te_PerformanceFunctionalitySuite TimeoutStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini MultipleSessionTemplateLock
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81102

START_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81155
//! @SYMTestCaseID PIM-APPENG-CNTMODEL-CIT-P81155
//! @SYMTestType CIT
//! @SYMTestPriority High
//! @SYMPREQ 811
//! @SYMTestCaseDesc Timeout Range test
//! @SYMTestActions Set timeout to X
//! Check error value
//! Open contact A
//! Attempt to open contact A again
//! Check length of time before second open times out
//! Repeat for various values of X
//! @SYMTestExpectedResults If X is invalid return error
//! If X is valid time out time should equal X
RUN_TEST_STEP 1000 Te_PerformanceFunctionalitySuite TimeoutStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini TimeoutRange
RUN_TEST_STEP 1000 Te_PerformanceFunctionalitySuite TimeoutStep c:\PerformanceFunc\configs\te_PerformanceFunctionalitySuite.ini MultipleSessionTimeoutRange
END_TESTCASE PIM-APPENG-CNTMODEL-CIT-P81155
