Equality Comparison

Since its inception, dbUnit has had equality comparison for expected vs actual data results. This enables comparing actual table results to expected results in an equal manner.

The Assertion and DbUnitAssert classes have assertEquals() methods for the equality comparisons.

ValueComparer Comparison

Introduced in Release 2.6.0, the ValueComparer is a strategy interface enabling any type of comparison, not only equality. This enables comparing difficult column values such as auto-incrementing ids and timestamps, whether using a simple greater than or less than comparison or a complex multi-column-based criteria to choose the comparison strategy.

The ValueComparers class has singleton instances of ones provided by dbUnit.

The Assertion and DbUnitValueComparerAssert classes have assertWithValueComparer() methods for the ValueComparer comparisons.

PrepAndExpectedTestCase directly supports ValueComparer in addition to equality comparison.