org.dbunit.assertion
Class DiffCollectingFailureHandler
java.lang.Object
org.dbunit.assertion.DefaultFailureHandler
org.dbunit.assertion.DiffCollectingFailureHandler
- All Implemented Interfaces:
- DifferenceListener, FailureFactory, FailureHandler
public class DiffCollectingFailureHandler
- extends DefaultFailureHandler
A 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);
...
- Since:
- 2.4.0
- Version:
- $Revision: 872 $ $Date: 2008-11-08 09:45:52 -0600 (Sat, 08 Nov 2008) $
- Author:
- gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $
DiffCollectingFailureHandler
public DiffCollectingFailureHandler()
handle
public void handle(Difference diff)
- Description copied from interface:
DifferenceListener
- Is invoked by the
DbUnitAssert
when a data cell difference
has been found.
- Specified by:
handle
in interface DifferenceListener
- Overrides:
handle
in class DefaultFailureHandler
- Parameters:
diff
- The difference that has been found
getDiffList
public List getDiffList()
- Returns:
- The list of collected
Difference
s
toString
public String toString()
- Overrides:
toString
in class DefaultFailureHandler
Copyright © 2002-2012. All Rights Reserved.