Package org.dbunit.assertion
Class DbUnitValueComparerAssert
java.lang.Object
org.dbunit.assertion.DbUnitAssertBase
org.dbunit.assertion.DbUnitValueComparerAssert
DbUnit assertions using
ValueComparers for the column comparisons.- Since:
- 2.6.0
- Author:
- Jeff Jensen
-
Field Summary
Fields inherited from class org.dbunit.assertion.DbUnitAssertBase
valueComparerDefaults -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet) Asserts the two specifiedIDataSets comparing their columns using the defaultValueComparerand handles failures using the defaultFailureHandler.voidassertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet, ValueComparer defaultValueComparer) Asserts the two specifiedIDataSets comparing their columns using the specified defaultValueComparer and handles failures using the defaultFailureHandler.voidassertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet, ValueComparer defaultValueComparer, Map<String, Map<String, ValueComparer>> tableColumnValueComparers) Asserts the two specifiedIDataSets comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the defaultFailureHandler.voidassertWithValueComparer(ITable expectedTable, ITable actualTable) Asserts the two specifiedITables comparing their columns using the defaultValueComparerand handles failures using the defaultFailureHandler.voidassertWithValueComparer(ITable expectedTable, ITable actualTable, ValueComparer defaultValueComparer) Asserts the two specifiedITables comparing their columns using the specified defaultValueComparer and handles failures using the defaultFailureHandler.voidassertWithValueComparer(ITable expectedTable, ITable actualTable, ValueComparer defaultValueComparer, Map<String, ValueComparer> columnValueComparers) Asserts the two specifiedITables comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the defaultFailureHandler.voidassertWithValueComparer(ITable expectedTable, ITable actualTable, Column[] additionalColumnInfo, ValueComparer defaultValueComparer, Map<String, ValueComparer> columnValueComparers) Asserts the two specifiedITables comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the defaultFailureHandler, using additionalColumnInfo, if specified.Methods inherited from class org.dbunit.assertion.DbUnitAssertBase
assertWithValueComparer, assertWithValueComparer, compareColumns, compareData, compareData, compareData, compareRowCounts, compareTableCounts, compareTableNames, compareTables, determineFailureHandler, determineValidColumnValueComparers, determineValidDefaultValueComparer, determineValidTableColumnValueComparers, determineValueComparer, failIfNecessary, getComparisonColumns, getDefaultFailureHandler, getDefaultFailureHandler, getSortedTableNames, setValueComparerDefaults, skipCompare
-
Constructor Details
-
DbUnitValueComparerAssert
public DbUnitValueComparerAssert()
-
-
Method Details
-
assertWithValueComparer
public void assertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet) throws DatabaseUnitException Asserts the two specifiedIDataSets comparing their columns using the defaultValueComparerand handles failures using the defaultFailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.- Parameters:
expectedDataSet-IDataSetcontaining all expected results.actualDataSet-IDataSetcontaining all actual results.- Throws:
DatabaseUnitException
-
assertWithValueComparer
public void assertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet, ValueComparer defaultValueComparer) throws DatabaseUnitException Asserts the two specifiedIDataSets comparing their columns using the specified defaultValueComparer and handles failures using the defaultFailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.- Parameters:
expectedDataSet-IDataSetcontaining all expected results.actualDataSet-IDataSetcontaining all actual results.defaultValueComparer-ValueComparerto use with all column value comparisons. Can benulland will default to.invalid reference
#getDefaultValueComparer()- Throws:
DatabaseUnitException
-
assertWithValueComparer
public void assertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet, ValueComparer defaultValueComparer, Map<String, Map<String, throws DatabaseUnitExceptionValueComparer>> tableColumnValueComparers) Asserts the two specifiedIDataSets comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the defaultFailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.- Parameters:
expectedDataSet-IDataSetcontaining all expected results.actualDataSet-IDataSetcontaining all actual results.defaultValueComparer-ValueComparerto use with column value comparisons when the column name for the table is not in the tableColumnValueComparersMap. Can benulland will default to.invalid reference
#getDefaultValueComparer()tableColumnValueComparers-MapofValueComparers to use for specific tables and columns. Key is table name, value isMapof column name in the table toValueComparers. Can benulland will default to usingor, if that is empty, defaultValueComparer for all columns in all tables.invalid reference
#getDefaultColumnValueComparerMapForTable(String)- Throws:
DatabaseUnitException
-
assertWithValueComparer
public void assertWithValueComparer(ITable expectedTable, ITable actualTable) throws DatabaseUnitException Asserts the two specifiedITables comparing their columns using the defaultValueComparerand handles failures using the defaultFailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.- Parameters:
expectedTable-ITablecontaining all expected results.actualTable-ITablecontaining all actual results.- Throws:
DatabaseUnitException
-
assertWithValueComparer
public void assertWithValueComparer(ITable expectedTable, ITable actualTable, ValueComparer defaultValueComparer) throws DatabaseUnitException Asserts the two specifiedITables comparing their columns using the specified defaultValueComparer and handles failures using the defaultFailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.- Parameters:
expectedTable-ITablecontaining all expected results.actualTable-ITablecontaining all actual results.defaultValueComparer-ValueComparerto use with all column value comparisons. Can benulland will default to.invalid reference
#getDefaultValueComparer()- Throws:
DatabaseUnitException
-
assertWithValueComparer
public void assertWithValueComparer(ITable expectedTable, ITable actualTable, ValueComparer defaultValueComparer, Map<String, ValueComparer> columnValueComparers) throws DatabaseUnitExceptionAsserts the two specifiedITables comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the defaultFailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.- Parameters:
expectedTable-ITablecontaining all expected results.actualTable-ITablecontaining all actual results.defaultValueComparer-ValueComparerto use with column value comparisons when the column name for the table is not in the columnValueComparersMap. Can benulland will default to.invalid reference
#getDefaultValueComparer()columnValueComparers-MapofValueComparers to use for specific columns. Key is column name in the table, value isValueComparerto use in comparing expected to actual column values. Can benulland will default to usingor, if that is empty, defaultValueComparer for all columns in the table.invalid reference
#getDefaultColumnValueComparerMapForTable(String)- Throws:
DatabaseUnitException
-
assertWithValueComparer
public void assertWithValueComparer(ITable expectedTable, ITable actualTable, Column[] additionalColumnInfo, ValueComparer defaultValueComparer, Map<String, ValueComparer> columnValueComparers) throws DatabaseUnitExceptionAsserts the two specifiedITables comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the defaultFailureHandler, using additionalColumnInfo, if specified. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.- Parameters:
expectedTable-ITablecontaining all expected results.actualTable-ITablecontaining all actual results.additionalColumnInfo- The columns to be printed out if the assert fails because of a data mismatch. Provides some additional column values that may be useful to quickly identify the columns for which the mismatch occurred (for example a primary key column). Can benulldefaultValueComparer-ValueComparerto use with column value comparisons when the column name for the table is not in the columnValueComparersMap. Can benulland will default to.invalid reference
#getDefaultValueComparer()columnValueComparers-MapofValueComparers to use for specific columns. Key is column name in the table, value isValueComparerto use in comparing expected to actual column values. Can benulland will default to usingor, if that is empty, defaultValueComparer for all columns in the table.invalid reference
#getDefaultColumnValueComparerMapForTable(String)- Throws:
DatabaseUnitException
-