RFR: 8378398: Modernize test/jdk/java/net/URLClassLoader/HttpTest.java

Eirik Bjørsnøs eirbjo at openjdk.org
Sun Feb 22 11:07:56 UTC 2026


Please review this PR which modernizes `test/jdk/java/net/URLClassLoader/HttpTest.java`, a test verifying HTTP requests made by a URLClassLoader with HTTP search paths.

The test is updated to replace a custom `HttpServer` class with one using `com.sun.net.httpserver`. Instead of simply counting GET and HEAD requests, the test now captures each request's method and URI in a log, which allows more precise asserts on the expected request patterns.

The test is updated to use JUnit 5.

For good measure, some negative test methods are added, verifying expected HTTP requests when one of the HTTP paths returns a 404 response.

Test-only enhancement, `noreg-self`

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

Commit messages:
 - Modernize HttpTest

Changes: https://git.openjdk.org/jdk/pull/29864/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29864&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8378398
  Stats: 258 lines in 1 file changed: 63 ins; 108 del; 87 mod
  Patch: https://git.openjdk.org/jdk/pull/29864.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29864/head:pull/29864

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


More information about the net-dev mailing list