os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/scripts/BasicSQL2.script
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/scripts/BasicSQL2.script	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,263 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// @file
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +//! @SYMTestSuiteName PDS-TEF-SQL-SUITE
    1.22 +//! @SYMScriptTestEnvironment TEF
    1.23 +//! @internalComponent
    1.24 +//! @test
    1.25 +
    1.26 +PRINT Run SQL Tests
    1.27 +
    1.28 +LOAD_SUITE te_SQL_Suite
    1.29 +
    1.30 +START_TESTCASE SYSLIB-SQL-CIT-1684
    1.31 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1684
    1.32 +//! @SYMTestCaseDesc  Perform some basic operations (see the config file for
    1.33 +//!                  full details).
    1.34 +//!                  Runs most of the RSqlDatabase methods, checking for
    1.35 +//!                  expected errors and error messages as it goes. Then
    1.36 +//!                  triggers the 'rsqlstatement' block using the same
    1.37 +//!                  'RSqlDatabase' object and runs most RSqlStatement methods
    1.38 +//!                  again checking for errors and so on. Includes 'Bind' calls
    1.39 +//!                  and retrieval of data with 'ColumnText' etc.
    1.40 +//! @SYMTestPriority  High
    1.41 +//! @SYMTestActions   See description and the config file.
    1.42 +//! @SYMTestExpectedResults
    1.43 +//!                  The test looks for specific error codes and content
    1.44 +//!                  within the database. If these are not seen test errors
    1.45 +//!                  will be generated.
    1.46 +//!                  
    1.47 +//! @SYMREQ           REQ5792
    1.48 +
    1.49 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini Top
    1.50 +END_TESTCASE SYSLIB-SQL-CIT-1684
    1.51 +
    1.52 +START_TESTCASE SYSLIB-SQL-CIT-1685
    1.53 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1685
    1.54 +//! @SYMTestCaseDesc  Perform further basic operations (see the config file for
    1.55 +//!                  full details).
    1.56 +//!                  Add a new field to the table created in the database
    1.57 +//!                  created in the last test. Attempts some exceptions (e.g
    1.58 +//!                  getting a ParameterIndex for a non-existent field),
    1.59 +//!                  checks 'ColumnType' and the output of 'Next' and 'AtRow'.
    1.60 +//!                  Deletes the db on completion.
    1.61 +//! @SYMTestPriority  High
    1.62 +//! @SYMTestActions   See description and the config file.
    1.63 +//! @SYMTestExpectedResults
    1.64 +//!                  The test looks for specific error codes and content
    1.65 +//!                  within the database. If these are not seen test errors
    1.66 +//!                  will be generated.
    1.67 +//!                  
    1.68 +//! @SYMREQ           REQ5792
    1.69 +
    1.70 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini AddtoTable
    1.71 +END_TESTCASE SYSLIB-SQL-CIT-1685
    1.72 +
    1.73 +START_TESTCASE SYSLIB-SQL-CIT-1686
    1.74 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1686
    1.75 +//! @SYMTestCaseDesc  'StreamWrite' bind test. Creates a new db, creates a
    1.76 +//!                  table and writes to a cell in the table using
    1.77 +//!                  the 'BindText' method within 'RSqlParamWriteStream'.
    1.78 +//!                  Retrieve the content from the cell using the various
    1.79 +//!                  'ColumnText' methods of RSqlStatement and also the
    1.80 +//!                  'ColumnText' method of RSqlColumnReadStream and check
    1.81 +//!                  for correct content.
    1.82 +//!                  Now also has an integer field within the table which
    1.83 +//!                  checks the BindInt and ColumnInt methods as well as
    1.84 +//!                  the text methods mentioned above. This change is to
    1.85 +//!                  check for the problem of the first stream write failing
    1.86 +//!                  to store anything if done in conjunction with any other
    1.87 +//!                  bind (which was fixed by cl@764944).
    1.88 +//!                  Deletes the db on completion.
    1.89 +//! @SYMTestPriority  High
    1.90 +//! @SYMTestActions   See description and the config file.
    1.91 +//! @SYMTestExpectedResults
    1.92 +//!                  The test looks for specific error codes and content
    1.93 +//!                  within the database. If these are not seen test errors
    1.94 +//!                  will be generated.
    1.95 +//!                  
    1.96 +//! @SYMREQ           REQ5792
    1.97 +
    1.98 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini SWBindText
    1.99 +END_TESTCASE SYSLIB-SQL-CIT-1686
   1.100 +
   1.101 +START_TESTCASE SYSLIB-SQL-CIT-1687
   1.102 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1687
   1.103 +//! @SYMTestCaseDesc  'StreamWrite' bind test. Creates a new db, creates a
   1.104 +//!                  table and writes to a cell in the table using
   1.105 +//!                  the 'BindBinary' method within 'RSqlParamWriteStream'.
   1.106 +//!                  Retrieve the content from the cell using the various
   1.107 +//!                  'ColumnBinary' methods of RSqlStatement and also the
   1.108 +//!                  'ColumnBinary' method of RSqlColumnReadStream and check
   1.109 +//!                  for correct content.
   1.110 +//!                  Deletes the db on completion.
   1.111 +//! @SYMTestPriority  High
   1.112 +//! @SYMTestActions   See description and the config file.
   1.113 +//! @SYMTestExpectedResults
   1.114 +//!                  The test looks for specific error codes and content
   1.115 +//!                  within the database. If these are not seen test errors
   1.116 +//!                  will be generated.
   1.117 +//! @SYMREQ           REQ5792
   1.118 +
   1.119 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini SWBindBinary
   1.120 +END_TESTCASE SYSLIB-SQL-CIT-1687
   1.121 +
   1.122 +START_TESTCASE SYSLIB-SQL-CIT-1699
   1.123 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1699
   1.124 +//! @SYMTestCaseDesc  Uses the test1.db (in ROM) to test counting of lines,
   1.125 +//!                  calculation of averages and sums in a table and so on.
   1.126 +//!                  This requires that ColumnInt/Real etc access an unnamed
   1.127 +//!                  column (column zero).
   1.128 +//! @SYMTestPriority  High
   1.129 +//! @SYMTestActions   See description and the config file.
   1.130 +//! @SYMTestExpectedResults
   1.131 +//!                  The sums, averages etc are correctly calculated and the
   1.132 +//!                  test reports a PASS.
   1.133 +//! @SYMREQ           REQ5792
   1.134 +
   1.135 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini Countlines
   1.136 +END_TESTCASE SYSLIB-SQL-CIT-1699
   1.137 +
   1.138 +START_TESTCASE SYSLIB-SQL-CIT-1746
   1.139 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1746
   1.140 +//! @SYMTestCaseDesc  Tests basic transaction behaviour and a simple level
   1.141 +//!                  of concurrency. A single record is added to a table.
   1.142 +//!                  Then, within a transaction three more are added.
   1.143 +//!                  At this point two concurrent threads (one ESerializable,
   1.144 +//!                  one EReadUncommitted) check the content of the table.
   1.145 +//!                  After checking the transaction is rolled back.
   1.146 +//! @SYMTestPriority  High
   1.147 +//! @SYMTestActions   See description and the config file.
   1.148 +//! @SYMTestExpectedResults
   1.149 +//!                  The ESerializable thread is unable to read the table
   1.150 +//!                  because it is locked. The EReadUncommitted read it fine.
   1.151 +//! @SYMREQ           REQ5792
   1.152 +//!                  REQ5793
   1.153 +
   1.154 +CONCURRENT
   1.155 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread2
   1.156 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread3
   1.157 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread1
   1.158 +END_TESTCASE SYSLIB-SQL-CIT-1746
   1.159 +
   1.160 +
   1.161 +START_TESTCASE SYSLIB-SQL-CIT-1747
   1.162 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1747
   1.163 +//! @SYMTestCaseDesc  Verifies the rollback on the last test performed properly.
   1.164 +//! @SYMTestPriority  High
   1.165 +//! @SYMTestActions   See description and the config file.
   1.166 +//! @SYMTestExpectedResults
   1.167 +//!                  The table reads without error, it contains 1 record.
   1.168 +//! @SYMREQ           REQ5792
   1.169 +
   1.170 +CONSECUTIVE
   1.171 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini CheckFollowingRollback
   1.172 +END_TESTCASE SYSLIB-SQL-CIT-1747
   1.173 +
   1.174 +START_TESTCASE SYSLIB-SQL-CIT-1745
   1.175 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1745
   1.176 +//! @SYMTestCaseDesc  Verifies that streams behave - we pass a read stream
   1.177 +//!                  to a write stream.
   1.178 +//! @SYMTestPriority  High
   1.179 +//! @SYMTestActions   See description and the config file.
   1.180 +//! @SYMTestExpectedResults
   1.181 +//!                  Runs without error.
   1.182 +//! @SYMREQ           REQ5792
   1.183 +
   1.184 +CONSECUTIVE
   1.185 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini CopyCellsWithStreams
   1.186 +END_TESTCASE SYSLIB-SQL-CIT-1745
   1.187 +
   1.188 +START_TESTCASE SYSLIB-SQL-CIT-1742
   1.189 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1742
   1.190 +//! @SYMTestCaseDesc  A simple test of the effect of two binds without an
   1.191 +//!                  exec/reset between them.
   1.192 +//! @SYMTestPriority  High
   1.193 +//! @SYMTestActions   See description and the config file.
   1.194 +//! @SYMTestExpectedResults
   1.195 +//!                  The second data to be bound gets written to the cell,
   1.196 +//!                  a PASS will be reported.
   1.197 +//! @SYMREQ           REQ5792
   1.198 +
   1.199 +CONSECUTIVE
   1.200 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini DoubleBind
   1.201 +END_TESTCASE SYSLIB-SQL-CIT-1742
   1.202 +
   1.203 +START_TESTCASE SYSLIB-SQL-CIT-1798
   1.204 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1798
   1.205 +//! @SYMTestCaseDesc  A simple test using the OpenL and CreateL methods.
   1.206 +//! @SYMTestPriority  High
   1.207 +//! @SYMTestActions   See description and the config file.
   1.208 +//! @SYMTestExpectedResults
   1.209 +//!                  Checks for appropriate error codes from the APIs called
   1.210 +//!                  and reports a PASS.
   1.211 +//! @SYMREQ           REQ5792
   1.212 +
   1.213 +CONSECTUTIVE
   1.214 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini LeaveMethods
   1.215 +END_TESTCASE SYSLIB-SQL-CIT-1798
   1.216 +
   1.217 +RUN_UTILS DeleteFile C:\Leave1.db
   1.218 +RUN_UTILS DeleteFile C:\MCO1.db
   1.219 +RUN_UTILS DeleteFile C:\MCO2.db
   1.220 +RUN_UTILS DeleteFile C:\MCO3.db
   1.221 +RUN_UTILS DeleteFile C:\MCO4.db
   1.222 +RUN_UTILS DeleteFile C:\MCO5.db
   1.223 +
   1.224 +START_TESTCASE SYSLIB-SQL-CIT-1799
   1.225 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1799
   1.226 +//! @SYMTestCaseDesc  Tests the effect of multiple sequential Creates and Opens.
   1.227 +//! @SYMTestPriority  High
   1.228 +//! @SYMTestActions   See description and the config file.
   1.229 +//! @SYMTestExpectedResults
   1.230 +//!                  Verifies that multiple Creates and Opens with the same
   1.231 +//!                  RSqlDatabase object does not generate an error. You
   1.232 +//!                  might expect a PANIC but you'd be wrong! Note the
   1.233 +//!                  deletes afterwards, these clean up where we can't because
   1.234 +//!                  all of the databases get locked.
   1.235 +//! @SYMREQ           REQ5792
   1.236 +
   1.237 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini MultipleCreateOpen
   1.238 +END_TESTCASE SYSLIB-SQL-CIT-1799
   1.239 +
   1.240 +RUN_UTILS DeleteFile C:\Leave1.db
   1.241 +RUN_UTILS DeleteFile C:\MCO1.db
   1.242 +RUN_UTILS DeleteFile C:\MCO2.db
   1.243 +RUN_UTILS DeleteFile C:\MCO3.db
   1.244 +RUN_UTILS DeleteFile C:\MCO4.db
   1.245 +RUN_UTILS DeleteFile C:\MCO5.db
   1.246 +
   1.247 +START_TESTCASE SYSLIB-SQL-CIT-1830
   1.248 +//! @SYMTestCaseID    SYSLIB-SQL-CIT-1830
   1.249 +//! @SYMTestCaseDesc  Further bind tests.
   1.250 +//! @SYMTestPriority  High
   1.251 +//! @SYMTestActions   See description and the config file.
   1.252 +//! @SYMTestExpectedResults
   1.253 +//!                  A couple of tests that verify that a bind can be used
   1.254 +//!                  in combination with a SELECT to fetch data from a table
   1.255 +//!                  based on parameters in the bind. The first one uses
   1.256 +//!                  integers, the second a binary field (though it's defined
   1.257 +//!                  as text in the 'Create table' line). For no special
   1.258 +//!                  reason we run these concurrently. It isn't really a
   1.259 +//!                  concurrency test, just two tests executing concurrently.
   1.260 +//! @SYMREQ           REQ5792
   1.261 +
   1.262 +CONCURRENT
   1.263 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini ExtraBindTest
   1.264 +	RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini ExtraBindTest2
   1.265 +END_TESTCASE SYSLIB-SQL-CIT-1830
   1.266 +