From: SourceForge.net <no...@so...> - 2007-08-23 11:01:57
|
Bugs item #1779701, was opened at 2007-08-22 21:58 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1779701&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: None >Status: Pending >Resolution: Works For Me Priority: 5 Private: No Submitted By: Elias Ross (genman) Assigned to: Nobody/Anonymous (nobody) Summary: XMLUtil.ignoreWhitespace does not work with namespace Initial Comment: Test case: public void testIgnoreWhitespace2() throws Exception { String control = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + "\r\n <env:Header/>" + "\r\n </env:Envelope>"; String test = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + "<env:Header/>" + "</env:Envelope>"; XMLUnit.setIgnoreWhitespace(true); try { Diff diff = XMLUnit.compareXML(control, test); System.out.println(test); System.out.println(control); System.out.println(new DetailedDiff(diff)); assertEquals("Should be identical", true, new Diff(control, test).identical()); } finally { XMLUnit.setIgnoreWhitespace(false); } } Output: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header/></env:Envelope> <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header/> </env:Envelope> org.custommonkey.xmlunit.DetailedDiff [different] Expected number of child nodes '3' but was '1' - comparing <env:Envelope...> at /Envelope[1] to <env:Envelope...> at /Envelope[1] [different] Expected presence of child node '#text' but was 'null' - comparing <env:Envelope ...> </env:Envelope> at /Envelope[1] to at /Envelope[1]/Header[1] [not identical] Expected sequence of child nodes '1' but was '0' - comparing <env:Header...> at /Envelope[1]/Header[1] to <env:Header...> at /Envelope[1]/Header[1] [different] Expected presence of child node '#text' but was 'null' - comparing <env:Envelope ...> </env:Envelope> at /Envelope[1]/Header[1] to at /Envelope[1]/Header[1] ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2007-08-23 13:01 Message: Logged In: YES user_id=113148 Originator: NO I've added your test and it passes for me (trunk as well as XMLUnit 1.1). http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=230 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1779701&group_id=23187 |