8310049: Refactor Charset tests to use JUnit#14500
8310049: Refactor Charset tests to use JUnit#14500justin-curtis-lu wants to merge 28 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jlu! A progress list of the required criteria for merging this PR into |
|
@justin-curtis-lu The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
LanceAndersen
left a comment
There was a problem hiding this comment.
Thanks for starting this migration/refactor.
I would use this as an opportunity to add additional comments introducing the tests and the relevant parameterized lists et al
|
|
||
| /* @test | ||
| * @bug 4422044 | ||
| * @bug 4422044 8310049 |
There was a problem hiding this comment.
As this is just a refactor, I don't think you need the bug number for converting to junit
There was a problem hiding this comment.
Fixed, in this file and the others
naotoj
left a comment
There was a problem hiding this comment.
Thanks for the clean-up. Some comments follow:
| */ | ||
| @ParameterizedTest | ||
| @MethodSource("standardCharsets") | ||
| public void standardCharsetsTest(Charset containerCs, Charset cs, boolean cont){ |
There was a problem hiding this comment.
ISO-8859-15 and CP1252 are not StandardCharsets so renaming the method to standardCharsetsTest seems incorrect.
There was a problem hiding this comment.
Did not realize, thank you. I simply renamed it to charsets (as I am not sure if those tested are supposed to represent a particular group, or if they are just random).
| @@ -1,36 +0,0 @@ | |||
| /* | |||
There was a problem hiding this comment.
This class is used in DefaultCharsetTest so don't remove it.
There was a problem hiding this comment.
Fixed, thank you
| // Charset.forName should throw an exception when passed "default" | ||
| @Test | ||
| public void defaultCharsetTest() { | ||
| assertThrows(UnsupportedCharsetException.class, | ||
| () -> Charset.forName("default")); | ||
| } |
There was a problem hiding this comment.
Seems incorrect to merge this test into IllegalCharsetName.java because it is throwing UnsupportedCharsetException.
There was a problem hiding this comment.
I moved it back to RegisteredCharsets.java
| // Charset.forName should throw an exception when passed null | ||
| @Test | ||
| public void nullCharsetTest() { | ||
| assertThrows(IllegalArgumentException.class, | ||
| () -> Charset.forName(null)); | ||
| } |
There was a problem hiding this comment.
Missed this one previously. This one is also not IllegalCharsetName, so I'd prefer not to merge this either.
There was a problem hiding this comment.
I guess when I think of illegal (I group anything that is wrong, so I initially included null and "default"). But you are right that it does not throw IllegalCharsetNameException so it should be moved into its own test. Fixed.
|
@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: 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 25 new commits pushed to the
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 |
|
/integrate |
|
Going to push as commit 09174e0.
Your commit was automatically rebased without conflicts. |
|
@justin-curtis-lu Pushed as commit 09174e0. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
As discussed in https://github.com/openjdk/jdk/pull/14473/files, tests within test/jdk/java/nio/charset/Charset could benefit from using a test framework such as JUnit.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14500/head:pull/14500$ git checkout pull/14500Update a local copy of the PR:
$ git checkout pull/14500$ git pull https://git.openjdk.org/jdk.git pull/14500/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14500View PR using the GUI difftool:
$ git pr show -t 14500Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14500.diff
Webrev
Link to Webrev Comment