Package org.xmlunit.diff
Class Comparison
- java.lang.Object
-
- org.xmlunit.diff.Comparison
-
public class Comparison extends Object
Details of a single comparison XMLUnit has performed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComparison.DetailThe details of a target (usually some representation of an XML Node) that took part in the comparison.
-
Constructor Summary
Constructors Constructor Description Comparison(ComparisonType t, Node controlTarget, String controlXPath, Object controlValue, String controlParentXPath, Node testTarget, String testXPath, Object testValue, String testParentXPath)Creates a new comparison.Comparison(ComparisonType t, XPathContext controlContext, Node controlTarget, Object controlValue, XPathContext testContext, Node testTarget, Object testValue)Creates a new comparison.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparison.DetailgetControlDetails()Details of the control target.Comparison.DetailgetTestDetails()Details of the test target.ComparisonTypegetType()The kind of comparison performed.StringtoString()Returns a string representation of this comparison usingDefaultComparisonFormatterStringtoString(ComparisonFormatter formatter)Returns a string representation of this comparison using the givenComparisonFormatter
-
-
-
Constructor Detail
-
Comparison
public Comparison(ComparisonType t, Node controlTarget, String controlXPath, Object controlValue, String controlParentXPath, Node testTarget, String testXPath, Object testValue, String testParentXPath)
Creates a new comparison.- Parameters:
t- the type of comparisoncontrolTarget- the control node the comparison applies tocontrolXPath- xpath of the control node the comparison applies tocontrolValue- value from the control node used during comparisoncontrolParentXPath- xpath of the control node' parenttestTarget- the test node the comparison applies totestXPath- xpath of the test node the comparison applies totestValue- value from the test node used during comparisontestParentXPath- xpath of the test node' parent
-
Comparison
public Comparison(ComparisonType t, XPathContext controlContext, Node controlTarget, Object controlValue, XPathContext testContext, Node testTarget, Object testValue)
Creates a new comparison.- Parameters:
t- the type of comparisoncontrolContext- xpathContext object contains the current and parent XPathcontrolTarget- the control node the comparison applies tocontrolValue- value from the control node used during comparisontestContext- xpathContext object contains the current and parent XPathtestTarget- the test node the comparison applies totestValue- value from the test node used during comparison- Since:
- XMLUnit 2.10.1
-
-
Method Detail
-
getType
public ComparisonType getType()
The kind of comparison performed.- Returns:
- the type of comparison
-
getControlDetails
public Comparison.Detail getControlDetails()
Details of the control target.- Returns:
- details of the control target
-
getTestDetails
public Comparison.Detail getTestDetails()
Details of the test target.- Returns:
- details of the test target
-
toString
public String toString(ComparisonFormatter formatter)
Returns a string representation of this comparison using the givenComparisonFormatter- Parameters:
formatter- the ComparisonFormatter to use- Returns:
- a string representation of this comparison
-
toString
public String toString()
Returns a string representation of this comparison usingDefaultComparisonFormatter
-
-