Can someone tell me how to test active objects against multiple databases? I want to unit test my plugin (or at least my AO code) against all the major databases: MySQL, MS-SQL, Oracle, Postgres.
I see that there is something called "DynamicJdbcConfiguration" which according to the JavaDoc is: "A JDBC configuration that can be configured through either system properties or a configuration file." Does anyone have an example of how to use this "DynamicJdbcConfiguration" for multiple databases?
first you should probably read this first document, but I'm sure you have. This explains the configuration of the testing framework for a single database, and also mentions some important information relating to @NameConverters that should be used when testing your plugin.
Now if you want to test against multiple databases, I suggest you use the following strategy, which is used both in the AO lib and the AO plugin itself:
This should get you started. Running your tests should be as simple as running mvn install -P'database'.
Some things to note:
I hope that clarifies things a bit. Don't hesitate to comment if you need more info, I'll be happy to provide.
According to the presentation of Jason Hinch on ActiveObjects (Slides available here: https://developer.atlassian.com/display/DOCS/Atlascamp+2011+-+Using+Active+Objects+for+Rapid+Plugin+Development) you have to use the DynamicJdbcConfiguration class in Jdbc annotation and set the database via a property.
To test with oracle database -Dao.test.database=oracle
I suspected that DynamicJdbcConfiguration was the way to go but I need more info...
How do I tell the DynamicJdbcConfiguration where my database is (URL, user&pass)? And how would I test all the databases in one go? Do you use maven profiles? Can you give us an example of how you set the tests up?
Best regards and thanks again,