Next: HTTPUnit and/or HTMLUnit testing
Up: Test categories
Previous: JUnit testing
DbUnit is a useful and powerful tool for simplifying unit testing of database
operations. It extends JUnit framework, that was described in the previous
point. With DbUnit, a database can be seeded with a desired data set before
a test; moreover, at the completion of the test, the database can be placed
back into its pre-test state. DbUnit has a few extremely useful
features
for unit testing of database operations, for instance:
- -
- a very simple XML-based mechanism for loading test data
- -
- a framework which simplifies operations for each stage in the
the life cycle of individual database tests
- -
- an equally simple mechanism for exporting existing test data into
the XML format for subsequent use in automated tests
- -
- methods for comparing data, between flat files, queries and
database tables
Wiktor Kolodziej
2006-01-12