RFR: 8289511: Axes: child [v2]
Joe Wang
joehw at openjdk.org
Thu Jul 14 01:34:06 UTC 2022
On Thu, 14 Jul 2022 01:17:11 GMT, Bill Huang <duke at openjdk.org> wrote:
>> This is a subtask of [JDK-8286091](https://bugs.openjdk.org/browse/JDK-8286091) which is aiming to improve XPath expression test coverage. The goal of this subtask is validating the XPath child axis specifier in various ways.
>
> Bill Huang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>
> - Merge branch 'openjdk:master' into JDK-8289511
> - Added more XPath expression test cases and created negative tests for invalid expressions.
> - Created XPathChildTest.java
Nice test overall. Pls see comments below.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathChildTest.java line 41:
> 39:
> 40: /*
> 41: * @test
Add bug id here: @bug 8289511
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathChildTest.java line 45:
> 43: * @summary Tests for XPath child axis specifier.
> 44: */
> 45: public class XPathChildTest {
Change the name to: XPathExpChildTest. The idea was to add more test cases to XPathExpTest. But since you've created the long list of test cases, it looks okay to be in a separate test.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathChildTest.java line 135:
> 133: {"/store/child::*[attribute::*]/author", AUTHOR_1},
> 134: {"/store/*[*][*][*][*][*][*][*][*]/author", AUTHOR_1},
> 135: {"/store/*[@*][@*][@*][@*][@*][@*][@*][@*]/author", AUTHOR_1},
What are we testing here, I mean vs ```*[*] or *[@*]?```
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathChildTest.java line 156:
> 154: public Object[][] getInvalidExp() {
> 155: return new Object[][]{
> 156: // NullPointerException
These NPE tests need to be revisited. First of all, by the spec, NPE shall throw only "If expression or returnType is null" (and that's already covered in the Exception test). Secondly, these NPEs were not thrown by the eval process, it was merely because the NodeList was empty or Node was null. The expressions themselves were not "invalid".
-------------
PR: https://git.openjdk.org/jdk/pull/9484
More information about the core-libs-dev
mailing list