You can subscribe to this list here.
2007 |
Jan
|
Feb
(3) |
Mar
(18) |
Apr
(39) |
May
(15) |
Jun
(12) |
Jul
(3) |
Aug
(23) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(21) |
Feb
(23) |
Mar
(33) |
Apr
(8) |
May
(1) |
Jun
(22) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(6) |
Nov
|
Dec
(11) |
2009 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(24) |
May
(36) |
Jun
(18) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(3) |
Nov
(1) |
Dec
|
2010 |
Jan
(5) |
Feb
(3) |
Mar
|
Apr
(15) |
May
(24) |
Jun
(11) |
Jul
(8) |
Aug
(34) |
Sep
(42) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
(13) |
Feb
(32) |
Mar
(35) |
Apr
(31) |
May
(33) |
Jun
(30) |
Jul
(32) |
Aug
(31) |
Sep
(30) |
Oct
(31) |
Nov
(32) |
Dec
(31) |
2012 |
Jan
(35) |
Feb
(31) |
Mar
(31) |
Apr
(30) |
May
(31) |
Jun
(34) |
Jul
(23) |
Aug
(30) |
Sep
(30) |
Oct
(29) |
Nov
(30) |
Dec
(32) |
2013 |
Jan
(25) |
Feb
(39) |
Mar
(1) |
Apr
(18) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(20) |
Sep
(41) |
Oct
(32) |
Nov
(9) |
Dec
(31) |
2014 |
Jan
(31) |
Feb
(30) |
Mar
(34) |
Apr
(60) |
May
(31) |
Jun
(28) |
Jul
(32) |
Aug
(28) |
Sep
(26) |
Oct
(32) |
Nov
(43) |
Dec
(115) |
2015 |
Jan
(106) |
Feb
(101) |
Mar
(51) |
Apr
(32) |
May
(63) |
Jun
(18) |
Jul
|
Aug
(18) |
Sep
|
Oct
(1) |
Nov
(84) |
Dec
(63) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(104) |
Apr
(30) |
May
(6) |
Jun
(30) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(48) |
Dec
(22) |
2017 |
Jan
(15) |
Feb
(29) |
Mar
(43) |
Apr
(29) |
May
(25) |
Jun
(28) |
Jul
(62) |
Aug
(35) |
Sep
(35) |
Oct
(72) |
Nov
(10) |
Dec
(4) |
2018 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(46) |
May
(20) |
Jun
(12) |
Jul
(9) |
Aug
(42) |
Sep
(4) |
Oct
(17) |
Nov
(32) |
Dec
(31) |
2019 |
Jan
(21) |
Feb
(14) |
Mar
|
Apr
(74) |
May
(25) |
Jun
(43) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2020 |
Jan
(1) |
Feb
|
Mar
(26) |
Apr
(8) |
May
(62) |
Jun
(4) |
Jul
(25) |
Aug
|
Sep
(21) |
Oct
(24) |
Nov
(26) |
Dec
(9) |
2021 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(11) |
Nov
(1) |
Dec
(12) |
2022 |
Jan
(47) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(14) |
2023 |
Jan
(3) |
Feb
|
Mar
(60) |
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
(5) |
Feb
|
Mar
|
Apr
(10) |
May
(1) |
Jun
|
Jul
|
Aug
(17) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2025 |
Jan
|
Feb
|
Mar
(88) |
Apr
(64) |
May
(47) |
Jun
(20) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: SourceForge.net <no...@so...> - 2008-03-03 16:28:03
|
Feature Requests item #1903928, was opened at 2008-02-28 15:28 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1903928&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: XMLUnit for Java Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Stefan Bodewig (bodewig) Assigned to: Nobody/Anonymous (nobody) Summary: Make SAXParserFactory pluggable Initial Comment: see https://sourceforge.net/forum/forum.php?thread_id=1910607&forum_id=73274 ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-03-03 17:28 Message: Logged In: YES user_id=113148 Originator: YES fixed in trunk, see http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=241 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1903928&group_id=23187 |
From: <bo...@us...> - 2008-03-03 16:27:02
|
Revision: 241 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=241&view=rev Author: bodewig Date: 2008-03-03 08:26:08 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Make SAXParserFactory pluggable, issue 1903928 Modified Paths: -------------- trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java trunk/xmlunit/src/user-guide/XMLUnit-Java.xml Modified: trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java =================================================================== --- trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-03-03 16:04:35 UTC (rev 240) +++ trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-03-03 16:26:08 UTC (rev 241) @@ -1,6 +1,6 @@ /* ***************************************************************** -Copyright (c) 2001-2007, Jeff Martin, Tim Bacon +Copyright (c) 2001-2008, Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -69,6 +69,7 @@ private static DocumentBuilderFactory controlBuilderFactory; private static DocumentBuilderFactory testBuilderFactory; private static TransformerFactory transformerFactory; + private static SAXParserFactory saxParserFactory; private static boolean ignoreWhitespace = false; private static URIResolver uriResolver = null; private static EntityResolver testEntityResolver = null; @@ -433,18 +434,35 @@ */ public static void setSAXParserFactory(String className) { System.setProperty("javax.xml.parsers.SAXParserFactory", className); + saxParserFactory = null; getSAXParserFactory(); } /** + * Override the SAX parser to use in tests. + * Currently only used by {@link Validator Validator class} + * @param factory + */ + public static void setSAXParserFactory(SAXParserFactory factory) { + saxParserFactory = factory; + } + + /** * Get the SAX parser to use in tests. - * @return the SAXParserFactory instance used by the {@link Validator Validator} - * to perform DTD validation + * + * <p>Unless an instance has been given via {@link + * setSAXParserFactory(SAXParserFactory) setSAXParserFactory} + * explicitly, the returned factory will be namespace aware.</p> + * + * @return the SAXParserFactory instance used by the {@link + * Validator Validator} to perform DTD validation */ public static SAXParserFactory getSAXParserFactory() { - SAXParserFactory newFactory = SAXParserFactory.newInstance(); - newFactory.setNamespaceAware(true); - return newFactory; + if (saxParserFactory == null) { + saxParserFactory = SAXParserFactory.newInstance(); + saxParserFactory.setNamespaceAware(true); + } + return saxParserFactory; } private static String getStripWhitespaceStylesheet() { Modified: trunk/xmlunit/src/user-guide/XMLUnit-Java.xml =================================================================== --- trunk/xmlunit/src/user-guide/XMLUnit-Java.xml 2008-03-03 16:04:35 UTC (rev 240) +++ trunk/xmlunit/src/user-guide/XMLUnit-Java.xml 2008-03-03 16:26:08 UTC (rev 241) @@ -3251,6 +3251,17 @@ </itemizedlist> </section> + <section id="New Features 1.2"> + <title>New Features</title> + + <itemizedlist> + <listitem>The <literal>SAXParserFactory</literal> used + by <literal>Validator</literal> can now be configured + completely. <ulink href="https://sourceforge.net/tracker/index.php?func=detail&aid=1903928&group_id=23187&atid=377771">Issue + 1903928</ulink>.</listitem> + </itemizedlist> + </section> + <section id="Bugfixes 1.2"> <title>Important Bug Fixes</title> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2008-03-03 16:07:29
|
Bugs item #1860681, was opened at 2007-12-29 23:17 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1860681&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.1 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: jmeister (joerg-meister) Assigned to: Stefan Bodewig (bodewig) Summary: DifferenceEngine.compareNodeList Initial Comment: Hello, it seems to me as if there is a bug in the non-deprecated version of the method DifferenceEngine.compareNodeList(). To illustrate what I mean, I have generated a small example for you. Let's say, we have the following test respectively control structure: ===[ testDoc ]================================ <books> <book> <title>Kabale und Liebe</title> </book> <book> <title>Schuld und Suehne</title> </book> </books> ===[ controlDoc ]============================= <books> <book> <title>Schuld und Suehne</title> </book> </books> Now, we want to compare these structures via XMLUnit. To do so, we generate a DetailedDiff and use a MultiLevelElementNameAndTextQualifier for a correct Node matching: Diff diff = new Diff(controlDoc, testDoc); diff.overrideElementQualifier(new MultiLevelElementNameAndTextQualifier(2)); DetailedDiff dd = new DetailedDiff(diff); Iterator i = dd.getAllDifferences().iterator(); while (i.hasNext()) System.err.println((Difference) i.next()); The result of the comparison are the following error messages (the structure of the messages are always "comparing <ctrl_node> to <test_node>" with their respective XPaths): Expected number of child nodes '1' but was '2' - comparing <books...> at /books[1] to <books...> at /books[1] Expected sequence of child nodes '0' but was '1' - comparing <book...> at /books[1]/book[1] to <book...> at /books[1]/book[2] Expected presence of child node 'null' but was 'book' - comparing at /books[1]/book[1] to <book...> at /books[1]/book[2] The first and the second message are OK. XMLUnit compared the node "Schuld und Suehne" of the control structure (/books[1]/book[1]) to "Schuld und Suehne" of the test structure (/books[1]/book[2]) and recognized, that the sequence of nodes is different. Now the problem arises: Since there are no more nodes in the control structure, but one node left in the test structure, the DifferenceEngine throws a "CHILD_NODE_NOT_FOUND" message for this node. The problem is, that the XpathNodeTracker for test and control structure are not updated in the source code, therefore they return the wrong XPath for the unmatched node "Kabale and Liebe" - it says it is "/books[1]/book[2]", but in reality it is "/books[1]/book[1]"... In this case (a node in the test structure has no counterpart in the control structure or the other way around), the XpathNodeTracker always return the XPaths to the last node matched in test respectively control structure... I have attached a proposal of how this problem may be solved. Therefore you would have to change the DifferenceEngine as well as the XpathNodeTracker. I have marked up the lines within the source code with the key word "CODE_CHANGE", so it should be easy for you to understand what I mean. If you realize it that way, the result for the example given above would be: Expected number of child nodes '1' but was '2' - comparing <books...> at /books[1] to <books...> at /books[1] Expected sequence of child nodes '0' but was '1' - comparing <book...> at /books[1]/book[1] to <book...> at /books[1]/book[2] Expected presence of child node 'null' but was 'book' - comparing at to <book...> at /books[1]/book[1] Why is it that important, that you fix this bug? Well, if you want to react on the "CHILD_NODE_NOT_FOUND" event in a DifferenceListener, then you will need the exact XPath for the node that has no counterpart. At the moment, the wrong XPath is returned. Besides that, the error message in its current form is confusing... I have used JUnit 3.8.1 Xerces 2.8.1 XMLUnit 1.1 Hope this helps, Joerg ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-03-03 17:07 Message: Logged In: YES user_id=113148 Originator: NO should be fixed in svn trunk now. See http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=240 ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-01-04 11:29 Message: Logged In: YES user_id=113148 Originator: NO Hi Jörg, I've turned your test into a testcase and committed a disabled version of it (stating my expectations of what the XPaths should be) to svn: http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=236 Later I'm going to review your changes and we'll see whether they also address the reverse case. It would help tremendously if you could provide your changes as patches (what "svn diff" would give you in a checked out copy) instead of full files in the future. Thanks for the report ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1860681&group_id=23187 |
From: <bo...@us...> - 2008-03-03 16:05:05
|
Revision: 240 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=240&view=rev Author: bodewig Date: 2008-03-03 08:04:35 -0800 (Mon, 03 Mar 2008) Log Message: ----------- fix XPath expressions when missing a node, issue 1860681 Modified Paths: -------------- trunk/xmlunit/src/java/org/custommonkey/xmlunit/DifferenceEngine.java trunk/xmlunit/src/user-guide/XMLUnit-Java.xml trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_DetailedDiff.java trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java Modified: trunk/xmlunit/src/java/org/custommonkey/xmlunit/DifferenceEngine.java =================================================================== --- trunk/xmlunit/src/java/org/custommonkey/xmlunit/DifferenceEngine.java 2008-02-04 12:04:58 UTC (rev 239) +++ trunk/xmlunit/src/java/org/custommonkey/xmlunit/DifferenceEngine.java 2008-03-03 16:04:35 UTC (rev 240) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2007, Jeff Martin, Tim Bacon +Copyright (c) 2001-2008, Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -356,6 +356,7 @@ int j = 0; final int lastTestNode = testChildren.size() - 1; + controlTracker.preloadChildList(controlChildren); testTracker.preloadChildList(testChildren); HashMap/*<Node, Node>*/ matchingNodes = new HashMap(); @@ -418,19 +419,30 @@ compare(new Integer(i), testIndex, nextControl, nextTest, listener, CHILD_NODELIST_SEQUENCE); } else { - compare(nextControl.getNodeName(), null, nextControl, null, - listener, CHILD_NODE_NOT_FOUND); + missingNode(nextControl, null, listener); } } // now handle remaining unmatched test nodes for (Iterator iter = unmatchedTestNodes.iterator(); iter.hasNext();) { - Node n = (Node) iter.next(); - compare(null, n.getNodeName(), null, n, listener, - CHILD_NODE_NOT_FOUND); + missingNode(null, (Node) iter.next(), listener); } } + private void missingNode(Node control, Node test, + DifferenceListener listener) + throws DifferenceFoundException { + if (control != null) { + controlTracker.visited(control); + compare(control.getNodeName(), null, control, null, + listener, CHILD_NODE_NOT_FOUND, controlTracker, null); + } else { + testTracker.visited(test); + compare(null, test.getNodeName(), null, test, listener, + CHILD_NODE_NOT_FOUND, null, testTracker); + } + } + /** * @param aNode * @return true if the node has a namespace @@ -760,11 +772,35 @@ protected void compare(Object expected, Object actual, Node control, Node test, DifferenceListener listener, Difference difference) throws DifferenceFoundException { + compare(expected, actual, control, test, listener, difference, + controlTracker, testTracker); + } + + /** + * If the expected and actual values are unequal then inform the listener of + * a difference and throw a DifferenceFoundException. + * @param expected + * @param actual + * @param control + * @param test + * @param listener + * @param differenceType + * @throws DifferenceFoundException + */ + protected void compare(Object expected, Object actual, + Node control, Node test, DifferenceListener listener, + Difference difference, XpathNodeTracker controlLoc, + XpathNodeTracker testLoc) + throws DifferenceFoundException { if (unequal(expected, actual)) { NodeDetail controlDetail = new NodeDetail(String.valueOf(expected), - control, controlTracker.toXpathString()); + control, + controlLoc == null ? null + : controlLoc.toXpathString()); NodeDetail testDetail = new NodeDetail(String.valueOf(actual), - test, testTracker.toXpathString()); + test, + testLoc == null ? null + : testLoc.toXpathString()); Difference differenceInstance = new Difference(difference, controlDetail, testDetail); listener.differenceFound(differenceInstance); Modified: trunk/xmlunit/src/user-guide/XMLUnit-Java.xml =================================================================== --- trunk/xmlunit/src/user-guide/XMLUnit-Java.xml 2008-02-04 12:04:58 UTC (rev 239) +++ trunk/xmlunit/src/user-guide/XMLUnit-Java.xml 2008-03-03 16:04:35 UTC (rev 240) @@ -3236,6 +3236,34 @@ <section id="Changes 1.2"> <title>Changes from XMLUnit 1.1 to 1.2</title> + + <section id="Breaking Changes 1.2"> + <title>Breaking Changes</title> + + <itemizedlist> + <listitem> + If XMLUnit detects that it cannot match a certain node + (i.e. it encounters + a <literal>CHILD_NODE_NOT_FOUND</literal> + kind of difference) the XPath for the "missing" node will + be null. It used to be some random XPath of a different node. + </listitem> + </itemizedlist> + </section> + + <section id="Bugfixes 1.2"> + <title>Important Bug Fixes</title> + + <itemizedlist> + <listitem> + If XMLUnit couldn't match nodes (i.e. it encountered + a <literal>CHILD_NODE_NOT_FOUND</literal> kind of + difference), the XPath expressions of the node details + have been random. <ulink + url="https://sourceforge.net/tracker/index.php?func=detail&aid=1860681&group_id=23187&atid=377768">Issue 1860681</ulink>. + </listitem> + </itemizedlist> + </section> </section> </appendix> Modified: trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_DetailedDiff.java =================================================================== --- trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_DetailedDiff.java 2008-02-04 12:04:58 UTC (rev 239) +++ trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_DetailedDiff.java 2008-03-03 16:04:35 UTC (rev 240) @@ -248,7 +248,7 @@ * Bug 1860681 * @see https://sourceforge.net/tracker/index.php?func=detail&aid=1860681&group_id=23187&atid=377768 */ - public void XtestXpathOfMissingNode() throws Exception { + public void testXpathOfMissingNode() throws Exception { String control = "<books>" + " <book>" @@ -277,7 +277,9 @@ d.getId()); assertEquals("/books[1]/book[1]", d.getControlNodeDetail().getXpathLocation()); - assertNull(d.getTestNodeDetail().getXpathLocation()); + assertNull("should be null but is " + + d.getTestNodeDetail().getXpathLocation(), + d.getTestNodeDetail().getXpathLocation()); // and reverse diff = new Diff(test, control); Modified: trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java =================================================================== --- trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java 2008-02-04 12:04:58 UTC (rev 239) +++ trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_DifferenceEngine.java 2008-03-03 16:04:35 UTC (rev 240) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2001-2007, Jeff Martin, Tim Bacon +Copyright (c) 2001-2008, Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -620,10 +620,13 @@ String control = "<stuff><item id=\"1\"/><item id=\"2\"/></stuff>"; String test = "<stuff><?item data?></stuff>"; listenToDifferences(control, test); - assertEquals("13th control xpath", "/stuff[1]/item[1]", + // mutiple Differences, we only see the last one, missing second element + assertEquals("13 difference type", + DifferenceConstants.CHILD_NODE_NOT_FOUND_ID, + listener.comparingWhat); + assertEquals("13th control xpath", "/stuff[1]/item[2]", listener.controlXpath); - assertEquals("13th test xpath", "/stuff[1]/processing-instruction()[1]", - listener.testXpath); + assertNull("13th test xpath", listener.testXpath); } public void testXpathLocation14() throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2008-02-28 20:45:08
|
Bugs item #1864168, was opened at 2008-01-04 12:23 Message generated for change (Settings changed) made by forestcarlisle You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1864168&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: Closed Resolution: Invalid Priority: 5 Private: No Submitted By: Forest (forestcarlisle) Assigned to: Nobody/Anonymous (nobody) Summary: docs with different URI variable names should be similar Initial Comment: Consider the following control document <abc:a xmlns:abc='abc'><b/></abc:a> and the following two test documents <a xmlns='abc'><b/></a> <xyz:a xmlns:xyz='abc'><b/></xyz:a> although they are not identical, they should be similar because the only difference is the URI variable name. the URI variable name is not data but only a hint to the parser on how to abbreviate the URI value, which is data and which is always 'abc'. the problem is that the diff tool reports these both as differences as follows: [not identical] Expected namespace prefix 'abc' but was 'null' - comparing <abc:a...> at /a[1] to <a...> at /a[1] [different] Expected namespace URI 'null' but was 'abc' - comparing <b...> at /a[1]/b[1] to <b...> at /a[1]/b[1] See the attached example. ---------------------------------------------------------------------- >Comment By: Forest (forestcarlisle) Date: 2008-02-28 12:45 Message: Logged In: YES user_id=1092645 Originator: YES Oops, you are right. When I change the test to be as follows, it succeeds. My bad. String control = "<abc:a xmlns:abc=\"abc\"><abc:b/></abc:a>"; String testAnonymous = "<a xmlns=\"abc\"><b/></a>"; String testNamed = "<xyz:a xmlns:xyz=\"abc\"><xyz:b/></xyz:a>"; ... ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-02-28 03:36 Message: Logged In: YES user_id=113148 Originator: NO Hmm, in your control document the "b" element belongs to the default namespace, which is not "abc". So your first test document has a different namespace URI on it, not only a different prefix. If you look at the messages you see that it says "not identical" when it complains about the different prefixes (what you call URI variable names), which would still make the documents similar. It is the different URI that makes the two documents different. Seems as if XMLUnit was right. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1864168&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:33
|
Feature Requests item #1854284, was opened at 2007-12-19 18:43 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1854284&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: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jesper Goertz (jgortz) Assigned to: Nobody/Anonymous (nobody) Summary: upgrade difference to irrecoverable Initial Comment: "By providing an implementation of the DifferenceListener interface you can decide for yourself which type of difference is significant in your context. You may “upgrade” differences in element order to irrecoverable ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1854284&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:33
|
Feature Requests item #1762410, was opened at 2007-07-27 22:55 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1762410&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: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ken Estes (kestesisme) Assigned to: Nobody/Anonymous (nobody) Summary: use tolerance for floating point values in XML Initial Comment: We produce XML which has numerical values scattered through out the XML both in nodes and attributes. <svg xmlns="http://www.w3.org/2000/svg" width="0.085in" height="0.085in"> <text text-anchor="end" y="92" x="15">36</text> <fo:block-container height="2pc" width="46.5pc" left="2.5pc" top="64pc"> The numerical values can be produced by computations which are carried out in software or hardware. Because of round off errors we need to have a custom string equals function which will allow for round off in the numeric portions of the string. Enclosed please find a file which will perform such numeric comparisons. Here is my suggestion for how to hook it into XMLUnit. /** * Test two non-null values for inequality * @param expected * @param actual * @return TRUE if the values are not equals() equal (taking whitespace * into account if necessary) */ private boolean unequalNotNull(Object expected, Object actual) { boolean bothStrings = (expected instanceof String && actual instanceof String); if (!bothStrings) { return !(expected.equals(actual)); } String expectedString = (String) expected; String actualString = (String) actual; if (XMLUnit.getIgnoreWhitespace()) { expectedString = expected.trim(); actualString = actual.trim(); } if (XMLUnit.getNormalizeWhitespace()) { expectedString = normalizeWhitespace(expectedString); actualString = normalizeWhitespace(actualString); } if (XMLUnit.getTolerantNumericCompare) { return !StringCmpNumericTolerance.equals(expected,actualString); } return !expectedString.equals(actualString); } ---------------------------------------------------------------------- Comment By: Ken Estes (kestesisme) Date: 2008-01-28 19:06 Message: Logged In: YES user_id=1855117 Originator: YES It would be simplest for my case to wrap the standard DifferenceEngine with another class, because what I wish to change is the method unequalNotNull(Object expected, Object actual) in this class. However this is difficult with the current code structure. 1) The DifferenceEngine class has methods which are private/final and this makes extending the object diffcult 2) it is not clear how to pass my new class into the Diff(,) object to be used instead of the normal differenceEngine. I was hoping to use the diff constructor Diff(Document controlDoc, Document testDoc, DifferenceEngine comparator) But this is a tangle of dependencies. My DifferenceEngine needs to be constructed first, so that I could pass it into the Diff. However to construct my class I need to pass in the Diff (this is the only class which implements ComparisonController) that it will be used for as a parameter. I suggest that you should separate the implementations of DifferenceListener, ComparisonController and not keep diff as an implementation of both since the dependency issues for both are quite separate. And Worse there is no setDifferenceEngine() method for Diff() so that I could create my own DifferenceEngine after the diff was constructed (and pass in the already constructed diff as a parameter) then override the default difference engine with what I just created. In sort overriding the DifferenceEngine class is quite difficult. ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-01-04 11:38 Message: Logged In: YES user_id=113148 Originator: NO Hi Ken, to be honest I feel we would be stretching XMLUnit quite a bit if we added special purpose options like handling of numeric values to its core. The same could be said for case insensitive comparisons of element and attribute names (HTML as a use-case) or texts and so on. It should be possible to use a DifferenceListener of your own that wrapped whatever DifferenceListener would get used normally and performed some special sort of comparision for ATTR_VALUE Differences. We might even add such a DifferenceListener in XMLUnit's examples package. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1762410&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:33
|
Feature Requests item #1728598, was opened at 2007-05-30 23:19 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1728598&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: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: KingArgyle (kingargyle1) Assigned to: Nobody/Anonymous (nobody) Summary: XML Schema Validation Initial Comment: The following files add support for validating a W3C Schema to make sure it is a valid schema document. This is different than validating an XML instance against a Schema. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1728598&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:33
|
Feature Requests item #1860491, was opened at 2007-12-29 19:01 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1860491&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: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Notice about successful matchings of nodes? Initial Comment: Hello, at the moment, the user gets informed via DifferenceListener.differenceFound(), whenever a *difference* between two nodes is recognized. But as I understood XMLUnit, there is no chance to get informed about a successful *matching* of nodes. This could be helpful, too. Not that urgent, but maybe you could think about it. Thanks in advance, Joerg ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-01-04 11:41 Message: Logged In: YES user_id=113148 Originator: NO That's why it is a DifferenceListener ;-) OK, an additional callback interface that gets notified of successful matches would certainly be possible, it just might get overwhelmed with invocations. Any idea on its name? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1860491&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:33
|
Feature Requests item #1877458, was opened at 2008-01-22 16:50 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1877458&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: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Olivier Armand (extended) Assigned to: Nobody/Anonymous (nobody) Summary: Support for XML entities comparison Initial Comment: The DifferenceEngine's JavaDoc ( http://xmlunit.sourceforge.net/api/org/custommonkey/xmlunit/DifferenceEngine.html ) indicates: "Nodes of other types (eg ENTITY_NODE) will be skipped." This means that for example this test case fails: assertXMLEqual("<root>bla\r\nbla</root>", "<root>bla
\nbla</root>"); I suppose this is because XmlUnit sees \r\n on one side and only \n on the other side since 
 is skipped. In my case the control and the test are generated by different processing chain (and XML parsers/serializers), which may produce either entities or standard characters. XMLUnit.setNormalizeWhitespace(true); seems to be a solution for the special case of this entity, but true support for XML entities comparison would be much better. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1877458&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:33
