From: <bo...@us...> - 2008-06-06 13:46:06
|
Revision: 266 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=266&view=rev Author: bodewig Date: 2008-06-06 06:45:43 -0700 (Fri, 06 Jun 2008) Log Message: ----------- test for issue 1985229 Modified Paths: -------------- trunk/xmlunit/tests/java/org/custommonkey/xmlunit/AbstractXpathEngineTests.java Modified: trunk/xmlunit/tests/java/org/custommonkey/xmlunit/AbstractXpathEngineTests.java =================================================================== --- trunk/xmlunit/tests/java/org/custommonkey/xmlunit/AbstractXpathEngineTests.java 2008-06-06 13:07:18 UTC (rev 265) +++ trunk/xmlunit/tests/java/org/custommonkey/xmlunit/AbstractXpathEngineTests.java 2008-06-06 13:45:43 UTC (rev 266) @@ -1,6 +1,6 @@ /* ****************************************************************** -Copyright (c) 2007, Jeff Martin, Tim Bacon +Copyright (c) 2007-2008, Jeff Martin, Tim Bacon All rights reserved. Redistribution and use in source and binary forms, with or without @@ -38,6 +38,8 @@ import java.util.HashMap; import junit.framework.TestCase; +import org.custommonkey.xmlunit.exceptions.ConfigurationException; +import org.custommonkey.xmlunit.exceptions.XpathException; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -179,4 +181,15 @@ } + public void testEvaluateInvalidXPath() throws Exception { + String xpath = "count(test//*[@attrOne='open source])"; + try { + String result = newXpathEngine().evaluate(xpath, testDocument); + fail("expected Exception to be thrown but wasn't"); + } catch (XpathException ex) { + // expected + } catch (ConfigurationException ex) { + // acceptable in the JAXP 1.2 case + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |