Class Difference

java.lang.Object
org.dbunit.assertion.Difference

public class Difference extends Object
Value object to hold the difference of a single data cell found while comparing data.

Inspired by the XMLUnit framework.

Since:
2.4.0, 2.6.0 added failMessage
Version:
$Revision$ $Date$
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
  • Constructor Details

    • Difference

      public Difference(ITable expectedTable, ITable actualTable, int rowIndex, String columnName, Object expectedValue, Object actualValue)
      Creates a difference with no fail message.
      Parameters:
      expectedTable - the table containing the expected results.
      actualTable - the table containing the actual results.
      rowIndex - the row index of the differing cell.
      columnName - the name of the differing column.
      expectedValue - the expected cell value.
      actualValue - the actual cell value.
    • Difference

      public Difference(ITable expectedTable, ITable actualTable, int rowIndex, String columnName, Object expectedValue, Object actualValue, String failMessage)
      Creates a difference with the given fail message.
      Parameters:
      expectedTable - the table containing the expected results.
      actualTable - the table containing the actual results.
      rowIndex - the row index of the differing cell.
      columnName - the name of the differing column.
      expectedValue - the expected cell value.
      actualValue - the actual cell value.
      failMessage - the comparison failure message.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getExpectedTable

      public ITable getExpectedTable()
      Returns the table containing the expected results.
      Returns:
      the table containing the expected results.
    • getActualTable

      public ITable getActualTable()
      Returns the table containing the actual results.
      Returns:
      the table containing the actual results.
    • getRowIndex

      public int getRowIndex()
      Returns the row index of the differing cell.
      Returns:
      the row index of the differing cell.
    • getColumnName

      public String getColumnName()
      Returns the name of the differing column.
      Returns:
      the name of the differing column.
    • getExpectedValue

      public Object getExpectedValue()
      Returns the expected cell value.
      Returns:
      the expected cell value.
    • getActualValue

      public Object getActualValue()
      Returns the actual cell value.
      Returns:
      the actual cell value.
    • getFailMessage

      public String getFailMessage()
      Returns the comparison failure message.
      Returns:
      the comparison failure message.
    • setFailMessage

      public void setFailMessage(String failMessage)
      Sets the comparison failure message.
      Parameters:
      failMessage - the comparison failure message.