Can I get a review of this test-only cleanup/speedup PR which modernizes the 
test `RemoveJar.java`.

This test attempts a variety of class loading scenarios on a URLClassLoader and 
verifies that when the loader is closed, it has released its JAR file (such 
that it may be deleted on Windows).

Changes in this PR include:

* Converting the test to JUnit 5
* Making it `@Parameterized` instead of using multiple jtreg runs
* Producing the sample class file using the ClassFile API instead calling out 
to `javac` via ToolProvider
* Packaging the JAR using `JarOutputStream` instead of calling out to the `jar` 
tool.
* Adding some code and method comments to support understading of what this 
test does and why 

A nice benefit of this change is that it speeds up the runtime from ~15 seconds 
to ~1 second on my laptop.

Unfortunately, this test relies on Windows to fail, that is something I plan to 
look into separately.

Verification: GHA tests pending. (No local Windows dev environment)

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

Commit messages:
 - Convert RemoveJar to a parameterized JUnit 5 test

Changes: https://git.openjdk.org/jdk/pull/22319/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22319&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8344854
  Stats: 179 lines in 1 file changed: 62 ins; 81 del; 36 mod
  Patch: https://git.openjdk.org/jdk/pull/22319.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22319/head:pull/22319

PR: https://git.openjdk.org/jdk/pull/22319

Reply via email to