From: SourceForge.net <no...@so...> - 2009-07-04 02:20:33
|
Bugs item #2807167, was opened at 2009-06-16 13:37 Message generated for change (Comment added) made by sf-robot 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: Closed Resolution: Fixed 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 Rmy ---------------------------------------------------------------------- >Comment By: SourceForge Robot (sf-robot) Date: 2009-07-04 02:20 Message: This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker). ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2009-06-19 09:29 Message: fixed with svn revision 346 by using a rather ugly hack instead of a real solution because the real solution would break backwards compatibility. What happens is that control nodes four and five both got matched to test node five (neglecting the fact that it already had a matching control node in the case of control node five) leaving test node three in the list of unmatched test nodes. The fixed code matches control node four to test node five and control node five to test node three an everything looks good to XMLUnit. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2807167&group_id=23187 |