2007-03-16 Andreia Gaita <avidigal@novell.com>
[mono.git] / mcs / class / System.Data / Test / ProviderTests / README
1 RUN
2 ===
3
4 Do this Once before running tests
5 ---------------------------------
6         * edit the connection string (app setting entry "ConnString")
7                - if you want to run odbc test cases, edit odbc.config
8                and edit the entry with "ConnString" with appropriate
9                DSN, User Id and Password.
10
11        * run the sql schema and test pool data under directory sql to
12          the respective databases, using a appropriate client.
13
14          eg. 
15              tsql -S server -U user -P pwd < sql/sqlserver.sql
16                  mysql -u user -p < sql/mysql.sql
17
18 To run the tests
19 ----------------
20
21         * make clean
22         * make run-test DATABASE=<ur-database>
23         valid database strings are :
24               sqlserver, odbc
25
26 GUIDELINES for test-case developers
27 ----------------------------------
28
29         general
30         =======
31         
32         * Provider specific test case to go into their specific
33           subfolders named after their namespaces. All odbc specific
34           test-cases to go into System.Data.Odbc, etc.
35
36         * all tables to have a unique id column
37
38         * if you modify any data from a test case make sure, you
39           revert it at the end of test case, either through
40           try..finally block or using transactions
41
42         * if you intend to insert from code, insert value above 6000
43           (randomly chosen)
44
45
46         * if you create a stored procedure from code, create with a
47           prefix 'tmp_'.
48
49         * if you create a table from code, create with a prefix
50           'tmp_'.
51
52         sqlserver
53         =========
54
55          * for temporary per-test-case tables/stored-procedures, prefix
56            the name with "#" so that mssql removes the object
57            automatically.
58
59
60 Extending to a new database
61 ---------------------------
62
63         * All new databases can run the tests provided in
64           ProviderIndependant tests. Include your category in each of
65           the test cases. Say, if you want to extend these test cases
66           to a database provider 'xyz', include a line [Category
67           ("xyz")] with each of the test cases.
68
69         * add a sql script file for you database to generate the test
70           data with same name you have given to the category with an
71           extension ".sql". For example, write a script file "xyz.sql"
72           under the sub-directory "sql".
73           
74                 The test pool data can be obtained from either of the
75           existing sql script files say "mysql.sql".
76
77                 If your database does not support a datatype that are
78           used in other database script files, do *not* remove the
79           datatype instead, add a datatype nearly matching your local
80           type. For example, if your database does not support bigint,
81           add a column named type_bigint, but with type as "numeric
82           (19,0)".
83
84         * Add a subdirectory with the name of the your provider's
85           namespace. If your provider is, say, XYZ, with namespace
86           System.Data.XYZ, Add a sub-directory System.Data.XYZ. Add
87           your provider specific tests to this directory with each
88           test case assigned to your category.
89
90         * Add an application config file named after your database
91           name, same as the category name. Add an application key
92           called ConnString with the correct Connection String to your
93           database. This entry will be changed by the user when he
94           wants to run test on a different physical database.
95
96
97     IMPORTANT:
98         * Do *not* move any of the test cases to generic until you are
99         sure that they will run in all databases that are categorized.