I'm using the xmlunit framework (i think version 1.0, or at least that's what the manifest of the .jar says).
What i'm doing is this:
Diff diff=new Diff(xml1,xml2);
diff.overrideElementQualifier(new ElementNameAndAttributeQualifier());
diff.overrideDifferenceListener(new MyCustomDifferenceListener()};
When i run the diff.identical()
method with the Diff instantiated with (xml1,xml2) the breakpoint in MyCustomDifferenceListener.differenceFound(Difference difference) is hit twice, while for the other order it is hit 3 times.
The one relevant difference that is only hit in one case is (description): "Expected node type '3' but was '1' - comparing at /somenode[1]/element[1]/text()[1] to /somenode[1]/element[1]/child[196]"
The difference between the 2 xml files is one '\n' character after the last , before closing the (and then the root node).
Does anyone know why i'd only get the difference in one of the 2 cases?
P.S. I think the code is MyCustomDifferenceListener() was irrelevant, since it's not the one finding the differences.