os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/scripts/BasicSQL2.script
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 //! @SYMTestSuiteName PDS-TEF-SQL-SUITE
19 //! @SYMScriptTestEnvironment TEF
20 //! @internalComponent
25 LOAD_SUITE te_SQL_Suite
27 START_TESTCASE SYSLIB-SQL-CIT-1684
28 //! @SYMTestCaseID SYSLIB-SQL-CIT-1684
29 //! @SYMTestCaseDesc Perform some basic operations (see the config file for
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.
46 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini Top
47 END_TESTCASE SYSLIB-SQL-CIT-1684
49 START_TESTCASE SYSLIB-SQL-CIT-1685
50 //! @SYMTestCaseID SYSLIB-SQL-CIT-1685
51 //! @SYMTestCaseDesc Perform further basic operations (see the config file for
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.
67 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini AddtoTable
68 END_TESTCASE SYSLIB-SQL-CIT-1685
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.
95 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini SWBindText
96 END_TESTCASE SYSLIB-SQL-CIT-1686
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.
116 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini SWBindBinary
117 END_TESTCASE SYSLIB-SQL-CIT-1687
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.
132 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic.ini Countlines
133 END_TESTCASE SYSLIB-SQL-CIT-1699
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.
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
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.
168 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini CheckFollowingRollback
169 END_TESTCASE SYSLIB-SQL-CIT-1747
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.
182 RUN_TEST_STEP 100 te_SQL_Suite CSQLCDT z:\TEF_SQL\APIBasic2.ini CopyCellsWithStreams
183 END_TESTCASE SYSLIB-SQL-CIT-1745
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.
197 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini DoubleBind
198 END_TESTCASE SYSLIB-SQL-CIT-1742
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.
211 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini LeaveMethods
212 END_TESTCASE SYSLIB-SQL-CIT-1798
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
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.
234 RUN_TEST_STEP 100 te_SQL_Suite CSQLDDT z:\TEF_SQL\APIBasic2.ini MultipleCreateOpen
235 END_TESTCASE SYSLIB-SQL-CIT-1799
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
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.
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