public class DiffCollectingFailureHandler extends DefaultFailureHandler
FailureHandler
that collects the Difference
s 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);
...
DefaultFailureHandler.DefaultFailureFactory
Constructor and Description |
---|
DiffCollectingFailureHandler() |
Modifier and Type | Method and Description |
---|---|
List |
getDiffList() |
void |
handle(Difference diff)
Is invoked by the
DbUnitAssert when a data cell difference
has been found. |
String |
toString() |
addFailMessage, buildMessage, createFailure, createFailure, getAdditionalInfo, getColumnValue, isFailMessage, makeAdditionalColumnInfoErrorMessage, setFailureFactory
public void handle(Difference diff)
DifferenceListener
DbUnitAssert
when a data cell difference
has been found.handle
in interface DifferenceListener
handle
in class DefaultFailureHandler
diff
- The difference that has been foundpublic List getDiffList()
Difference
spublic String toString()
toString
in class DefaultFailureHandler
Copyright © 2002–2024. All rights reserved.