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