RFR: JDK-8289948: Improve test coverage for XPath functions: Node Set Functions [v4]
Joe Wang
joehw at openjdk.org
Thu Jul 28 00:37:41 UTC 2022
On Wed, 27 Jul 2022 20:04:54 GMT, Bill Huang <duke at openjdk.org> wrote:
>> Provided coverage for XPath node set functions. Functions include:
>> - id()
>> - last()
>> - position()
>> - count()
>> - local-name()
>> - namespace-uri()
>> - name()
>
> Bill Huang has updated the pull request incrementally with one additional commit since the last revision:
>
> Added documentation/comments and test cases using namespace.
Thanks for reminding me of [JDK-8289510](https://bugs.openjdk.org/browse/JDK-8289510) for covering more on namespace.
A few comments below. Otherwise looks good.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 38:
> 36: * @library /javax/xml/jaxp/unittest
> 37: * @run testng xpath.XPathExpFnTest
> 38: * @summary Test for XPath functions
Since this test focuses on Node Set Functions, it would be good to say so, e.g. "Tests the XPath Node Set Functions".
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 45:
> 43:
> 44: /*
> 45: * DataProvider for XPath expressions for id function.
Looks like this is: "DataProvider for testing the id function".
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 62:
> 60:
> 61: /*
> 62: * DataProvider for XPath expressions for count function.
DataProvider for testing the count function.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 99:
> 97:
> 98: /*
> 99: * DataProvider for XPath expression for position function.
DataProvider for testing the position function.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 116:
> 114:
> 115: /*
> 116: * DataProvider for XPath expression for name and local name function.
DataProvider for testing the name and local-name functions.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 145:
> 143: /**
> 144: * This test evaluates XPath expressions of id function and checks against
> 145: * the expected result.
Use 3rd person descriptive, e.g. "Verifies that the result of evaluating the id function matches the expected result."
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 149:
> 147: * @param exp XPath expression
> 148: * @param expected expected result
> 149: * @throws Exception
@throws Exception if the test fails
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 167:
> 165: * This test evaluates XPath expressions of count function and checks
> 166: * against the expected result.
> 167: *
Verifies that the result of evaluating the count function matches the expected result.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 185:
> 183: /**
> 184: * This test evaluates XPath expressions of position function and checks
> 185: * against the expected result.
Verifies that the result of evaluating the position function matches the expected result.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpFnTest.java line 207:
> 205: * This test evaluates XPath expressions of name and local-name functions
> 206: * and checks against the expected result.
> 207: *
Verifies that the result of evaluating the name and local-name functions matches the expected result.
-------------
Marked as reviewed by joehw (Reviewer).
PR: https://git.openjdk.org/jdk/pull/9633
More information about the core-libs-dev
mailing list