Just add that the current db test infraestructure includes automatic test running under multiple JPA implementations (Hibernate, OpenJPA and TopLink) and multiple databases (hsqldb and Mysql).
i did see the setup's for testing the different jpa impls. i didn't yet see how you wanted to test multiple databases.
please have a look at my proposal at http://wiki.jboss.org/wiki/attach?page=JbpmPvm%2Fpvm-new-test-strategy.zip
it contains a mechanism on how to configure for multiple db in combination with a set of jpa impls.
but on top, it uses the command pattern. so that all features can be tested *with* and *without* persistence in the same test.
for the multiple db in combination with the jpa implementations, i use the TestSetup mechanism, but with one extra level of nesting. i took the databases as the lowest level and the jpa implementations as the highest level.
if tests are now executed in commands (or in try-finally blocks), they take the configuration which is a combination of the database and the jpa impl.
can you guys take a look and let me know what you think ?
I made some persistence updates:
-implementation for cleanDb() :
for Hibernate's implementation it is based on http://www.jboss.com/index.html?module=bb&op=viewtopic&t=117241 (there was a problem with mysql because an index is created with the foreign key and is not dropped)
-persistence sessions and factories listen to their context and are closed when the context is closed:
this way connections and other resources used by entitymanager are automatically released.
-tests to run are described in an xml file and configuration files for db tests can be in a separate directory:
If an environment variable "PVM_CONFIG_DIR" is defined (and points to a directory), the test DbProviderTests will try to load a file "db-tests.xml" in this directory.
This file is a xml property file as defined in java.util.Properties. For each entry
<entry key="testName">config_file.xml</entry>a test setup will be created with the name "testName" and the environment defined in 'PVM_CONFIG_DIR/config_file.xml'
This can be used to define a specific test configuration that is not in the svn (and to test multiple databases).
If the environment variable is not set, the file "db-tests.xml" from test/java/org/jbpm/db will be used.
Do you think this test infrastructure is flexible enough for our db tests ?