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-8317631: Refactor ChoiceFormat tests to use JUnit #16065

Closed
wants to merge 3 commits into from

Conversation

justin-curtis-lu
Copy link
Member

@justin-curtis-lu justin-curtis-lu commented Oct 5, 2023

Please review this PR which refactors the ChoiceFormat tests to use JUnit.


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-8317631: Refactor ChoiceFormat tests to use JUnit (Sub-task - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16065

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 5, 2023

👋 Welcome back jlu! 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 openjdk bot added the rfr Pull request is ready for review label Oct 5, 2023
@openjdk
Copy link

openjdk bot commented Oct 5, 2023

@justin-curtis-lu 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 Oct 5, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 5, 2023

Webrevs

Comment on lines 74 to 78
// Compare the expected results with the new formatted results
assertEquals(after.toString(), original,
"Mutating array returned from getter changed internals of ChoiceFormat");

// Modify the array passed to setFormats() -> dayOfWeekNames
Copy link
Member

Choose a reason for hiding this comment

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

I think we should keep the err variable, and not throw an exception (and end the test) here. Otherwise, the test after this will not run.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, I should have actually split this larger test into two separate tests (one for the getter / one for the setter), then there would be no need for err.

I have updated the PR with the change I mentioned. Thank you for reviewing.

Copy link
Member

@naotoj naotoj left a comment

Choose a reason for hiding this comment

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

Good point dividing the test for granularity. Looks good

double[] newLimits = form.getLimits();
String[] newFormats = (String[])form.getFormats();
/*
* Ensure that mutating he arrays returned by getChoices and getLimits does
Copy link
Member

Choose a reason for hiding this comment

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

Nit: typo "he"

@openjdk
Copy link

openjdk bot commented Oct 6, 2023

@justin-curtis-lu 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:

8317631: Refactor ChoiceFormat tests to use JUnit

Reviewed-by: naoto

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 10 new commits pushed to the master branch:

  • 6c6beba: 8317128: java/nio/file/Files/CopyAndMove.java failed with AccessDeniedException
  • b62e774: 8317515: Unify the code of the parse*() families of methods in j.l.Integer and j.l.Long
  • a64794b: 8317560: Change to Xcode 14.3.1 for building on macOS at Oracle
  • b3cc0c8: 8317318: Serial: Change GenCollectedHeap to SerialHeap in whitebox
  • 691db5d: 8317592: Serial: Remove Space::toContiguousSpace
  • ec9ba5d: 8317660: [BACKOUT] 8269393: store/load order not preserved when handling memory pool due to weakly ordered memory architecture of aarch64
  • 7162624: 8269393: store/load order not preserved when handling memory pool due to weakly ordered memory architecture of aarch64
  • f0d66d1: 8317502: Add asserts to check for non-null in ciInstance::java_lang_Class_klass
  • 991ce84: 4964430: (spec) missing IllegalStateException exception requirement for javax.crypto.Cipher.doFinal
  • 8a30c2a: 8317443: StackOverflowError on calling ListFormat::getInstance() for Norwegian locales

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 6, 2023
@justin-curtis-lu
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 9, 2023

Going to push as commit 5e8d893.
Since your change was applied there have been 23 commits pushed to the master branch:

  • f61499c: 8316608: Enable parallelism in vmTestbase/gc/vector tests
  • 3ff5a78: 8317693: Unused parameter to Tokens.Token.comment method
  • 508fa71: 8317736: Stream::handleReset locks twice
  • 1f06325: 8317471: ListFormat::parseObject() spec can be improved on parsePosition valid values
  • a07a4a3: 8317422: [JVMCI] concurrency issue in MethodData creation
  • 7ff1938: 8310727: C2: *_of() methods in PhaseIterGVN should use uint for the node index
  • a57ae7e: 8317594: G1: Refactor find_empty_from_idx_reverse
  • 6ddbfaa: 8317136: [AIX] Problem List runtime/jni/terminatedThread/TestTerminatedThread.java
  • 0cf1a55: 8317440: Lock rank checking fails when code root set is modified with the Servicelock held after JDK-8315503
  • bcc986b: 8317601: Windows build on WSL broken after JDK-8317340
  • ... and 13 more: https://git.openjdk.org/jdk/compare/a1c9587c27538bda3b0f6745d9c80ff4e1b9a77e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 9, 2023
@openjdk openjdk bot closed this Oct 9, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 9, 2023
@openjdk
Copy link

openjdk bot commented Oct 9, 2023

@justin-curtis-lu Pushed as commit 5e8d893.

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

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
Development

Successfully merging this pull request may close these issues.

2 participants