Class Comparison


  • public class Comparison
    extends Object
    Details of a single comparison XMLUnit has performed.
    • 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 comparison
        controlTarget - the control node the comparison applies to
        controlXPath - xpath of the control node the comparison applies to
        controlValue - value from the control node used during comparison
        controlParentXPath - xpath of the control node' parent
        testTarget - the test node the comparison applies to
        testXPath - xpath of the test node the comparison applies to
        testValue - value from the test node used during comparison
        testParentXPath - 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 comparison
        controlContext - xpathContext object contains the current and parent XPath
        controlTarget - the control node the comparison applies to
        controlValue - value from the control node used during comparison
        testContext - xpathContext object contains the current and parent XPath
        testTarget - the test node the comparison applies to
        testValue - 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 given ComparisonFormatter
        Parameters:
        formatter - the ComparisonFormatter to use
        Returns:
        a string representation of this comparison