Class UnexpectedRowCountException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.dbunit.DatabaseUnitException
org.dbunit.database.rowcount.UnexpectedRowCountException
All Implemented Interfaces:
Serializable

public class UnexpectedRowCountException extends DatabaseUnitException
Thrown by RowCountCheck.verify(RowCountSnapshot, IDatabaseConnection) when one or more tables' row counts no longer match the baseline. The message names every affected table, both counts, the signed delta, and direction-specific advice, in the form a reader can paste straight into a dataset or an exclude list.
Since:
3.6.0
Author:
dbunit
See Also:
  • Constructor Details

    • UnexpectedRowCountException

      public UnexpectedRowCountException(List<RowCountDifference> differences)
      Creates an exception reporting the given differences.
      Parameters:
      differences - The tables whose row counts no longer match the baseline; must not be empty.
    • UnexpectedRowCountException

      public UnexpectedRowCountException(List<RowCountDifference> differences, String additionalAdvice)
      Creates an exception reporting the given differences, with an extra line of context-specific advice appended after the standard per-table detail - e.g. a binding naming a configuration change that would resolve the mismatch.
      Parameters:
      differences - The tables whose row counts no longer match the baseline; must not be empty.
      additionalAdvice - A caller-specific hint appended to the message.
  • Method Details

    • getDifferences

      public List<RowCountDifference> getDifferences()
      Returns the tables whose row counts no longer match the baseline.
      Returns:
      The differences, one per affected table.