os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/scripts/BasicSQL2.script
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // @file
    15 // 
    16 //
    17 
    18 //! @SYMTestSuiteName PDS-TEF-SQL-SUITE
    19 //! @SYMScriptTestEnvironment TEF
    20 //! @internalComponent
    21 //! @test
    22 
    23 PRINT Run SQL Tests
    24 
    25 LOAD_SUITE te_SQL_Suite
    26 
    27 START_TESTCASE SYSLIB-SQL-CIT-1684
    28 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1684
    29 //! @SYMTestCaseDesc  Perform some basic operations (see the config file for
    30 //!                  full details).
    31 //!                  Runs most of the RSqlDatabase methods, checking for
    32 //!                  expected errors and error messages as it goes. Then
    33 //!                  triggers the 'rsqlstatement' block using the same
    34 //!                  'RSqlDatabase' object and runs most RSqlStatement methods
    35 //!                  again checking for errors and so on. Includes 'Bind' calls
    36 //!                  and retrieval of data with 'ColumnText' etc.
    37 //! @SYMTestPriority  High
    38 //! @SYMTestActions   See description and the config file.
    39 //! @SYMTestExpectedResults
    40 //!                  The test looks for specific error codes and content
    41 //!                  within the database. If these are not seen test errors
    42 //!                  will be generated.
    43 //!                  
    44 //! @SYMREQ           REQ5792
    45 
    46 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini Top
    47 END_TESTCASE SYSLIB-SQL-CIT-1684
    48 
    49 START_TESTCASE SYSLIB-SQL-CIT-1685
    50 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1685
    51 //! @SYMTestCaseDesc  Perform further basic operations (see the config file for
    52 //!                  full details).
    53 //!                  Add a new field to the table created in the database
    54 //!                  created in the last test. Attempts some exceptions (e.g
    55 //!                  getting a ParameterIndex for a non-existent field),
    56 //!                  checks 'ColumnType' and the output of 'Next' and 'AtRow'.
    57 //!                  Deletes the db on completion.
    58 //! @SYMTestPriority  High
    59 //! @SYMTestActions   See description and the config file.
    60 //! @SYMTestExpectedResults
    61 //!                  The test looks for specific error codes and content
    62 //!                  within the database. If these are not seen test errors
    63 //!                  will be generated.
    64 //!                  
    65 //! @SYMREQ           REQ5792
    66 
    67 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini AddtoTable
    68 END_TESTCASE SYSLIB-SQL-CIT-1685
    69 
    70 START_TESTCASE SYSLIB-SQL-CIT-1686
    71 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1686
    72 //! @SYMTestCaseDesc  'StreamWrite' bind test. Creates a new db, creates a
    73 //!                  table and writes to a cell in the table using
    74 //!                  the 'BindText' method within 'RSqlParamWriteStream'.
    75 //!                  Retrieve the content from the cell using the various
    76 //!                  'ColumnText' methods of RSqlStatement and also the
    77 //!                  'ColumnText' method of RSqlColumnReadStream and check
    78 //!                  for correct content.
    79 //!                  Now also has an integer field within the table which
    80 //!                  checks the BindInt and ColumnInt methods as well as
    81 //!                  the text methods mentioned above. This change is to
    82 //!                  check for the problem of the first stream write failing
    83 //!                  to store anything if done in conjunction with any other
    84 //!                  bind (which was fixed by cl@764944).
    85 //!                  Deletes the db on completion.
    86 //! @SYMTestPriority  High
    87 //! @SYMTestActions   See description and the config file.
    88 //! @SYMTestExpectedResults
    89 //!                  The test looks for specific error codes and content
    90 //!                  within the database. If these are not seen test errors
    91 //!                  will be generated.
    92 //!                  
    93 //! @SYMREQ           REQ5792
    94 
    95 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini SWBindText
    96 END_TESTCASE SYSLIB-SQL-CIT-1686
    97 
    98 START_TESTCASE SYSLIB-SQL-CIT-1687
    99 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1687
   100 //! @SYMTestCaseDesc  'StreamWrite' bind test. Creates a new db, creates a
   101 //!                  table and writes to a cell in the table using
   102 //!                  the 'BindBinary' method within 'RSqlParamWriteStream'.
   103 //!                  Retrieve the content from the cell using the various
   104 //!                  'ColumnBinary' methods of RSqlStatement and also the
   105 //!                  'ColumnBinary' method of RSqlColumnReadStream and check
   106 //!                  for correct content.
   107 //!                  Deletes the db on completion.
   108 //! @SYMTestPriority  High
   109 //! @SYMTestActions   See description and the config file.
   110 //! @SYMTestExpectedResults
   111 //!                  The test looks for specific error codes and content
   112 //!                  within the database. If these are not seen test errors
   113 //!                  will be generated.
   114 //! @SYMREQ           REQ5792
   115 
   116 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini SWBindBinary
   117 END_TESTCASE SYSLIB-SQL-CIT-1687
   118 
   119 START_TESTCASE SYSLIB-SQL-CIT-1699
   120 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1699
   121 //! @SYMTestCaseDesc  Uses the test1.db (in ROM) to test counting of lines,
   122 //!                  calculation of averages and sums in a table and so on.
   123 //!                  This requires that ColumnInt/Real etc access an unnamed
   124 //!                  column (column zero).
   125 //! @SYMTestPriority  High
   126 //! @SYMTestActions   See description and the config file.
   127 //! @SYMTestExpectedResults
   128 //!                  The sums, averages etc are correctly calculated and the
   129 //!                  test reports a PASS.
   130 //! @SYMREQ           REQ5792
   131 
   132 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini Countlines
   133 END_TESTCASE SYSLIB-SQL-CIT-1699
   134 
   135 START_TESTCASE SYSLIB-SQL-CIT-1746
   136 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1746
   137 //! @SYMTestCaseDesc  Tests basic transaction behaviour and a simple level
   138 //!                  of concurrency. A single record is added to a table.
   139 //!                  Then, within a transaction three more are added.
   140 //!                  At this point two concurrent threads (one ESerializable,
   141 //!                  one EReadUncommitted) check the content of the table.
   142 //!                  After checking the transaction is rolled back.
   143 //! @SYMTestPriority  High
   144 //! @SYMTestActions   See description and the config file.
   145 //! @SYMTestExpectedResults
   146 //!                  The ESerializable thread is unable to read the table
   147 //!                  because it is locked. The EReadUncommitted read it fine.
   148 //! @SYMREQ           REQ5792
   149 //!                  REQ5793
   150 
   151 CONCURRENT
   152 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread2
   153 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread3
   154 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini Thread1
   155 END_TESTCASE SYSLIB-SQL-CIT-1746
   156 
   157 
   158 START_TESTCASE SYSLIB-SQL-CIT-1747
   159 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1747
   160 //! @SYMTestCaseDesc  Verifies the rollback on the last test performed properly.
   161 //! @SYMTestPriority  High
   162 //! @SYMTestActions   See description and the config file.
   163 //! @SYMTestExpectedResults
   164 //!                  The table reads without error, it contains 1 record.
   165 //! @SYMREQ           REQ5792
   166 
   167 CONSECUTIVE
   168 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini CheckFollowingRollback
   169 END_TESTCASE SYSLIB-SQL-CIT-1747
   170 
   171 START_TESTCASE SYSLIB-SQL-CIT-1745
   172 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1745
   173 //! @SYMTestCaseDesc  Verifies that streams behave - we pass a read stream
   174 //!                  to a write stream.
   175 //! @SYMTestPriority  High
   176 //! @SYMTestActions   See description and the config file.
   177 //! @SYMTestExpectedResults
   178 //!                  Runs without error.
   179 //! @SYMREQ           REQ5792
   180 
   181 CONSECUTIVE
   182 	RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini CopyCellsWithStreams
   183 END_TESTCASE SYSLIB-SQL-CIT-1745
   184 
   185 START_TESTCASE SYSLIB-SQL-CIT-1742
   186 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1742
   187 //! @SYMTestCaseDesc  A simple test of the effect of two binds without an
   188 //!                  exec/reset between them.
   189 //! @SYMTestPriority  High
   190 //! @SYMTestActions   See description and the config file.
   191 //! @SYMTestExpectedResults
   192 //!                  The second data to be bound gets written to the cell,
   193 //!                  a PASS will be reported.
   194 //! @SYMREQ           REQ5792
   195 
   196 CONSECUTIVE
   197 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini DoubleBind
   198 END_TESTCASE SYSLIB-SQL-CIT-1742
   199 
   200 START_TESTCASE SYSLIB-SQL-CIT-1798
   201 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1798
   202 //! @SYMTestCaseDesc  A simple test using the OpenL and CreateL methods.
   203 //! @SYMTestPriority  High
   204 //! @SYMTestActions   See description and the config file.
   205 //! @SYMTestExpectedResults
   206 //!                  Checks for appropriate error codes from the APIs called
   207 //!                  and reports a PASS.
   208 //! @SYMREQ           REQ5792
   209 
   210 CONSECTUTIVE
   211 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini LeaveMethods
   212 END_TESTCASE SYSLIB-SQL-CIT-1798
   213 
   214 RUN_UTILS DeleteFile C:\Leave1.db
   215 RUN_UTILS DeleteFile C:\MCO1.db
   216 RUN_UTILS DeleteFile C:\MCO2.db
   217 RUN_UTILS DeleteFile C:\MCO3.db
   218 RUN_UTILS DeleteFile C:\MCO4.db
   219 RUN_UTILS DeleteFile C:\MCO5.db
   220 
   221 START_TESTCASE SYSLIB-SQL-CIT-1799
   222 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1799
   223 //! @SYMTestCaseDesc  Tests the effect of multiple sequential Creates and Opens.
   224 //! @SYMTestPriority  High
   225 //! @SYMTestActions   See description and the config file.
   226 //! @SYMTestExpectedResults
   227 //!                  Verifies that multiple Creates and Opens with the same
   228 //!                  RSqlDatabase object does not generate an error. You
   229 //!                  might expect a PANIC but you'd be wrong! Note the
   230 //!                  deletes afterwards, these clean up where we can't because
   231 //!                  all of the databases get locked.
   232 //! @SYMREQ           REQ5792
   233 
   234 	RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini MultipleCreateOpen
   235 END_TESTCASE SYSLIB-SQL-CIT-1799
   236 
   237 RUN_UTILS DeleteFile C:\Leave1.db
   238 RUN_UTILS DeleteFile C:\MCO1.db
   239 RUN_UTILS DeleteFile C:\MCO2.db
   240 RUN_UTILS DeleteFile C:\MCO3.db
   241 RUN_UTILS DeleteFile C:\MCO4.db
   242 RUN_UTILS DeleteFile C:\MCO5.db
   243 
   244 START_TESTCASE SYSLIB-SQL-CIT-1830
   245 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1830
   246 //! @SYMTestCaseDesc  Further bind tests.
   247 //! @SYMTestPriority  High
   248 //! @SYMTestActions   See description and the config file.
   249 //! @SYMTestExpectedResults
   250 //!                  A couple of tests that verify that a bind can be used
   251 //!                  in combination with a SELECT to fetch data from a table
   252 //!                  based on parameters in the bind. The first one uses
   253 //!                  integers, the second a binary field (though it's defined
   254 //!                  as text in the 'Create table' line). For no special
   255 //!                  reason we run these concurrently. It isn't really a
   256 //!                  concurrency test, just two tests executing concurrently.
   257 //! @SYMREQ           REQ5792
   258 
   259 CONCURRENT
   260 	RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini ExtraBindTest
   261 	RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini ExtraBindTest2
   262 END_TESTCASE SYSLIB-SQL-CIT-1830
   263