File | Place In | Needed To | |||
---|---|---|---|---|---|
Enhance Apps | Run Apps | Build TJDO | Test TJDO | ||
jdo.jar commons-logging-version.jar |
lib/ | X | X | X | X |
jdori.jar | lib/ | X | X | ||
jta.jar | lib/ | X | X | X | |
ojdbc14.jar | lib/ | X* | X* | X* | |
junit.jar (v1.8+) | $ANT_HOME/lib | X | |||
commons-collections.jar commons-dbcp.jar commons-pool.jar |
lib/test | X* | |||
DBMS-specific jars | lib/test/dbname | X |
* = optional.
to see the available targets.ant -projecthelp
The unit test suite includes tests that perform a fairly thorough exercise of TJDO using a real database.
To run the TJDO unit tests:
Create a lib/test/dbname directory containing the following:
The properties file must define JDBC connection parameters by including the following:
database.driver=JDBC driver class name database.url=JDBC driver URL database.user=Database user name (if needed) database.password=Database password (if needed)
To see all the databases you have setup in lib/test, type:
ant get-db-list
To run the tests on a specific database, type either of:
The latter runs the all the tests twice; once with auto-created tables and once again with existing tables, which helps test schema validation.ant -Ddb=dbname unit-tests ant -Ddb=dbname unit-tests-twice
To run the tests on all defined databases type:
ant unit-tests-all
A test_results/ directory will be created to hold the results of individual test runs. Ant's <junitreport> task is used to generate pretty JUnit test result pages.