|
Feature Requests item #1878549, was opened at 2008-01-23 23:50 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1878549&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: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Frank Callahan (fcallahan) Assigned to: Nobody/Anonymous (nobody) Summary: recursive ElementQualifier implementation Initial Comment: An implementation of the ElementQualifier interface is needed that can match comparable control and test nodes at arbitrary levels of nesting. While working on an automated regression tool, I found that MultiLevelElementNameAndTextQualifier could not correctly match comparable nodes in deeply nested and complex SOAP response messages. The data contents of these nodes were identical, but they occurred in different orders. Also, MultiLevelElementNameAndTextQualifier requires that the number of levels to explore in each candidate comparable pair be specified in advance of running a comparison. QA testers using the tool would have to enter a number as their best quess of how deep to look, a requirement that would make the tool less useful to them. To solve this problem, I wrote a recursive implementation of ElementQualifier that is able to find all the comparable nodes in a control and test SOAP response message. Probably there are other XMLUnit users who have had to write something similar, so it might be a good idea to include a recursive ElementQualifier in the XMLUnit examples package. The Open Source Review Board at my company, Fidelity Investments, has approved making this originally proprietary code available as a potential contribution to XMLUnit, so please consider adding it to the examples package, making any changes that would make it more consistent with your code standards. It does work fine "as is" though. Anyhow, the code for the RecursiveElementNameAndTextQualifier is pasted in below, so anyone who wants to is welcome to try it. Also, it's in an attached file. /** Based on XMLUnit example MultiLevelElementNameAndTextQualifier. Frank Callahan */ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.custommonkey.xmlunit.ElementNameQualifier; import org.custommonkey.xmlunit.ElementQualifier; /** * Compares all Element and Text nodes in two pieces of XML. Allows elements of * complex, deeply nested types that are returned in different orders but have * the same content to be recognized as comparable. */ public class RecursiveElementNameAndTextQualifier implements ElementQualifier { private static final ElementNameQualifier NAME_QUALIFIER = new ElementNameQualifier(); /** * Uses element names and the text nested an arbitrary level of child * elements deeper into the element to compare elements. Checks all nodes, * not just first child element. * * <p> * Does not ignore empty text nodes. */ public RecursiveElementNameAndTextQualifier() { } /** * Returns result of recursive comparison of all the nodes of a control and * test element. * */ public boolean qualifyForComparison(Element currentControl, Element currentTest) { return compareNodes(currentControl, currentTest); } private boolean compareNodes(Node currentControl, Node currentTest) { try { // if they are elements, compare names of the two nodes if (!NAME_QUALIFIER.qualifyForComparison((Element) currentControl, (Element) currentTest)) { return false; } // Compare the control and test elements' children NodeList controlNodes = null; NodeList testNodes = null; // Check that both nodes have children and, if so, get lists of them if (currentControl.hasChildNodes() && currentTest.hasChildNodes()) { controlNodes = currentControl.getChildNodes(); testNodes = currentTest.getChildNodes(); } else if (currentControl.hasChildNodes() || currentTest.hasChildNodes()) { return false; // if both nodes are empty, they are comparable } else { return true; } // check that both node lists have the same length if (controlNodes.getLength() != testNodes.getLength()) { return false; } // Do checks of test and control nodes' children int nNodes = controlNodes.getLength(); for (int i = 0; i < nNodes; i++) { Node testNode = testNodes.item(i); Node controlNode = controlNodes.item(i); // check if both node are same type if (controlNode.getNodeType() != testNode.getNodeType()) { return false; } // compare text nodes if (controlNode.getNodeType() == Node.TEXT_NODE) { // compare concatenated, trimmed text nodes if (!catText(controlNode).equals(catText(testNode))) { return false; } // recursive check of current child control and test nodes' // children } else if (!compareNodes((Element) controlNode, (Element) testNode)) { return false; } } // All descendants of current control and test nodes are comparable return true; } catch (Exception e) { return false; } } /** * Concatenates contiguous Text nodes and removes all leading and trailing whitespace. * @param textNode * @return */ private String catText(Node textNode) { assert (textNode.getNodeType() == Node.TEXT_NODE); StringBuffer text = new StringBuffer(); Node next = textNode; do { if (next.getNodeValue() != null) { text.append(next.getNodeValue().trim()); next = next.getNextSibling(); } } while (next != null && next.getNodeType() == Node.TEXT_NODE); return text.toString(); } } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1878549&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:32
|
Feature Requests item #1903928, was opened at 2008-02-28 15:28 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1903928&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: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Stefan Bodewig (bodewig) Assigned to: Nobody/Anonymous (nobody) Summary: Make SAXParserFactory pluggable Initial Comment: see https://sourceforge.net/forum/forum.php?thread_id=1910607&forum_id=73274 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1903928&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:03
|
Bugs item #1860681, was opened at 2007-12-29 23:17 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1860681&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.1 Status: Open Resolution: Accepted Priority: 5 Private: No Submitted By: jmeister (joerg-meister) Assigned to: Stefan Bodewig (bodewig) Summary: DifferenceEngine.compareNodeList Initial Comment: Hello, it seems to me as if there is a bug in the non-deprecated version of the method DifferenceEngine.compareNodeList(). To illustrate what I mean, I have generated a small example for you. Let's say, we have the following test respectively control structure: ===[ testDoc ]================================ <books> <book> <title>Kabale und Liebe</title> </book> <book> <title>Schuld und Suehne</title> </book> </books> ===[ controlDoc ]============================= <books> <book> <title>Schuld und Suehne</title> </book> </books> Now, we want to compare these structures via XMLUnit. To do so, we generate a DetailedDiff and use a MultiLevelElementNameAndTextQualifier for a correct Node matching: Diff diff = new Diff(controlDoc, testDoc); diff.overrideElementQualifier(new MultiLevelElementNameAndTextQualifier(2)); DetailedDiff dd = new DetailedDiff(diff); Iterator i = dd.getAllDifferences().iterator(); while (i.hasNext()) System.err.println((Difference) i.next()); The result of the comparison are the following error messages (the structure of the messages are always "comparing <ctrl_node> to <test_node>" with their respective XPaths): Expected number of child nodes '1' but was '2' - comparing <books...> at /books[1] to <books...> at /books[1] Expected sequence of child nodes '0' but was '1' - comparing <book...> at /books[1]/book[1] to <book...> at /books[1]/book[2] Expected presence of child node 'null' but was 'book' - comparing at /books[1]/book[1] to <book...> at /books[1]/book[2] The first and the second message are OK. XMLUnit compared the node "Schuld und Suehne" of the control structure (/books[1]/book[1]) to "Schuld und Suehne" of the test structure (/books[1]/book[2]) and recognized, that the sequence of nodes is different. Now the problem arises: Since there are no more nodes in the control structure, but one node left in the test structure, the DifferenceEngine throws a "CHILD_NODE_NOT_FOUND" message for this node. The problem is, that the XpathNodeTracker for test and control structure are not updated in the source code, therefore they return the wrong XPath for the unmatched node "Kabale and Liebe" - it says it is "/books[1]/book[2]", but in reality it is "/books[1]/book[1]"... In this case (a node in the test structure has no counterpart in the control structure or the other way around), the XpathNodeTracker always return the XPaths to the last node matched in test respectively control structure... I have attached a proposal of how this problem may be solved. Therefore you would have to change the DifferenceEngine as well as the XpathNodeTracker. I have marked up the lines within the source code with the key word "CODE_CHANGE", so it should be easy for you to understand what I mean. If you realize it that way, the result for the example given above would be: Expected number of child nodes '1' but was '2' - comparing <books...> at /books[1] to <books...> at /books[1] Expected sequence of child nodes '0' but was '1' - comparing <book...> at /books[1]/book[1] to <book...> at /books[1]/book[2] Expected presence of child node 'null' but was 'book' - comparing at to <book...> at /books[1]/book[1] Why is it that important, that you fix this bug? Well, if you want to react on the "CHILD_NODE_NOT_FOUND" event in a DifferenceListener, then you will need the exact XPath for the node that has no counterpart. At the moment, the wrong XPath is returned. Besides that, the error message in its current form is confusing... I have used JUnit 3.8.1 Xerces 2.8.1 XMLUnit 1.1 Hope this helps, Joerg ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-01-04 11:29 Message: Logged In: YES user_id=113148 Originator: NO Hi Jörg, I've turned your test into a testcase and committed a disabled version of it (stating my expectations of what the XPaths should be) to svn: http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=236 Later I'm going to review your changes and we'll see whether they also address the reverse case. It would help tremendously if you could provide your changes as patches (what "svn diff" would give you in a checked out copy) instead of full files in the future. Thanks for the report ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1860681&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:32:03
|
Bugs item #1903923, was opened at 2008-02-28 15:26 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1903923&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.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Stefan Bodewig (bodewig) >Assigned to: Stefan Bodewig (bodewig) Summary: ignoreWhitespace and CDATA don't mix well Initial Comment: as originally reported by "nobody" in bug 1863632 public void testDit() throws SAXException, IOException { String shcont = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Data><Person><Name><![CDATA[JOE]]></Name></Person></Data>"; String newTest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +"<Data>" +" <Person>" +" <Name>" +" <![CDATA[JOE]]>" +" </Name>" +" </Person>" +"</Data>"; XMLUnit.setIgnoreWhitespace(true); try { Diff diff = XMLUnit.compareXML(shcont, newTest); System.out.println(diff.toString()); assertTrue(diff.similar()); } finally { XMLUnit.setIgnoreWhitespace(false); } } fails ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1903923&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:28:05
|
Feature Requests item #1903928, was opened at 2008-02-28 15:28 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1903928&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: Open Resolution: None Priority: 5 Private: No Submitted By: Stefan Bodewig (bodewig) Assigned to: Nobody/Anonymous (nobody) Summary: Make SAXParserFactory pluggable Initial Comment: see https://sourceforge.net/forum/forum.php?thread_id=1910607&forum_id=73274 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1903928&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:27:01
|
Bugs item #1863632, was opened at 2008-01-04 00:05 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1863632&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: Closed >Resolution: Duplicate Priority: 5 Private: No Submitted By: Forest (forestcarlisle) Assigned to: Nobody/Anonymous (nobody) Summary: similar ignore-whitespace comparison fails incorrectly Initial Comment: consider the following control xml <a><b/></a> vs. the following test xml <a> <b/> </a> when XMLUnit has been configured to ignore whitespace by XMLUnit.setIgnoreWhitespace(true). if we are ignoring whitespace, then these two documents should be similar. on line 305 of DifferenceEngine.class for v1.1, the diff compares the number of child nodes of <a> and finds that the control xml has 1 child node and the test xml has 3 child nodes. the extra 2 child nodes on the text xml are whitespace-only, but this causes a DifferenceFoundException to be thrown simply because the count is different. this logic is too limited; it should only be thrown when whitespace is *not* being ignored. the fix is to first eliminate any all-whitespace nodes from the node list when ignoring whitespace *unless* the node has exactly one child node. in the latter case, the single child node can be a text node with whitespace which should be regarded as literal text, as in the following example: <a><b> </b></a> is not similar to <a><b/></a> ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-02-28 15:27 Message: Logged In: YES user_id=113148 Originator: NO @nobody: in your case the CDATA-section is the problem. Whitespace between the opening Name element tag and your CDATA section is no element content whitespace anymore, but it becomes a(n empty) TEXT node, the same is true for the whitespace after the CDATA section. Unfortunately I don't see an easy way to work around this right now. I'll open a new bug report (1903923) for this so we can track it separately and close this one. ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-02-28 12:31 Message: Logged In: YES user_id=113148 Originator: NO @forestcarlisle: now that you mention namespace declarations, my best guess is you are using JDK 1.5 and have run into https://sourceforge.net/tracker/index.php?func=detail&aid=1779701&group_id=23187&atid=377768 You could either user XMLUnit's trunk or a different (i.e. working) XSLT engine to work around the issue. @nobody: I'll look into your case separately, hopefully soon ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-01-28 18:38 Message: Logged In: NO I have a similar problem with the following piece: public void testDit() throws SAXException, IOException { String shcont = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Data><Person><Name><![CDATA[JOE]]></Name></Person></Data>"; String newTest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +"<Data>" +" <Person>" +" <Name>" +" <![CDATA[JOE]]>" +" </Name>" +" </Person>" +"</Data>"; XMLUnit.setIgnoreWhitespace(true); try { Diff diff = XMLUnit.compareXML(shcont, newTest); System.out.println(diff.toString()); assertTrue(diff.similar()); } finally { XMLUnit.setIgnoreWhitespace(false); } } ---------------------------------------------------------------------- Comment By: Forest (forestcarlisle) Date: 2008-01-04 21:03 Message: Logged In: YES user_id=1092645 Originator: YES You actually need to have a namespace variable on the root element (or any child element) to see the problem. Sorry about that. public void testBasicWhitespaceHandling() throws Exception { String control = "<xyz:a xmlns:xyz=\"abc\"><b/></xyz:a>"; String test = "<xyz:a xmlns:xyz=\"abc\">\r\n <b/>\r\n</xyz:a>"; XMLUnit.setIgnoreWhitespace(true); try { Diff diff = XMLUnit.compareXML(control, test); assert diff.similar() : diff.toString(); } finally { XMLUnit.setIgnoreWhitespace(false); } } ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-01-04 10:42 Message: Logged In: YES user_id=113148 Originator: NO there must be some other problem with your test since not only are the two pieces similar, they are even identical. I've just added a testcase for your report http://xmlunit.svn.sourceforge.net/viewvc/xmlunit/trunk/?view=log and it passes. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1863632&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 14:25:58
|
Bugs item #1903923, was opened at 2008-02-28 15:26 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1903923&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: Open Resolution: None Priority: 5 Private: No Submitted By: Stefan Bodewig (bodewig) Assigned to: Nobody/Anonymous (nobody) Summary: ignoreWhitespace and CDATA don't mix well Initial Comment: as originally reported by "nobody" in bug 1863632 public void testDit() throws SAXException, IOException { String shcont = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Data><Person><Name><![CDATA[JOE]]></Name></Person></Data>"; String newTest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +"<Data>" +" <Person>" +" <Name>" +" <![CDATA[JOE]]>" +" </Name>" +" </Person>" +"</Data>"; XMLUnit.setIgnoreWhitespace(true); try { Diff diff = XMLUnit.compareXML(shcont, newTest); System.out.println(diff.toString()); assertTrue(diff.similar()); } finally { XMLUnit.setIgnoreWhitespace(false); } } fails ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1903923&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 11:42:15
|
Feature Requests item #1902394, was opened at 2008-02-26 19:14 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1902394&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: Duplicate Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Error in comparing doubles Initial Comment: When comparing elements of type xsd:double xmlunit does not see 3.14159265358979E0 and 3.14159265358979 as equivalent. ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-02-28 12:42 Message: Logged In: YES user_id=113148 Originator: NO XMLUnit doesn't recognize Schema types at all, so it certainly doesn't do any other sort of comparison than a string match. There is an enhancement request https://sourceforge.net/tracker/index.php?func=detail&aid=1762410&group_id=23187&atid=377771 that would address this, I'm marking this as a duplicate of it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=1902394&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 11:39:50
|
Bugs item #1875554, was opened at 2008-01-20 00:43 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1875554&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: Petteri Räty (betelgeus) Assigned to: Nobody/Anonymous (nobody) Summary: testURIResolverForStylesheet fails with JDK >=1.5 Initial Comment: [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.004 sec [junit] Running org.custommonkey.xmlunit.test_SimpleXpathEngine testURIResolverForStylesheet Failure should fail because of unknown include URI junit.framework.AssertionFailedError: should fail because of unknown include URI at org.custommonkey.xmlunit.test_Transform.testURIResolverForStylesheet(test_Transform.java:137) 0.015 happens with 1.5 and 1.6. Doesn't matter whether I use the XSLT implementation from the JDK or Xalan 2.7 ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-02-28 12:39 Message: Logged In: YES user_id=113148 Originator: NO strange, it passes for me on JDK 1.6 as well as Apache Gump running Java 5 http://vmgump.apache.org/gump/public/xmlunit/xmlunit/gump_work/build_xmlunit_xmlunit.html or Java 6 http://gump.zones.apache.org/gump/test/xmlunit/xmlunit/gump_work/build_xmlunit_xmlunit.html ---------------------------------------------------------------------- Comment By: Petteri Räty (betelgeus) Date: 2008-01-20 00:44 Message: Logged In: YES user_id=924568 Originator: YES [junit] Tests run: 8, Failures: 1, Errors: 0, Time elapsed: 0.209 sec [junit] TEST org.custommonkey.xmlunit.test_Transform FAILED Wrong line pasted ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1875554&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 11:36:45
|
Bugs item #1864168, was opened at 2008-01-04 21:23 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1864168&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: Invalid Priority: 5 Private: No Submitted By: Forest (forestcarlisle) Assigned to: Nobody/Anonymous (nobody) Summary: docs with different URI variable names should be similar Initial Comment: Consider the following control document <abc:a xmlns:abc='abc'><b/></abc:a> and the following two test documents <a xmlns='abc'><b/></a> <xyz:a xmlns:xyz='abc'><b/></xyz:a> although they are not identical, they should be similar because the only difference is the URI variable name. the URI variable name is not data but only a hint to the parser on how to abbreviate the URI value, which is data and which is always 'abc'. the problem is that the diff tool reports these both as differences as follows: [not identical] Expected namespace prefix 'abc' but was 'null' - comparing <abc:a...> at /a[1] to <a...> at /a[1] [different] Expected namespace URI 'null' but was 'abc' - comparing <b...> at /a[1]/b[1] to <b...> at /a[1]/b[1] See the attached example. ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-02-28 12:36 Message: Logged In: YES user_id=113148 Originator: NO Hmm, in your control document the "b" element belongs to the default namespace, which is not "abc". So your first test document has a different namespace URI on it, not only a different prefix. If you look at the messages you see that it says "not identical" when it complains about the different prefixes (what you call URI variable names), which would still make the documents similar. It is the different URI that makes the two documents different. Seems as if XMLUnit was right. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1864168&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 11:31:57
|
Bugs item #1863632, was opened at 2008-01-04 00:05 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1863632&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: Open Resolution: Works For Me Priority: 5 Private: No Submitted By: Forest (forestcarlisle) Assigned to: Nobody/Anonymous (nobody) Summary: similar ignore-whitespace comparison fails incorrectly Initial Comment: consider the following control xml <a><b/></a> vs. the following test xml <a> <b/> </a> when XMLUnit has been configured to ignore whitespace by XMLUnit.setIgnoreWhitespace(true). if we are ignoring whitespace, then these two documents should be similar. on line 305 of DifferenceEngine.class for v1.1, the diff compares the number of child nodes of <a> and finds that the control xml has 1 child node and the test xml has 3 child nodes. the extra 2 child nodes on the text xml are whitespace-only, but this causes a DifferenceFoundException to be thrown simply because the count is different. this logic is too limited; it should only be thrown when whitespace is *not* being ignored. the fix is to first eliminate any all-whitespace nodes from the node list when ignoring whitespace *unless* the node has exactly one child node. in the latter case, the single child node can be a text node with whitespace which should be regarded as literal text, as in the following example: <a><b> </b></a> is not similar to <a><b/></a> ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-02-28 12:31 Message: Logged In: YES user_id=113148 Originator: NO @forestcarlisle: now that you mention namespace declarations, my best guess is you are using JDK 1.5 and have run into https://sourceforge.net/tracker/index.php?func=detail&aid=1779701&group_id=23187&atid=377768 You could either user XMLUnit's trunk or a different (i.e. working) XSLT engine to work around the issue. @nobody: I'll look into your case separately, hopefully soon ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-01-28 18:38 Message: Logged In: NO I have a similar problem with the following piece: public void testDit() throws SAXException, IOException { String shcont = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Data><Person><Name><![CDATA[JOE]]></Name></Person></Data>"; String newTest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +"<Data>" +" <Person>" +" <Name>" +" <![CDATA[JOE]]>" +" </Name>" +" </Person>" +"</Data>"; XMLUnit.setIgnoreWhitespace(true); try { Diff diff = XMLUnit.compareXML(shcont, newTest); System.out.println(diff.toString()); assertTrue(diff.similar()); } finally { XMLUnit.setIgnoreWhitespace(false); } } ---------------------------------------------------------------------- Comment By: Forest (forestcarlisle) Date: 2008-01-04 21:03 Message: Logged In: YES user_id=1092645 Originator: YES You actually need to have a namespace variable on the root element (or any child element) to see the problem. Sorry about that. public void testBasicWhitespaceHandling() throws Exception { String control = "<xyz:a xmlns:xyz=\"abc\"><b/></xyz:a>"; String test = "<xyz:a xmlns:xyz=\"abc\">\r\n <b/>\r\n</xyz:a>"; XMLUnit.setIgnoreWhitespace(true); try { Diff diff = XMLUnit.compareXML(control, test); assert diff.similar() : diff.toString(); } finally { XMLUnit.setIgnoreWhitespace(false); } } ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-01-04 10:42 Message: Logged In: YES user_id=113148 Originator: NO there must be some other problem with your test since not only are the two pieces similar, they are even identical. I've just added a testcase for your report http://xmlunit.svn.sourceforge.net/viewvc/xmlunit/trunk/?view=log and it passes. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1863632&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-28 11:00:49
|
Bugs item #1902448, was opened at 2008-02-26 20:33 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1902448&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: Closed >Resolution: Duplicate Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Error in comparing doubles Initial Comment: When comparing elements of type xsd:double xmlunit does not see 3.14159265358979E0 and 3.14159265358979 as equivalent. ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-02-28 12:00 Message: Logged In: YES user_id=113148 Originator: NO https://sourceforge.net/tracker/index.php?func=detail&aid=1902394&group_id=23187&atid=377768 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1902448&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-26 19:33:19
|
Bugs item #1902448, was opened at 2008-02-26 11:33 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1902448&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: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Error in comparing doubles Initial Comment: When comparing elements of type xsd:double xmlunit does not see 3.14159265358979E0 and 3.14159265358979 as equivalent. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1902448&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-02-26 18:14:35
|
Bugs item #1902394, was opened at 2008-02-26 10:14 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1902394&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: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Error in comparing doubles Initial Comment: When comparing elements of type xsd:double xmlunit does not see 3.14159265358979E0 and 3.14159265358979 as equivalent. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1902394&group_id=23187 |
From: Stefan B. <bo...@ap...> - 2008-02-06 03:54:23
|
To whom it may engage... This is an automated request, but not an unsolicited one. For more information please visit http://gump.apache.org/nagged.html, and/or contact the folk at ge...@gu.... Project xmlunit has an issue affecting its community integration. This issue affects 2 projects. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - ws-commons-xmlschema : Common stuff for the WS projects. - xmlunit : JUnit extension for XML unit tests. Full details are available at: http://vmgump.apache.org/gump/public/xmlunit/xmlunit/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Sole output [xmlunit-05022008.jar] identifier set to project name -INFO- Failed with reason build failed -DEBUG- Extracted fallback artifacts from Gump Repository The following work was performed: http://vmgump.apache.org/gump/public/xmlunit/xmlunit/gump_work/build_xmlunit_xmlunit.html Work Name: build_xmlunit_xmlunit (Type: Build) Work ended in a state of : Failed Elapsed: Command Line: /usr/lib/jvm/java-1.5.0-sun/bin/java -Djava.awt.headless=true -Xbootclasspath/p:/srv/gump/public/workspace/xml-commons/java/external/build/xml-apis.jar:/srv/gump/public/workspace/xml-xerces2/build/xercesImpl.jar:serializer-gump-05022008.jar:xalan-gump-05022008.jar org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml -Dbuild.sysclasspath=only -Dxmlunit.version=05022008 Gump [Working Directory: /srv/gump/public/workspace/xmlunit] CLASSPATH: /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar:/srv/gump/public/workspace/xmlunit/build/classes:/srv/gump/public/workspace/xmlunit/build/test-classes:ant-jmf-gump-05022008.jar:ant-swing-gump-05022008.jar:ant-apache-resolver-gump-05022008.jar:ant-trax-gump-05022008.jar:ant-junit-gump-05022008.jar:ant-launcher-gump-05022008.jar:ant-nodeps-gump-05022008.jar:ant-gump-05022008.jar:/srv/gump/packages/junit3.8.1/junit.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/junit/dist/junit-05022008.jar:/srv/gump/public/workspace/xml-commons/java/external/build/xml-apis-ext.jar --------------------------------------------- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/Main --------------------------------------------- To subscribe to this information via syndicated feeds: - RSS: http://vmgump.apache.org/gump/public/xmlunit/xmlunit/rss.xml - Atom: http://vmgump.apache.org/gump/public/xmlunit/xmlunit/atom.xml ============================== Gump Tracking Only === Produced by Gump version 2.3. Gump Run 40001605022008, vmgump:vmgump-public:40001605022008 Gump E-mail Identifier (unique within run) #27. -- Apache Gump http://gump.apache.org/ [Instance: vmgump] |