From: <bo...@us...> - 2010-09-24 10:52:29
|
Revision: 485 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=485&view=rev Author: bodewig Date: 2010-09-24 10:52:22 +0000 (Fri, 24 Sep 2010) Log Message: ----------- exception handling Modified Paths: -------------- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DOMDifferenceEngine.java trunk/xmlunit/src/main/net-core/diff/DOMDifferenceEngine.cs Modified: trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DOMDifferenceEngine.java =================================================================== --- trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DOMDifferenceEngine.java 2010-09-24 10:42:48 UTC (rev 484) +++ trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DOMDifferenceEngine.java 2010-09-24 10:52:22 UTC (rev 485) @@ -23,6 +23,7 @@ import javax.xml.XMLConstants; import javax.xml.namespace.QName; import javax.xml.transform.Source; +import net.sf.xmlunit.exceptions.XMLUnitException; import net.sf.xmlunit.util.Convert; import net.sf.xmlunit.util.IterableNodeList; import net.sf.xmlunit.util.Linqy; @@ -37,6 +38,7 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.ProcessingInstruction; + /** * Difference engine based on DOM. */ @@ -49,8 +51,13 @@ if (test == null) { throw new IllegalArgumentException("test must not be null"); } - compareNodes(Convert.toNode(control), new XPathContext(), - Convert.toNode(test), new XPathContext()); + try { + compareNodes(Convert.toNode(control), new XPathContext(), + Convert.toNode(test), new XPathContext()); + } catch (Exception ex) { + throw new XMLUnitException("Caught exception during comparison", + ex); + } } /** Modified: trunk/xmlunit/src/main/net-core/diff/DOMDifferenceEngine.cs =================================================================== --- trunk/xmlunit/src/main/net-core/diff/DOMDifferenceEngine.cs 2010-09-24 10:42:48 UTC (rev 484) +++ trunk/xmlunit/src/main/net-core/diff/DOMDifferenceEngine.cs 2010-09-24 10:52:22 UTC (rev 485) @@ -16,6 +16,7 @@ using System.Collections.Generic; using System.Xml; using System.Xml.Schema; +using net.sf.xmlunit.exceptions; using net.sf.xmlunit.util; namespace net.sf.xmlunit.diff{ @@ -34,11 +35,15 @@ if (test == null) { throw new ArgumentNullException("test"); } - - CompareNodes(net.sf.xmlunit.util.Convert.ToNode(control), - new XPathContext(), - net.sf.xmlunit.util.Convert.ToNode(test), - new XPathContext()); + try { + CompareNodes(net.sf.xmlunit.util.Convert.ToNode(control), + new XPathContext(), + net.sf.xmlunit.util.Convert.ToNode(test), + new XPathContext()); + } catch (Exception ex) { + throw new XMLUnitException("Caught exception during comparison", + ex); + } } /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |