Class Compare

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.dbunit.ant.AbstractStep
org.dbunit.ant.Compare
All Implemented Interfaces:
Cloneable, DbUnitTaskStep

public class Compare extends AbstractStep
The Compare class is the step that compare the content of the database against the specified dataset.
Since:
Apr 3, 2004
Version:
$Revision$
Author:
Manuel Laflamme
See Also:
  • Constructor Details

    • Compare

      public Compare()
  • Method Details

    • getSrc

      public File getSrc()
      Returns the source file containing the expected dataset.
      Returns:
      the source file containing the expected dataset.
    • setSrc

      public void setSrc(File src)
      Sets the source file containing the expected dataset.
      Parameters:
      src - the source file containing the expected dataset.
    • setSort

      public void setSort(boolean sort)
      Sets whether the compared tables must be sorted before comparison.
      Parameters:
      sort - true to sort the compared tables before comparison.
    • getFormat

      public String getFormat()
      Returns the format of the source file.
      Returns:
      the format of the source file.
    • setFormat

      public void setFormat(String format)
      Sets the format of the source file.
      Parameters:
      format - the format of the source file.
    • getTables

      public List getTables()
      Returns the tables and queries to compare.
      Returns:
      the tables and queries to compare.
    • addTable

      public void addTable(Table table)
      Adds a table to compare.
      Parameters:
      table - the table to compare.
    • addQuery

      public void addQuery(Query query)
      Adds a query to compare.
      Parameters:
      query - the query to compare.
    • execute

      public void execute(IDatabaseConnection connection) throws DatabaseUnitException
      Description copied from interface: DbUnitTaskStep
      Executes this step using the given database connection.
      Parameters:
      connection - the database connection to use.
      Throws:
      DatabaseUnitException - if the step fails.
    • getLogMessage

      public String getLogMessage()
      Description copied from interface: DbUnitTaskStep
      Returns a message describing this step, for logging purposes.
      Returns:
      a message describing this step.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractStep