// Copyright (c) 2006-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:
// @file
//
//
//! @SYMTestSuiteName PDS-TEF-SQL-SUITE
//! @SYMScriptTestEnvironment TEF
//! @internalComponent
//! @test
PRINT Run SQL Tests
LOAD_SUITE te_SQL_Suite
START_TESTCASE SYSLIB-SQL-CIT-1684
//! @SYMTestCaseID SYSLIB-SQL-CIT-1684
//! @SYMTestCaseDesc Perform some basic operations (see the config file for
//! full details).
//! Runs most of the RSqlDatabase methods, checking for
//! expected errors and error messages as it goes. Then
//! triggers the 'rsqlstatement' block using the same
//! 'RSqlDatabase' object and runs most RSqlStatement methods
//! again checking for errors and so on. Includes 'Bind' calls
//! and retrieval of data with 'ColumnText' etc.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! The test looks for specific error codes and content
//! within the database. If these are not seen test errors
//! will be generated.
//!
//! @SYMREQ REQ5792
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini Top
END_TESTCASE SYSLIB-SQL-CIT-1684
START_TESTCASE SYSLIB-SQL-CIT-1685
//! @SYMTestCaseID SYSLIB-SQL-CIT-1685
//! @SYMTestCaseDesc Perform further basic operations (see the config file for
//! full details).
//! Add a new field to the table created in the database
//! created in the last test. Attempts some exceptions (e.g
//! getting a ParameterIndex for a non-existent field),
//! checks 'ColumnType' and the output of 'Next' and 'AtRow'.
//! Deletes the db on completion.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! The test looks for specific error codes and content
//! within the database. If these are not seen test errors
//! will be generated.
//!
//! @SYMREQ REQ5792
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini AddtoTable
END_TESTCASE SYSLIB-SQL-CIT-1685
START_TESTCASE SYSLIB-SQL-CIT-1686
//! @SYMTestCaseID SYSLIB-SQL-CIT-1686
//! @SYMTestCaseDesc 'StreamWrite' bind test. Creates a new db, creates a
//! table and writes to a cell in the table using
//! the 'BindText' method within 'RSqlParamWriteStream'.
//! Retrieve the content from the cell using the various
//! 'ColumnText' methods of RSqlStatement and also the
//! 'ColumnText' method of RSqlColumnReadStream and check
//! for correct content.
//! Now also has an integer field within the table which
//! checks the BindInt and ColumnInt methods as well as
//! the text methods mentioned above. This change is to
//! check for the problem of the first stream write failing
//! to store anything if done in conjunction with any other
//! bind (which was fixed by cl@764944).
//! Deletes the db on completion.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! The test looks for specific error codes and content
//! within the database. If these are not seen test errors
//! will be generated.
//!
//! @SYMREQ REQ5792
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini SWBindText
END_TESTCASE SYSLIB-SQL-CIT-1686
START_TESTCASE SYSLIB-SQL-CIT-1687
//! @SYMTestCaseID SYSLIB-SQL-CIT-1687
//! @SYMTestCaseDesc 'StreamWrite' bind test. Creates a new db, creates a
//! table and writes to a cell in the table using
//! the 'BindBinary' method within 'RSqlParamWriteStream'.
//! Retrieve the content from the cell using the various
//! 'ColumnBinary' methods of RSqlStatement and also the
//! 'ColumnBinary' method of RSqlColumnReadStream and check
//! for correct content.
//! Deletes the db on completion.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! The test looks for specific error codes and content
//! within the database. If these are not seen test errors
//! will be generated.
//! @SYMREQ REQ5792
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini SWBindBinary
END_TESTCASE SYSLIB-SQL-CIT-1687
START_TESTCASE SYSLIB-SQL-CIT-1699
//! @SYMTestCaseID SYSLIB-SQL-CIT-1699
//! @SYMTestCaseDesc Uses the test1.db (in ROM) to test counting of lines,
//! calculation of averages and sums in a table and so on.
//! This requires that ColumnInt/Real etc access an unnamed
//! column (column zero).
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! The sums, averages etc are correctly calculated and the
//! test reports a PASS.
//! @SYMREQ REQ5792
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini Countlines
END_TESTCASE SYSLIB-SQL-CIT-1699
START_TESTCASE SYSLIB-SQL-CIT-1746
//! @SYMTestCaseID SYSLIB-SQL-CIT-1746
//! @SYMTestCaseDesc Tests basic transaction behaviour and a simple level
//! of concurrency. A single record is added to a table.
//! Then, within a transaction three more are added.
//! At this point two concurrent threads (one ESerializable,
//! one EReadUncommitted) check the content of the table.
//! After checking the transaction is rolled back.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! The ESerializable thread is unable to read the table
//! because it is locked. The EReadUncommitted read it fine.
//! @SYMREQ REQ5792
//! REQ5793
CONCURRENT
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread2
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread3
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread1
END_TESTCASE SYSLIB-SQL-CIT-1746
START_TESTCASE SYSLIB-SQL-CIT-1747
//! @SYMTestCaseID SYSLIB-SQL-CIT-1747
//! @SYMTestCaseDesc Verifies the rollback on the last test performed properly.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! The table reads without error, it contains 1 record.
//! @SYMREQ REQ5792
CONSECUTIVE
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini CheckFollowingRollback
END_TESTCASE SYSLIB-SQL-CIT-1747
START_TESTCASE SYSLIB-SQL-CIT-1745
//! @SYMTestCaseID SYSLIB-SQL-CIT-1745
//! @SYMTestCaseDesc Verifies that streams behave - we pass a read stream
//! to a write stream.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! Runs without error.
//! @SYMREQ REQ5792
CONSECUTIVE
RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini CopyCellsWithStreams
END_TESTCASE SYSLIB-SQL-CIT-1745
START_TESTCASE SYSLIB-SQL-CIT-1742
//! @SYMTestCaseID SYSLIB-SQL-CIT-1742
//! @SYMTestCaseDesc A simple test of the effect of two binds without an
//! exec/reset between them.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! The second data to be bound gets written to the cell,
//! a PASS will be reported.
//! @SYMREQ REQ5792
CONSECUTIVE
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini DoubleBind
END_TESTCASE SYSLIB-SQL-CIT-1742
START_TESTCASE SYSLIB-SQL-CIT-1798
//! @SYMTestCaseID SYSLIB-SQL-CIT-1798
//! @SYMTestCaseDesc A simple test using the OpenL and CreateL methods.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! Checks for appropriate error codes from the APIs called
//! and reports a PASS.
//! @SYMREQ REQ5792
CONSECTUTIVE
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini LeaveMethods
END_TESTCASE SYSLIB-SQL-CIT-1798
RUN_UTILS DeleteFile C:\Leave1.db
RUN_UTILS DeleteFile C:\MCO1.db
RUN_UTILS DeleteFile C:\MCO2.db
RUN_UTILS DeleteFile C:\MCO3.db
RUN_UTILS DeleteFile C:\MCO4.db
RUN_UTILS DeleteFile C:\MCO5.db
START_TESTCASE SYSLIB-SQL-CIT-1799
//! @SYMTestCaseID SYSLIB-SQL-CIT-1799
//! @SYMTestCaseDesc Tests the effect of multiple sequential Creates and Opens.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! Verifies that multiple Creates and Opens with the same
//! RSqlDatabase object does not generate an error. You
//! might expect a PANIC but you'd be wrong! Note the
//! deletes afterwards, these clean up where we can't because
//! all of the databases get locked.
//! @SYMREQ REQ5792
RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini MultipleCreateOpen
END_TESTCASE SYSLIB-SQL-CIT-1799
RUN_UTILS DeleteFile C:\Leave1.db
RUN_UTILS DeleteFile C:\MCO1.db
RUN_UTILS DeleteFile C:\MCO2.db
RUN_UTILS DeleteFile C:\MCO3.db
RUN_UTILS DeleteFile C:\MCO4.db
RUN_UTILS DeleteFile C:\MCO5.db
START_TESTCASE SYSLIB-SQL-CIT-1830
//! @SYMTestCaseID SYSLIB-SQL-CIT-1830
//! @SYMTestCaseDesc Further bind tests.
//! @SYMTestPriority High
//! @SYMTestActions See description and the config file.
//! @SYMTestExpectedResults
//! A couple of tests that verify that a bind can be used
//! in combination with a SELECT to fetch data from a table
//! based on parameters in the bind. The first one uses
//! integers, the second a binary field (though it's defined
//! as text in the 'Create table' line). For no special
//! reason we run these concurrently. It isn't really a
//! concurrency test, just two tests executing concurrently.
//! @SYMREQ REQ5792
CONCURRENT
RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini ExtraBindTest
RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini ExtraBindTest2
END_TESTCASE SYSLIB-SQL-CIT-1830