Here's what I imagine would be the ideal way to test my application:
1. Create two flat-file databases with all the tables and rows the testcases need, one with the initial values and one with what the database should look like after the tests are run (one-time event)
2. In the test harness, load the flat-file database
3. Call the test cases, modifying Hibernate objects like normal
4. Compare the initial and resultant databases, asserting if they don't match
Is this possible? It would seem DbUnit allows flat-file database creation and comparison, but I have no idea how to integrate DbUnit into my Hibernate web application (more specifically, how to make Hibernate use the DbUnit database; all the examples I've seen use straight JDBC and don't interface with Hibernate at all).
|