< prev index next >

test/javax/xml/jaxp/functional/javax/xml/xpath/ptests/XPathFunctionResolverTest.java

Print this page

        

*** 24,42 **** package javax.xml.xpath.ptests; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; ! import static jaxp.library.JAXPTestUtilities.failUnexpected; import static org.testng.Assert.assertEquals; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; /** * Class containing the test cases for XPathFunctionResolver. */ ! public class XPathFunctionResolverTest { /** * A XPath for evaluation environment and expressions. */ private XPath xpath; --- 24,42 ---- package javax.xml.xpath.ptests; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; ! import jaxp.library.JAXPBaseTest; import static org.testng.Assert.assertEquals; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; /** * Class containing the test cases for XPathFunctionResolver. */ ! public class XPathFunctionResolverTest extends JAXPBaseTest { /** * A XPath for evaluation environment and expressions. */ private XPath xpath;
*** 52,79 **** } } /** * Test for resolveFunction(QName functionName,int arity). evaluate will * continue as long as functionName is meaningful. */ @Test ! public void testCheckXPathFunctionResolver01() { ! try { assertEquals(xpath.evaluate("round(1.7)", (Object)null), "2"); - } catch (XPathExpressionException ex) { - failUnexpected(ex); - } } /** * Test for resolveFunction(QName functionName,int arity); evaluate throws * NPE if functionName is null. */ @Test(expectedExceptions = NullPointerException.class) ! public void testCheckXPathFunctionResolver02() { ! try { assertEquals(xpath.evaluate(null, "5"), "2"); - } catch (XPathExpressionException ex) { - failUnexpected(ex); - } } } --- 52,75 ---- } } /** * Test for resolveFunction(QName functionName,int arity). evaluate will * continue as long as functionName is meaningful. + * + * @throws XPathExpressionException If the expression cannot be evaluated. */ @Test ! public void testCheckXPathFunctionResolver01() throws XPathExpressionException { assertEquals(xpath.evaluate("round(1.7)", (Object)null), "2"); } /** * Test for resolveFunction(QName functionName,int arity); evaluate throws * NPE if functionName is null. + * + * @throws XPathExpressionException If the expression cannot be evaluated. */ @Test(expectedExceptions = NullPointerException.class) ! public void testCheckXPathFunctionResolver02() throws XPathExpressionException { assertEquals(xpath.evaluate(null, "5"), "2"); } }
< prev index next >