From: <bo...@us...> - 2010-09-02 12:00:57
|
Revision: 453 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=453&view=rev Author: bodewig Date: 2010-09-02 12:00:51 +0000 (Thu, 02 Sep 2010) Log Message: ----------- change default value for legacy's ignoreAttributeOrder Modified Paths: -------------- trunk/xmlunit/src/main/java-legacy/org/custommonkey/xmlunit/XMLUnit.java trunk/xmlunit/src/tests/java-legacy/org/custommonkey/xmlunit/test_DifferenceEngine.java Modified: trunk/xmlunit/src/main/java-legacy/org/custommonkey/xmlunit/XMLUnit.java =================================================================== --- trunk/xmlunit/src/main/java-legacy/org/custommonkey/xmlunit/XMLUnit.java 2010-09-02 10:59:43 UTC (rev 452) +++ trunk/xmlunit/src/main/java-legacy/org/custommonkey/xmlunit/XMLUnit.java 2010-09-02 12:00:51 UTC (rev 453) @@ -79,7 +79,7 @@ private static boolean ignoreComments = false; private static boolean normalize = false; private static boolean normalizeWhitespace = false; - private static boolean ignoreAttributeOrder = false; + private static boolean ignoreAttributeOrder = true; private static String xsltVersion = "1.0"; private static String xpathFactoryName = null; private static boolean expandEntities = false; @@ -785,12 +785,11 @@ * Whether to ignore the order of attributes on an element. * * <p>The order of attributes has never been relevant for XML - * documents, still XMLUnit will consider two pieces of XML + * documents, still XMLUnit can consider two pieces of XML * not-identical (but similar) if they differ in order of - * attributes. Set this option to false to ignore the order.</p> + * attributes. Set this option to true to compare the order.</p> * - * <p>The default value is false for backwards compatibility - * reasons.</p> + * <p>The default value is true</p> */ public static void setIgnoreAttributeOrder(boolean b) { ignoreAttributeOrder = b; @@ -800,12 +799,11 @@ * Whether to ignore the order of attributes on an element. * * <p>The order of attributes has never been relevant for XML - * documents, still XMLUnit will consider two pieces of XML + * documents, still XMLUnit can consider two pieces of XML * not-identical (but similar) if they differ in order of - * attributes. Set this option to false to ignore the order.</p> + * attributes. Set this option to true to compare the order.</p> * - * <p>The default value is false for backwards compatibility - * reasons.</p> + * <p>The default value is true</p> */ public static boolean getIgnoreAttributeOrder() { return ignoreAttributeOrder; @@ -893,6 +891,14 @@ } /** + * Reset whether to compare unmatched control nodes to unmatched + * test nodes to its default setting. + */ + static void clearCompareUnmatched() { + compareUnmatched = null; + } + + /** * Whether unmatched control nodes should be compared to unmatched * test nodes. * Modified: trunk/xmlunit/src/tests/java-legacy/org/custommonkey/xmlunit/test_DifferenceEngine.java =================================================================== --- trunk/xmlunit/src/tests/java-legacy/org/custommonkey/xmlunit/test_DifferenceEngine.java 2010-09-02 10:59:43 UTC (rev 452) +++ trunk/xmlunit/src/tests/java-legacy/org/custommonkey/xmlunit/test_DifferenceEngine.java 2010-09-02 12:00:51 UTC (rev 453) @@ -667,14 +667,14 @@ } public void testAttributeSequence() throws Exception { - testAttributeSequence(ATTR_SEQUENCE_ID); - resetListener(); - XMLUnit.setIgnoreAttributeOrder(true); + XMLUnit.setIgnoreAttributeOrder(false); try { - testAttributeSequence(-1); + testAttributeSequence(ATTR_SEQUENCE_ID); } finally { - XMLUnit.setIgnoreAttributeOrder(false); + XMLUnit.setIgnoreAttributeOrder(true); } + resetListener(); + testAttributeSequence(-1); } private void testAttributeSequence(int expected) throws Exception { @@ -701,14 +701,14 @@ } public void testAttributeSequenceNS() throws Exception { - testAttributeSequenceNS(ATTR_SEQUENCE_ID); - resetListener(); - XMLUnit.setIgnoreAttributeOrder(true); + XMLUnit.setIgnoreAttributeOrder(false); try { - testAttributeSequenceNS(-1); + testAttributeSequenceNS(ATTR_SEQUENCE_ID); } finally { - XMLUnit.setIgnoreAttributeOrder(false); + XMLUnit.setIgnoreAttributeOrder(true); } + resetListener(); + testAttributeSequenceNS(-1); } private void testAttributeSequenceNS(int expected) throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |