Class Comparison


  • public class Comparison
    extends java.lang.Object
    Details of a single comparison XMLUnit has performed.
    • Constructor Detail

      • Comparison

        public Comparison​(ComparisonType t,
                          org.w3c.dom.Node controlTarget,
                          java.lang.String controlXPath,
                          java.lang.Object controlValue,
                          java.lang.String controlParentXPath,
                          org.w3c.dom.Node testTarget,
                          java.lang.String testXPath,
                          java.lang.Object testValue,
                          java.lang.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
    • 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 java.lang.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
      • toString

        public java.lang.String toString()
        Returns a string representation of this comparison using DefaultComparisonFormatter
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this comparison