Package org.xmlunit.diff
Class Diff
java.lang.Object
org.xmlunit.diff.Diff
The Diff-Object is the result of two comparisons.
- See Also:
-
Constructor Summary
ConstructorDescriptionDiff
(Source controlSource, Source testSource, Iterable<Difference> differences) Encapsulates the compared sources and the differences found.Diff
(Source controlSource, Source testSource, ComparisonFormatter formatter, Iterable<Difference> differences) Encapsulates the compared sources and the differences found. -
Method Summary
Modifier and TypeMethodDescriptionReturns a string representation of this diff using internalComparisonFormatter
orDefaultComparisonFormatter
if formatter wasn't set.fullDescription
(ComparisonFormatter formatter) Returns a string representation of this diff using the givenComparisonFormatter
boolean
toString()
Returns a string representation of first found difference in this diff using internalComparisonFormatter
orDefaultComparisonFormatter
if formatter wasn't settoString
(ComparisonFormatter formatter) Returns a string representation of first found difference in this diff using the givenComparisonFormatter
-
Constructor Details
-
Diff
Encapsulates the compared sources and the differences found.- Parameters:
controlSource
- the control XML sourcetestSource
- the test XML sourcedifferences
- the differences found
-
Diff
public Diff(Source controlSource, Source testSource, ComparisonFormatter formatter, Iterable<Difference> differences) Encapsulates the compared sources and the differences found.- Parameters:
controlSource
- the control XML sourcetestSource
- the test XML sourcedifferences
- the differences foundformatter
- formatter to use when displaying the differences
-
-
Method Details
-
fullDescription
Returns a string representation of this diff using internalComparisonFormatter
orDefaultComparisonFormatter
if formatter wasn't set.Each comparison result separated by the end of the line.
- Returns:
- a string representation of this diff
- Since:
- 2.8.3
-
fullDescription
Returns a string representation of this diff using the givenComparisonFormatter
Each comparison result separated by the end of the line.
- Parameters:
formatter
- theComparisonFormatter
to use- Returns:
- a string representation of this diff
- Since:
- 2.8.3
-
hasDifferences
public boolean hasDifferences()- Returns:
- true if there was at least one difference.
-
getDifferences
- Returns:
- all differences found before the comparison process stopped.
-
getControlSource
- Returns:
- the control XML source
-
getTestSource
- Returns:
- the test XML source
-
toString
Returns a string representation of first found difference in this diff using internalComparisonFormatter
orDefaultComparisonFormatter
if formatter wasn't set -
toString
Returns a string representation of first found difference in this diff using the givenComparisonFormatter
- Parameters:
formatter
- theComparisonFormatter
to use- Returns:
- a string representation of first found difference in this diff
- See Also:
-