Class Comparison

java.lang.Object
org.xmlunit.diff.Comparison

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

    • 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
  • Method Details

    • 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
    • toString

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