RFR: JDK-8289510 : Improve test coverage for XPath Axes: namespace
Joe Wang
joehw at openjdk.org
Thu Aug 18 16:09:12 UTC 2022
On Wed, 17 Aug 2022 15:32:49 GMT, Mahendra Chhipa <mchhipa at openjdk.org> wrote:
> Added tests for namespace Axis. Tests incluse namspace expressions, namespace node counts and namespace node scope.
Thanks Mahendra!
In general, it would be good to add javadoc/notes to each test and data provider.
The test cases themselves look okay, although they are a bit repetitive in that they are all in the form of a forward axis starting from the root. In practical use cases, it's most useful to perform node test with various namespace-related functions in order to locate a node or nodeset. Namespace changes the way how a node or nodeset is located, e.g. /a/b/c finds c, but as soon as namespace(s) are added, that same xpath expression no longer finds it. I remember sub-task JDK-8289948 (https://github.com/openjdk/jdk/pull/9633) had some of that. It would be good to discuss with Bill @bwhuang-us or have Bill review this PR, as we talked about more comprehensive test coverage for namespaces in this sub-task.
test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpNamespaceTest.java line 127:
> 125: {"/Customers/Customer/namespace::*", 3},
> 126: {"/Customers/Customer/Address/namespace::*", 2},
> 127: {"/Customers/Customer/Address/namespace::*", 2},
Duplicate test cases.
-------------
PR: https://git.openjdk.org/jdk/pull/9906
More information about the core-libs-dev
mailing list