Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,871 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DbUnit

Build Status Reproducible Builds

DbUnit is a mature, proven JUnit extension, founded in 2002, targeted at database-driven projects that, among other things, puts the 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 data and causes subsequent tests to fail or exacerbate the damage.

dbUnit hooks into JUnit 5/6 (Jupiter; JUnit 4 support was dropped in 3.0.0) either by composing an IDatabaseTester into your test class (the preferred style) or by extending DBTestCase.

  • Reads and writes Flat XML, XML, CSV, YAML, and Excel datasets, built from files, code, or a live query.

  • INSERT, UPDATE, DELETE, REFRESH (upsert), CLEAN_INSERT, and other composable database operations.

  • ValueComparer assertions beyond strict equality — tolerance (numeric and timestamp), greater-than/less-than, null checks, string containment, and ignore-millis timestamps.

  • Vendor-specific support for 9 databases — DB2, H2, HSQLDB, Mckoi, MSSQL, MySQL, Netezza, Oracle, and PostgreSQL.

  • Usable outside of tests too, via its Ant Integration task or the companion dbunit-maven-plugin, for data import/export.

New here? The fastest way to get started is the dbUnit in 5 Minutes tutorial.

Documentation

The full documentation site, including guides, reference pages, and the FAQ, is at https://dbunit.github.io/dbunit-extension/.

Using dbUnit

DbUnit is published to Maven Central under org.dbunit:dbunit. See Maven Repositories for the dependency snippet and snapshot repository setup.

Getting Help

If you found a bug or have an enhancement request, create an issue at https://github.com/dbunit/dbunit-extension/issues.

If you have questions, ideas, or want to get involved, start a discussion at https://github.com/dbunit/dbunit-extension/discussions.

We are a small team working on improvements and issues along the way and need more help — we will gladly help you as needed with your ideas and contributions and look to add you as a committer when ready.

Releases

Packages

Used by

Contributors

Languages