From: SourceForge.net <no...@so...> - 2009-06-16 13:37:50
|
Bugs item #2807167, was opened at 2009-06-16 15:37 Message generated for change (Tracker Item Submitted) made by latruffe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2807167&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.2 Status: Open Resolution: None Priority: 5 Private: No Submitted By: LaTruffe (latruffe) Assigned to: Nobody/Anonymous (nobody) Summary: Comparison Error Initial Comment: Hello I tried to compare too node list, using the ElementNameAndAttributeQualifier to resolve the order problem. Then, the comparison of the two following XML fragments works well: test: <tag> <child amount="100" /> <child amount="250" /> <child amount="100" /> <child amount="100" /> <child amount="100" /> </tag> control: <tag> <child amount="100" /> <child amount="100" /> <child amount="250" /> <child amount="100" /> <child amount="100" /> </tag> But now, when a tried to compare the two following ones: test: <tag> <child amount="100" /> <child amount="100" /> <child amount="100" /> <child amount="250" /> <child amount="100" /> </tag> control: <tag> <child amount="100" /> <child amount="100" /> <child amount="250" /> <child amount="100" /> <child amount="100" /> </tag> It raises a difference, whereas I only move an element in the test fragment: [different] Expected presence of child node 'null' but was 'child' - comparing at null to <child...> at /tag[1]/child[3] Here is my whole java code: public static void main(String[] args) throws SAXException, IOException { String test = "<tag>" + "<child amount=\"100\" />" + "<child amount=\"100\" />" + "<child amount=\"100\" />" + "<child amount=\"250\" />" + "<child amount=\"100\" />" + "</tag>"; String control = "<tag>" + "<child amount=\"100\" />" + "<child amount=\"100\" />" + "<child amount=\"250\" />" + "<child amount=\"100\" />" + "<child amount=\"100\" />" + "</tag>"; Diff myDiff = new Diff(control, test); myDiff.overrideElementQualifier(new ElementNameAndAttributeQualifier()); XMLAssert.assertXMLEqual("", myDiff, true); } Thanks for your good job Rémy ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2807167&group_id=23187 |