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