Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8289948: Improve test coverage for XPath functions: Node Set Functions #9633

Closed
wants to merge 6 commits into from

Conversation

bwhuang-us
Copy link
Contributor

@bwhuang-us bwhuang-us commented Jul 25, 2022

Provided coverage for XPath node set functions. Functions include:

  • id()
  • last()
  • position()
  • count()
  • local-name()
  • namespace-uri()
  • name()

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8289948: Improve test coverage for XPath functions: Node Set Functions

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9633/head:pull/9633
$ git checkout pull/9633

Update a local copy of the PR:
$ git checkout pull/9633
$ git pull https://git.openjdk.org/jdk pull/9633/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9633

View PR using the GUI difftool:
$ git pr show -t 9633

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9633.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 25, 2022

👋 Welcome back bwhuang-us! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 25, 2022

@bwhuang-us The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Jul 25, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 25, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 25, 2022

Webrevs

@openjdk-notifier
Copy link

@bwhuang-us Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@JoeWang-Java
Copy link
Member

Nice tests overall. Some documentation would be good, that is, javadocs/comments/notes to fields, DataProviders and test methods.

For name, namespace functions, it would be good to test them against XMLs with namespaces so that the results may contain elements/attributes that are relevant to the namespace.

@bwhuang-us
Copy link
Contributor Author

@JoeWang-Java Thank you for the advice. I added a foo namespace for the name and namespace functions. More comprehensive test coverage for namespaces will be covered by JDK-8289510.

Copy link
Member

@JoeWang-Java JoeWang-Java left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reminding me of JDK-8289510 for covering more on namespace.

A few comments below. Otherwise looks good.

private static final Document doc = getDtdDocument();

/*
* DataProvider for XPath expressions for id function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is: "DataProvider for testing the id function".

* @bug 8289948
* @library /javax/xml/jaxp/unittest
* @run testng xpath.XPathExpFnTest
* @summary Test for XPath functions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this test focuses on Node Set Functions, it would be good to say so, e.g. "Tests the XPath Node Set Functions".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I think it would be good to rename this file to XPathNodeSetFnTest.java.

}

/*
* DataProvider for XPath expressions for count function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataProvider for testing the count function.

}

/*
* DataProvider for XPath expression for position function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataProvider for testing the position function.

}

/*
* DataProvider for XPath expression for name and local name function.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataProvider for testing the name and local-name functions.


/**
* This test evaluates XPath expressions of id function and checks against
* the expected result.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 3rd person descriptive, e.g. "Verifies that the result of evaluating the id function matches the expected result."

/**
* This test evaluates XPath expressions of count function and checks
* against the expected result.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifies that the result of evaluating the count function matches the expected result.


/**
* This test evaluates XPath expressions of position function and checks
* against the expected result.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifies that the result of evaluating the position function matches the expected result.

/**
* This test evaluates XPath expressions of name and local-name functions
* and checks against the expected result.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifies that the result of evaluating the name and local-name functions matches the expected result.

*
* @param exp XPath expression
* @param expected expected result
* @throws Exception
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@throws Exception if the test fails

@openjdk
Copy link

openjdk bot commented Jul 28, 2022

@bwhuang-us This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8289948: Improve test coverage for XPath functions: Node Set Functions

Reviewed-by: joehw

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 88 new commits pushed to the master branch:

  • fcc1195: 8290531: Loom: Parallelize a few tests more deeply
  • 226b8e6: 8290885: java/lang/ProcessBuilder/PipelineLeaksFD.java fail: More or fewer pipes than expected
  • 464085e: 8291558: unify print_jni_name_prefix_on and print_jni_name_suffix_on on posix platforms
  • f5d1b5b: 6463708: DefaultButtonModel.setMnemonic generates ChangeEvent for no change
  • 30205bb: 8290966: G1: Record number of PLAB filled and number of direct allocations
  • 86ef7b2: 8289046: Undefined Behaviour in x86 class Assembler
  • d61c0c7: 8290497: some tests in com/sun/jdi fail on localized Windows platform
  • 7ff1969: 8290067: Show stack dimensions in UL logging when attaching threads
  • 257c71c: 8290062: Remove nmethodLocker for nmethods on-stack
  • d9cb410: 8290466: Default to --with-source-date=current to avoid unmodified Hotspot recompilation
  • ... and 78 more: https://git.openjdk.org/jdk/compare/0dda3c14ebe040158dcc5a87d349d5286c48b573...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@JoeWang-Java) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 28, 2022
@JoeWang-Java
Copy link
Member

Thanks for the update.

@bwhuang-us
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 1, 2022
@openjdk
Copy link

openjdk bot commented Aug 1, 2022

@bwhuang-us
Your change (at version 2ac600c) is now ready to be sponsored by a Committer.

@JoeWang-Java
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 1, 2022

Going to push as commit 57bf603.
Since your change was applied there have been 89 commits pushed to the master branch:

  • 1df77ec: 8291060: OPEN_MAX is no longer the max limit on macOS >= 10.6 for RLIMIT_NOFILE
  • fcc1195: 8290531: Loom: Parallelize a few tests more deeply
  • 226b8e6: 8290885: java/lang/ProcessBuilder/PipelineLeaksFD.java fail: More or fewer pipes than expected
  • 464085e: 8291558: unify print_jni_name_prefix_on and print_jni_name_suffix_on on posix platforms
  • f5d1b5b: 6463708: DefaultButtonModel.setMnemonic generates ChangeEvent for no change
  • 30205bb: 8290966: G1: Record number of PLAB filled and number of direct allocations
  • 86ef7b2: 8289046: Undefined Behaviour in x86 class Assembler
  • d61c0c7: 8290497: some tests in com/sun/jdi fail on localized Windows platform
  • 7ff1969: 8290067: Show stack dimensions in UL logging when attaching threads
  • 257c71c: 8290062: Remove nmethodLocker for nmethods on-stack
  • ... and 79 more: https://git.openjdk.org/jdk/compare/0dda3c14ebe040158dcc5a87d349d5286c48b573...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 1, 2022
@openjdk openjdk bot closed this Aug 1, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Aug 1, 2022
@openjdk
Copy link

openjdk bot commented Aug 1, 2022

@JoeWang-Java @bwhuang-us Pushed as commit 57bf603.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@bwhuang-us bwhuang-us deleted the JDK-8289948 branch March 1, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
2 participants