> 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)
Eirik Bjørsnøs has updated the pull request incrementally with one additional commit since the last revision: Sanity check that the JarFileFactory caches are unpopulated at start of a test run ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22319/files - new: https://git.openjdk.org/jdk/pull/22319/files/b49bc034..5d0be877 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22319&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22319&range=00-01 Stats: 24 lines in 1 file changed: 20 ins; 3 del; 1 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