RFR: 8378111: Migrate java/util/jar tests to JUnit [v3]

Lance Andersen lancea at openjdk.org
Fri Feb 27 18:51:30 UTC 2026


On Mon, 23 Feb 2026 22:56:31 GMT, Justin Lu <jlu at openjdk.org> wrote:

>> This PR migrates the java/util/jar tests to use _JUnit_.
>> 
>> https://github.com/openjdk/jdk/commit/afe0aeee746bccbbe4bc6c9a8cd2302228ecc2f6 includes changes for _testNG_ based tests.
>> https://github.com/openjdk/jdk/commit/c5a7f75840f96fa77ec3ed7faa713990adb84de6 includes changes for `main` based tests.
>> 
>> Before: Framework-based tests: 125 = 125 TestNG + 0 JUnit.
>> After: Framework-based tests: 174 = 0 TestNG + 174 JUnit
>
> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   get rid of inheritance + zip -> ZIP

Hi Justin,

I think you are pretty close.  Thank you for your efforts here.

A couple of minor suggestions on a pass through today

test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarSecurity.java line 57:

> 55:     static final String userdir = System.getProperty("user.dir", ".");
> 56:     static final File multirelease = new File(userdir, "multi-release.jar");
> 57:     static final File signedmultirelease = new File(userdir, "signed-multi-release.jar");

minor given these are now final, perhaps capitalize them?

test/jdk/java/util/jar/TestJarExtra.java line 77:

> 75:     @Test
> 76:     void jarExtraHeaderOnlyTest() throws IOException {
> 77:         testHeaderOnly();

Any reason not to  collapse testHeaderOnly into this test method vs calling it as I did not see it called twice unless I missed it

test/jdk/java/util/jar/TestJarExtra.java line 117:

> 115: 
> 116:         jos.close();
> 117: 

perhaps clean up the blank lines here if you make another pass through

-------------

PR Review: https://git.openjdk.org/jdk/pull/29828#pullrequestreview-3868448781
PR Review Comment: https://git.openjdk.org/jdk/pull/29828#discussion_r2865668533
PR Review Comment: https://git.openjdk.org/jdk/pull/29828#discussion_r2865703740
PR Review Comment: https://git.openjdk.org/jdk/pull/29828#discussion_r2865689939


More information about the core-libs-dev mailing list