Package org.dbunit.dataset
Class Columns.ColumnDiff
java.lang.Object
org.dbunit.dataset.Columns.ColumnDiff
- Enclosing class:
Columns
Describes the
Columns that are different in two tables.- Since:
- 2.3.0
- Version:
- $Revision$
- Author:
- gommma
-
Constructor Summary
ConstructorsConstructorDescriptionColumnDiff(ITableMetaData expectedMetaData, ITableMetaData actualMetaData) Creates the difference between the two metadata's columns -
Method Summary
Modifier and TypeMethodDescriptionColumn[]Returns the columns that exist in the actual result but not in the expected.ReturnsgetActual()as a formatted string.Column[]Returns the columns that exist in the expected result but not in the actual.ReturnsgetExpected()as a formatted string.Builds a pretty formatted message describing the column difference.booleanReturns whether there is a difference in the columns given in the constructor.toString()
-
Constructor Details
-
ColumnDiff
public ColumnDiff(ITableMetaData expectedMetaData, ITableMetaData actualMetaData) throws DataSetException Creates the difference between the two metadata's columns- Parameters:
expectedMetaData- The metadata of the expected results tableactualMetaData- The metadata of the actual results table- Throws:
DataSetException- if the columns cannot be retrieved from the given metadata.
-
-
Method Details
-
hasDifference
public boolean hasDifference()Returns whether there is a difference in the columns given in the constructor.- Returns:
trueif there is a difference in the columns given in the constructor
-
getExpected
Returns the columns that exist in the expected result but not in the actual.- Returns:
- The columns that exist in the expected result but not in the actual
-
getActual
Returns the columns that exist in the actual result but not in the expected.- Returns:
- The columns that exist in the actual result but not in the expected
-
getExpectedAsString
ReturnsgetExpected()as a formatted string.- Returns:
- The value of
getExpected()as formatted string - See Also:
-
getActualAsString
ReturnsgetActual()as a formatted string.- Returns:
- The value of
getActual()as formatted string - See Also:
-
getMessage
Builds a pretty formatted message describing the column difference.- Returns:
- A pretty formatted message that can be used for user information
- Throws:
DataSetException- if the columns cannot be retrieved from the given metadata.
-
toString
-