From: SourceForge.net <no...@so...> - 2009-03-18 18:53:26
|
Bugs item #2386807, was opened at 2008-12-04 05:30 Message generated for change (Comment added) made by sf-robot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2386807&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: Matthew Watson (mattw) Assigned to: Stefan Bodewig (bodewig) Summary: 1.2 bug comparing missing attributes Initial Comment: There is a bug when comparing 2 xml fragments where one has a missing attribute, the error is reported correctly, but the xpath for the attribute being compared is incorrect. The test below produces: Expected number of element attributes '2' but was '1' - comparing <bar...> at /foo[1]/bar[1] to <bar...> at /foo[1]/bar[1] Expected attribute name 'y' but was 'null' - comparing <bar...> at /foo[1]/bar[1]/@a to <bar...> at /foo[1]/bar[1]/@a The second diff says it is comparing attribute "y", but the xpath indicates attribute "a". Either the attribute in the xpath should be "y", or the xpath should only indicate /foo[1]/bar[1] Matt import java.util.List; import org.custommonkey.xmlunit.DetailedDiff; import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.XMLTestCase; public class XmlUnitBug extends XMLTestCase { public void testBug() throws Exception { Diff myDiff = new Diff("<foo><bar a=\"x\" y=\"z\"/></foo>", "<foo><bar a=\"x\"/></foo>"); DetailedDiff myDDiff = new DetailedDiff(myDiff); List allDifferences = myDDiff.getAllDifferences(); for (Object diff : allDifferences) { System.err.println(diff); } assertTrue(myDDiff.similar()); } } ---------------------------------------------------------------------- >Comment By: SourceForge Robot (sf-robot) Date: 2009-03-18 18:53 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-01-30 16:28 Message: fixed with svn revision 289 - http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=289 ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2009-01-30 16:18 Message: confirmed, I have a failing unit test in my working copy now, and it would be in svn if sourceforge's svn let me. Hope to have a fix soon. ---------------------------------------------------------------------- Comment By: Matthew Watson (mattw) Date: 2008-12-04 05:32 Message: I am using V1.2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2386807&group_id=23187 |