Package org.dbunit.assertion
Class DiffCollectingFailureHandler
java.lang.Object
org.dbunit.assertion.DefaultFailureHandler
org.dbunit.assertion.DiffCollectingFailureHandler
- All Implemented Interfaces:
DifferenceListener,FailureFactory,FailureHandler
A
FailureHandler that collects the Differences that
were found without throwing an exception.
You can use it as follows:
IDataSet dataSet = getDataSet();
DiffCollectingFailureHandler myHandler = new DiffCollectingFailureHandler();
//invoke the assertion with the custom handler
assertion.assertEquals(dataSet.getTable("TEST_TABLE"),
dataSet.getTable("TEST_TABLE_WITH_WRONG_VALUE"),
myHandler);
// Evaluate the results
List diffList = myHandler.getDiffList();
Difference diff = (Difference)diffList.get(0);
...
- Since:
- 2.4.0
- Version:
- $Revision$ $Date$
- Author:
- gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
-
Nested Class Summary
Nested classes/interfaces inherited from class org.dbunit.assertion.DefaultFailureHandler
DefaultFailureHandler.DefaultFailureFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(Difference diff) Is invoked by theDbUnitAssertwhen a data cell difference has been found.toString()Methods inherited from class org.dbunit.assertion.DefaultFailureHandler
addFailMessage, buildMessage, createFailure, createFailure, getAdditionalInfo, getColumnValue, isFailMessage, makeAdditionalColumnInfoErrorMessage, setFailureFactory
-
Constructor Details
-
DiffCollectingFailureHandler
public DiffCollectingFailureHandler()
-
-
Method Details
-
handle
Description copied from interface:DifferenceListenerIs invoked by theDbUnitAssertwhen a data cell difference has been found.- Specified by:
handlein interfaceDifferenceListener- Overrides:
handlein classDefaultFailureHandler- Parameters:
diff- The difference that has been found
-
getDiffList
- Returns:
- The list of collected
Differences
-
toString
- Overrides:
toStringin classDefaultFailureHandler
-