Package org.dbunit.annotation
Annotation Interface DbUnitVerifyTable
Full per-table verification rules for one table, nested inside
DbUnitExpected.verify(): column include/exclude filters, value comparers, and sort
mode. Maps directly onto a VerifyTableDefinition.
An empty include() (the default) means include every column, since an
annotation cannot express null and VerifyTableDefinition distinguishes
null (include all) from an empty array (include nothing) - the latter being a
degenerate setting nobody wants, so it is not expressible here.
For a shared, reusable table definition - especially one needing a configured
ValueComparer instance that has no no-arg constructor - prefer a
VerifyTableDefinitionsProvider catalog over this inline form;
see DbUnitExpected.verifyDefinitions().
- Since:
- 3.6.0
- Author:
- Jeff Jensen
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionPer-columnValueCompareroverrides.Class<? extends ValueComparer> TheValueComparerto use for columns not named incolumnComparers(), instantiated with its no-arg constructor and cached for the JVM's entire lifetime, keyed by class - seeDbUnitColumnComparerfor the resulting purity requirement on a customValueComparer.String[]Column names to exclude from comparison.String[]Column names to include in comparison, to the exclusion of all others.booleanWhether to sort the expected and actual tables by only this table's filtered columns (post exclude/include) instead of by all of the actual table's native columns.
-
Element Details
-
value
String valueThe name of the table to verify.- Returns:
- The table name.
-
exclude
String[] excludeColumn names to exclude from comparison. Composes withinclude()when both are set: the included set, minus these.- Returns:
- The column names to exclude; empty (the default) excludes none.
- Default:
{}
-
include
String[] includeColumn names to include in comparison, to the exclusion of all others.- Returns:
- The column names to include; empty (the default) includes every column.
- Default:
{}
-
defaultComparer
Class<? extends ValueComparer> defaultComparerTheValueComparerto use for columns not named incolumnComparers(), instantiated with its no-arg constructor and cached for the JVM's entire lifetime, keyed by class - seeDbUnitColumnComparerfor the resulting purity requirement on a customValueComparer.- Returns:
- The default comparer class; the interface itself (the default) means "not set", leaving dbUnit's own default comparer in effect.
- Default:
org.dbunit.assertion.comparer.value.ValueComparer.class
-
columnComparers
DbUnitColumnComparer[] columnComparersPer-columnValueCompareroverrides.- Returns:
- The column comparer bindings; empty (the default) applies
defaultComparer()to every column.
- Default:
{}
-
sortOnFilteredColumnsOnly
boolean sortOnFilteredColumnsOnlyWhether to sort the expected and actual tables by only this table's filtered columns (post exclude/include) instead of by all of the actual table's native columns.- Returns:
- True to sort by only the filtered columns; defaults to false.
- See Also:
- Default:
false
-