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

Daniel Fuchs dfuchs at openjdk.org
Mon Feb 23 10:39:47 UTC 2026


On Sun, 22 Feb 2026 14:39:04 GMT, Eirik Bjørsnøs <eirbjo at openjdk.org> wrote:

>> 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 one additional commit since the last revision:
> 
>   Add test for getResourceAsStream following redirects

Hi Eirik, overall good cleanup!

test/jdk/java/net/URLClassLoader/HttpTest.java line 28:

> 26:  * @bug 4636331
> 27:  * @library /test/lib
> 28:  * @summary Check that URLClassLoader with HTTP paths lookups produce the expected http requests

Since the test is now using jdk.httpserver we should add 
`@modules jdk.httpserver`

Please give us some time to verify that the new test is stable in the CI.

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

PR Review: https://git.openjdk.org/jdk/pull/29864#pullrequestreview-3840236877
PR Review Comment: https://git.openjdk.org/jdk/pull/29864#discussion_r2840091643


More information about the net-dev mailing list