public class DefaultFailureHandler extends Object implements FailureHandler
FailureHandler.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultFailureHandler.DefaultFailureFactory
Default failure factory which returns DBUnits own assertion error instances.
|
| Constructor and Description |
|---|
DefaultFailureHandler()
Default constructor which does not provide any additional column information.
|
DefaultFailureHandler(Column[] additionalColumnInfo)
Create a default failure handler
|
DefaultFailureHandler(String[] additionalColumnInfo)
Create a default failure handler
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildMessage(Difference diff) |
Error |
createFailure(String message) |
Error |
createFailure(String message,
String expected,
String actual)
Creates a new failure object which can have different types, depending on
the testing framework you are currently using (e.g.
|
String |
getAdditionalInfo(ITable expectedTable,
ITable actualTable,
int row,
String columnName)
Returns a string to be appended to the assertion failure message.
|
protected Object |
getColumnValue(ITable table,
int rowIndex,
String columnName) |
void |
handle(Difference diff)
Is invoked by the
DbUnitAssert when a data cell difference
has been found. |
protected String |
makeAdditionalColumnInfoErrorMessage(String columnName,
DataSetException e) |
void |
setFailureFactory(FailureFactory failureFactory) |
String |
toString() |
public DefaultFailureHandler()
public DefaultFailureHandler(Column[] additionalColumnInfo)
additionalColumnInfo - the column names of the columns for which additional
information should be printed when an assertion failed.public DefaultFailureHandler(String[] additionalColumnInfo)
additionalColumnInfo - the column names of the columns for which additional
information should be printed when an assertion failed.public void setFailureFactory(FailureFactory failureFactory)
failureFactory - The FailureFactory to be used for creating assertion
errors.public Error createFailure(String message, String expected, String actual)
FailureFactorycreateFailure in interface FailureFactorymessage - The reason for the failureexpected - The expected resultactual - The actual resultpublic Error createFailure(String message)
createFailure in interface FailureFactorymessage - The reason for the failurepublic String getAdditionalInfo(ITable expectedTable, ITable actualTable, int row, String columnName)
FailureHandlergetAdditionalInfo in interface FailureHandlerrow - The row for which the assertion failedcolumnName - The column for which the assertion failedprotected String makeAdditionalColumnInfoErrorMessage(String columnName, DataSetException e)
public void handle(Difference diff)
DifferenceListenerDbUnitAssert when a data cell difference
has been found.handle in interface DifferenceListenerdiff - The difference that has been foundprotected String buildMessage(Difference diff)
Copyright © 2002-2017. All Rights Reserved.