0

XMLUnit tries to match correct Entity elements (i.e. with correct attributes), but getting actual-<"null">,expected-<"null"> mismatch at <"Entity"> nodename.

    String expected = "<Object>" +
            "<Entity id=\"Entity1\">" +
            "expected1" +
            "</Entity>" +
            "<Entity id=\"Entity2\">" +
            "expected2" +
            "</Entity>" +
            "</Object>";
    String actual = "<Object>" +
            "<Entity id=\"Entity2\">" +
            "expected2" +
            "</Entity>" +
            "<Entity id=\"Entity1\">" +
            "expected1" +
            "</Entity>" +
            "</Object>";

Whats the issue here? Thanks in advance!

Venkatarao N
  • 245
  • 3
  • 14
  • Could you please expand what you are doing, who is emitting the text you cite? When I create a `Diff` with your examples with `ElementNameAndAttributeQualifier` I get a similar result (not identical because the node order is different), which is what I'd expect. – Stefan Bodewig Mar 03 '15 at 20:09
  • Yeah! its to do with node order. – Venkatarao N Mar 27 '15 at 07:11

1 Answers1

0

Its to do with node order. Its tough to find that with final output of mismatch detail. But I was able to see that with DifferenceListener.differenceFound(Difference difference). And we can suppress that by catching DifferenceConstances.CHILD_NODELIST_SEQUENCE_ID i.e. return DifferenceListener.RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;

Venkatarao N
  • 245
  • 3
  • 14