Open main menu

CDOT Wiki β

Changes

Run Junit Tests For Non Default SQL Adapter

59 bytes removed, 14:47, 26 February 2011
no edit summary
[[category: Debugging]][[category: NexJ Express Development]][[category: NexJ Express]]
== Debugging a Non-Default SQL Adapter ==
=== Summary ===
By default, NexJ Express Unit tests are configured to test the MySQL Adapter.<br>
''For this manual, reference will be made to the PostgreSQL Adapter but it will work the same for other adapters''<br>
=== Prerequisites ===
#The following files must exist for the new SQL Adapter:<br>
##'''src''' folder
#:<code>nexj.core.util.JDBCInfo.java</code>
=== Configurations ===
The following will configure the unit tests to run for [DbName]SQLAdapter and [DbName]SQLSchemaManager
==== Environment/Connection Files ====
These files are located in the ''test'' source folder in the package <code>nexj</code>
## Change all occurrences of <code>port="3306"</code> to the port on which the new DbName is configured to accept connections
##: For the PostgreSQL Adapter, the following configuration is used
 
<source lang="xml">
<DataSourceConnections>
</DataSourceConnections>
</source>
 
#Create a connections file for the new adapter
## Create the file '''[DbName].connections''' in the <code>nexj</code> package in the ''test'' source folder
## Change all occurrences of <code>port="3306"</code> to the port on which the new DbName is configured to accept connections
##: For the PostgreSQL Adapter, the following configuration is used
 
<source lang="xml">
<DataSourceConnections>
</source>
==== SQL Scripts ====
These scripts are used to:
#### (*Optional) Schema Name: test
==== SQL Test Suite ====
The following will add the new unittests to the SQL test suite
#Edit the file <code>nexj.core.persistence.sql.AllTests.java</code> and add an entry for the new SQL adapter
</source>
==== Run Unit Tests====
# '''Create the test database'''
#: Run the <code>dbname_setup.sql</code> script that was created above to create the test database and user
# Run the unit tests using Eclipse's junit test runner
1
edit