Class DbUnitValueComparerAssert

java.lang.Object
org.dbunit.assertion.DbUnitAssertBase
org.dbunit.assertion.DbUnitValueComparerAssert

public class DbUnitValueComparerAssert extends DbUnitAssertBase
DbUnit assertions using ValueComparers for the column comparisons.
Since:
2.6.0
Author:
Jeff Jensen
  • Constructor Details

    • DbUnitValueComparerAssert

      public DbUnitValueComparerAssert()
  • Method Details

    • assertWithValueComparer

      public void assertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet) throws DatabaseUnitException
      Asserts the two specified IDataSets comparing their columns using the default ValueComparer and handles failures using the default FailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.
      Parameters:
      expectedDataSet - IDataSet containing all expected results.
      actualDataSet - IDataSet containing all actual results.
      Throws:
      DatabaseUnitException
    • assertWithValueComparer

      public void assertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet, ValueComparer defaultValueComparer) throws DatabaseUnitException
      Asserts the two specified IDataSets comparing their columns using the specified defaultValueComparer and handles failures using the default FailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.
      Parameters:
      expectedDataSet - IDataSet containing all expected results.
      actualDataSet - IDataSet containing all actual results.
      defaultValueComparer - ValueComparer to use with all column value comparisons. Can be null and will default to
      invalid reference
      #getDefaultValueComparer()
      .
      Throws:
      DatabaseUnitException
    • assertWithValueComparer

      public void assertWithValueComparer(IDataSet expectedDataSet, IDataSet actualDataSet, ValueComparer defaultValueComparer, Map<String,Map<String,ValueComparer>> tableColumnValueComparers) throws DatabaseUnitException
      Asserts the two specified IDataSets comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the default FailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.
      Parameters:
      expectedDataSet - IDataSet containing all expected results.
      actualDataSet - IDataSet containing all actual results.
      defaultValueComparer - ValueComparer to use with column value comparisons when the column name for the table is not in the tableColumnValueComparers Map. Can be null and will default to
      invalid reference
      #getDefaultValueComparer()
      .
      tableColumnValueComparers - Map of ValueComparers to use for specific tables and columns. Key is table name, value is Map of column name in the table to ValueComparers. Can be null and will default to using
      invalid reference
      #getDefaultColumnValueComparerMapForTable(String)
      or, if that is empty, defaultValueComparer for all columns in all tables.
      Throws:
      DatabaseUnitException
    • assertWithValueComparer

      public void assertWithValueComparer(ITable expectedTable, ITable actualTable) throws DatabaseUnitException
      Asserts the two specified ITables comparing their columns using the default ValueComparer and handles failures using the default FailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.
      Parameters:
      expectedTable - ITable containing all expected results.
      actualTable - ITable containing all actual results.
      Throws:
      DatabaseUnitException
    • assertWithValueComparer

      public void assertWithValueComparer(ITable expectedTable, ITable actualTable, ValueComparer defaultValueComparer) throws DatabaseUnitException
      Asserts the two specified ITables comparing their columns using the specified defaultValueComparer and handles failures using the default FailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.
      Parameters:
      expectedTable - ITable containing all expected results.
      actualTable - ITable containing all actual results.
      defaultValueComparer - ValueComparer to use with all column value comparisons. Can be null and will default to
      invalid reference
      #getDefaultValueComparer()
      .
      Throws:
      DatabaseUnitException
    • assertWithValueComparer

      public void assertWithValueComparer(ITable expectedTable, ITable actualTable, ValueComparer defaultValueComparer, Map<String,ValueComparer> columnValueComparers) throws DatabaseUnitException
      Asserts the two specified ITables comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the default FailureHandler. This method ignores the table names, the columns order, the columns data type, and which columns are composing the primary keys.
      Parameters:
      expectedTable - ITable containing all expected results.
      actualTable - ITable containing all actual results.
      defaultValueComparer - ValueComparer to use with column value comparisons when the column name for the table is not in the columnValueComparers Map. Can be null and will default to
      invalid reference
      #getDefaultValueComparer()
      .
      columnValueComparers - Map of ValueComparers to use for specific columns. Key is column name in the table, value is ValueComparer to use in comparing expected to actual column values. Can be null and will default to using
      invalid reference
      #getDefaultColumnValueComparerMapForTable(String)
      or, if that is empty, defaultValueComparer for all columns in the table.
      Throws:
      DatabaseUnitException
    • assertWithValueComparer

      public void assertWithValueComparer(ITable expectedTable, ITable actualTable, Column[] additionalColumnInfo, ValueComparer defaultValueComparer, Map<String,ValueComparer> columnValueComparers) throws DatabaseUnitException
      Asserts the two specified ITables comparing their columns using the specified columnValueComparers or defaultValueComparer and handles failures using the default FailureHandler, 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 - ITable containing all expected results.
      actualTable - ITable containing 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 be null
      defaultValueComparer - ValueComparer to use with column value comparisons when the column name for the table is not in the columnValueComparers Map. Can be null and will default to
      invalid reference
      #getDefaultValueComparer()
      .
      columnValueComparers - Map of ValueComparers to use for specific columns. Key is column name in the table, value is ValueComparer to use in comparing expected to actual column values. Can be null and will default to using
      invalid reference
      #getDefaultColumnValueComparerMapForTable(String)
      or, if that is empty, defaultValueComparer for all columns in the table.
      Throws:
      DatabaseUnitException