From: <bo...@us...> - 2010-08-31 16:24:17
|
Revision: 449 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=449&view=rev Author: bodewig Date: 2010-08-31 16:24:10 +0000 (Tue, 31 Aug 2010) Log Message: ----------- allow Diff (and others) to know whether CDATA is explicitly configured to be different from Text Modified Paths: -------------- trunk/xmlunit/src/main/java-legacy/org/custommonkey/xmlunit/XMLUnit.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-08-31 16:17:37 UTC (rev 448) +++ trunk/xmlunit/src/main/java-legacy/org/custommonkey/xmlunit/XMLUnit.java 2010-08-31 16:24:10 UTC (rev 449) @@ -75,7 +75,7 @@ private static EntityResolver testEntityResolver = null; private static EntityResolver controlEntityResolver = null; private static NamespaceContext namespaceContext = null; - private static boolean ignoreDiffBetweenTextAndCDATA = false; + private static Boolean ignoreDiffBetweenTextAndCDATA = null; private static boolean ignoreComments = false; private static boolean normalize = false; private static boolean normalizeWhitespace = false; @@ -685,7 +685,7 @@ * document.</p> */ public static void setIgnoreDiffBetweenTextAndCDATA(boolean b) { - ignoreDiffBetweenTextAndCDATA = b; + ignoreDiffBetweenTextAndCDATA = Boolean.valueOf(b); getControlDocumentBuilderFactory().setCoalescing(b); getTestDocumentBuilderFactory().setCoalescing(b); } @@ -693,13 +693,24 @@ /** * Whether CDATA sections and Text nodes should be considered the same. * - * <p>The default is false.</p> + * @return false by default */ public static boolean getIgnoreDiffBetweenTextAndCDATA() { - return ignoreDiffBetweenTextAndCDATA; + return ignoreDiffBetweenTextAndCDATA == null ? false + : ignoreDiffBetweenTextAndCDATA.booleanValue(); } /** + * Whether CDATA sections and Text nodes should be considered the same. + * + * @return true by default + */ + public static boolean getExplicitIgnoreDiffBetweenTextAndCDATA() { + return ignoreDiffBetweenTextAndCDATA == null ? true + : ignoreDiffBetweenTextAndCDATA.booleanValue(); + } + + /** * Whether comments should be ignored. * * <p>The default value is false</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |