I have an application that uses databases through jdbc API (in fact spring jdbc template). We want to run our unit tests against more type of databases (MS SQL, Oracle, Postgre);
Thus to run a test (for example with maven) that will run a unit tests 3x times, for each specified databases.
How to elegantly solve this?
(I was thinking in a own implementation of JUnit runner, but we have also Spock tests)
The fundamental question is how to run the same test multiple times with different DB settings. You could either implement this at the test framework level (e.g. with a custom JUnit runner or as a DBUnit/Unitils extension) or at the build tool level (if your build tool is flexible enough). In both cases it should be possible to have one implementation that works with JUnit and Spock. (By the way, Spock provides Unitils integration out-of-the-box).