DbUnit is a JUnit extension (also usable with Ant) targeted for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to fail or exacerbate the damage.
Note on SLF4j
When using DbUnit, you must therefore download SLF4J and include slf4j-api-*.jar and the implementation library of your choice in the classpath: for example, slf4j-log4j12-*.jar for Log4J, or slf4j-jcl-*.jar for commons-logging. However, make sure there is only one implementation library in your classpath, as failing to do so might cause some issues. Please see the SLF4J website for more details.
- BuildingDbUnit - Detailed instructions to build DbUnit
- Getting Started - How to get started with DbUnit?
- SupportedRDBMS - List of supported RDBMS with comments from various users. Add yours!
- DbUnitFaq - Errata, precisions or additions to the official DbUnit FAQ
- ChangesSinceLastRelease - Changes available from the Subversion repository
Database Testing Related topics
- NDbUnit - A .NET database unit testing framework
- Data Storm A free embedable database viewer that enables you to view data that will be rolled back at the end of the test. Very good for fixing failing tests.
- Jailer Database Subsetting Tool, extracts data from productive databases and generates flat XML dataset files.
dbUnit 3.0 Planning
- dbunit-3-0-roadmap Roadmap