[jdk11u-dev] RFR: 8289511: Improve test coverage for XPath Axes: child
Andrew John Hughes
andrew at openjdk.org
Wed Nov 29 01:25:17 UTC 2023
On Mon, 30 Oct 2023 20:36:35 GMT, Sonia Zaldana Calles <szaldana at openjdk.org> wrote:
> This backport contains [cfe9026fe0506488cc0f0557299cfa585811d194](https://github.com/openjdk/jdk/commit/cfe9026fe0506488cc0f0557299cfa585811d194).
>
> Patch does not apply cleanly. Notably, I made a change in how the string XML is initialized.
> Original commit uses triple quotes which are not yet enabled in jdk 11. I am adding the relevant differences below.
> Test passes.
>
>
> diff --git a/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpChildTest.java b/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpChildTest.java
> index 00d6002209f..6f06192c44e 100644
> --- a/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpChildTest.java
> +++ b/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathExpChildTest.java
> @@ -45,19 +45,20 @@ import java.io.InputStream;
> */
> public class XPathExpChildTest {
>
> - private static final String XML =
> - "<store>\n" +
> - " <book id="1" lang="en">\n" +
> - " <title/>\n" +
> - " <author id="1"/>\n" +
> - " <isbn>1234</isbn>\n" +
> - " </book>\n" +
> - " <book id="2" lang="en">\n" +
> - " <title/>\n" +
> - " <author id="2"/>\n" +
> - " <isbn>5678</isbn>\n" +
> - " </book>\n" +
> - "</store>";
> + private static final String XML = """
> + <store>
> + <book id="1" lang="en">
> + <title/>
> + <author id="1"/>
> + <isbn>1234</isbn>
> + </book>
> + <book id="2" lang="en">
> + <title/>
> + <author id="2"/>
> + <isbn>5678</isbn>
> + </book>
> + </store>
> + """;
> private static final String AUTHOR_1 = "author_1";
> private static final String AUTHOR_2 = "author_2";
> private static final Document doc;
Backport looks clean, other than the need to replace the use of JEP 355 Text Blocks. The replacement version looks good, though I can see why they wanted to use text blocks for this and avoid all the additional escaping.
I presume the test passes on 11u?
-------------
Marked as reviewed by andrew (Reviewer).
PR Review: https://git.openjdk.org/jdk11u-dev/pull/2243#pullrequestreview-1754222803
More information about the jdk-updates-dev
mailing list