Package org.dbunit.ant
Class Compare
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.dbunit.ant.AbstractStep
org.dbunit.ant.Compare
- All Implemented Interfaces:
Cloneable,DbUnitTaskStep
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:
-
Field Summary
Fields inherited from class org.dbunit.ant.AbstractStep
FORMAT_CSV, FORMAT_DTD, FORMAT_FLAT, FORMAT_JSON, FORMAT_XLS, FORMAT_XML, FORMAT_YMLFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a query to compare.voidAdds a table to compare.voidexecute(IDatabaseConnection connection) Executes this step using the given database connection.Returns the format of the source file.Returns a message describing this step, for logging purposes.getSrc()Returns the source file containing the expected dataset.Returns the tables and queries to compare.voidSets the format of the source file.voidsetSort(boolean sort) Sets whether the compared tables must be sorted before comparison.voidSets the source file containing the expected dataset.toString()Methods inherited from class org.dbunit.ant.AbstractStep
checkDataFormat, getDatabaseDataSet, getInputSource, getSrcDataSet, isDataFormat, isOrdered, setOrderedMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
Compare
public Compare()
-
-
Method Details
-
getSrc
Returns the source file containing the expected dataset.- Returns:
- the source file containing the expected dataset.
-
setSrc
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-trueto sort the compared tables before comparison.
-
getFormat
Returns the format of the source file.- Returns:
- the format of the source file.
-
setFormat
Sets the format of the source file.- Parameters:
format- the format of the source file.
-
getTables
Returns the tables and queries to compare.- Returns:
- the tables and queries to compare.
-
addTable
Adds a table to compare.- Parameters:
table- the table to compare.
-
addQuery
Adds a query to compare.- Parameters:
query- the query to compare.
-
execute
Description copied from interface:DbUnitTaskStepExecutes this step using the given database connection.- Parameters:
connection- the database connection to use.- Throws:
DatabaseUnitException- if the step fails.
-
getLogMessage
Description copied from interface:DbUnitTaskStepReturns a message describing this step, for logging purposes.- Returns:
- a message describing this step.
-
toString
- Overrides:
toStringin classAbstractStep
-