A you have seen, I think of testing for multiple database, in the IBatisNet.Test.dll.config, you can find some keys to set the database testing

<appSettings>

            <!-- To test MySql set value="MySql"  (to do)-->

            <!-- To test Oracle set value="Oracle"  (to do)-->            

            <!-- To test MS Sql Server set value="MSSQL"  -->                    

            <add key="database" value="MSSQL"/>

            <!-- To test MS SqlServer via SqlClient value="SqlClient"  -->

            <!-- To test MS SqlServer via OleDb value="OleDb"  -->

            <!-- To test MS SqlServer via Odbc value="Odbc"  -->

            <add key="providerType" value="SqlClient"/>

</appSettings>

As it is for now, you can test for one database/provider.

In directory statementTest, you have a directory MSSQL but it only test procedure or SQL specific to MSSQL that must be marked by Category(“MSSQL”)]as you noted (you can go it for that, +1).

The directory IBatisNet.Test\Scripts already contains directory for MSSQL, Oracle, MySQL. Oracle and MySQL directories are empty and ready to be filled J

 

You can create a package Oracle (+1) to test specific sql to Oracle but the base test of SqlMapTests/*.cs must be passed by the couple database/provider Oracle/OracleClient or Oracle/Oledb…

 

For the Init() structure I don’t see what you want to change as in general it call InitSqlMap() which already depend of the the couple database/provider being tested and it is internal to a test file.

You can go to reworking ScriptRunner with a switch case on datasource if it can help you run an oracle DDL script.

 

-Gilles

 


De : roberto [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 23 décembre 2004 05:16
À : ibatis-user-cs@incubator.apache.org
Objet : Update NUnit tests for different databases?

 

Could we change the Init() structure to accommodate running different SQL scripts depending on the database being tested? 

 

I’ve resorted to separating out the various Oracle statements into their own SQL files and modifying the Init() methods of the current tests.  I briefly toyed with the idea of using EXECUTE IMMEDIATE and reworking the ScriptRunner to use an Oracle package with ref cursors to run the DDL statements in one script/command text but quickly got over it!

 

Anyway, I think the project may already have been headed in this direction given the MSSQL tests in their own namespace.

 

For example:

 

Make NUnit.SqlMapTests.StatementTest abstract.  Create an NUnit.SqlMapTests.Oracle namespace (like the existing MSSQL namespace).  And create an NUnit.SqlMapTests.Oracle.StatementTest with a different Init().

 

Additionally, we can tag the specific db tests by NUnit Category such as [Category(“MSSQL”)], [Category(“MySQL”)], and [Category(“Oracle”)] or use some other convention.

 

Roberto

 


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.3 - Release Date: 21/12/2004


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.3 - Release Date: 21/12/2004

Reply via email to