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

Eirik Bjørsnøs eirbjo at openjdk.org
Sun Feb 22 14:27:01 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`

Eirik Bjørsnøs has updated the pull request incrementally with three additional commits since the last revision:

 - Synchronize access to request log in assertRequests
 - Remove unused assert code
 - Simplify request assertions

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/29864/files
  - new: https://git.openjdk.org/jdk/pull/29864/files/18758937..5f00ae9a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29864&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29864&range=00-01

  Stats: 77 lines in 1 file changed: 47 ins; 14 del; 16 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