Skip to content

8378398: Modernize test/jdk/java/net/URLClassLoader/HttpTest.java#29864

Closed
eirbjo wants to merge 8 commits intoopenjdk:masterfrom
eirbjo:modernize-ucl-httptest
Closed

8378398: Modernize test/jdk/java/net/URLClassLoader/HttpTest.java#29864
eirbjo wants to merge 8 commits intoopenjdk:masterfrom
eirbjo:modernize-ucl-httptest

Conversation

@eirbjo
Copy link
Contributor

@eirbjo eirbjo commented Feb 22, 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


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8378398: Modernize test/jdk/java/net/URLClassLoader/HttpTest.java (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29864/head:pull/29864
$ git checkout pull/29864

Update a local copy of the PR:
$ git checkout pull/29864
$ git pull https://git.openjdk.org/jdk.git pull/29864/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 29864

View PR using the GUI difftool:
$ git pr show -t 29864

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29864.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 22, 2026

👋 Welcome back eirbjo! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Feb 22, 2026

@eirbjo This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

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

Reviewed-by: dfuchs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 132 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the net net-dev@openjdk.org label Feb 22, 2026
@openjdk
Copy link

openjdk bot commented Feb 22, 2026

@eirbjo The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@eirbjo eirbjo marked this pull request as ready for review February 22, 2026 11:02
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 22, 2026
@mlbridge
Copy link

mlbridge bot commented Feb 22, 2026

Webrevs

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Eirik, overall good cleanup!

@@ -25,232 +25,245 @@
* @test
* @bug 4636331
* @library /test/lib
* @summary Check that URLClassLoader doesn't create excessive http
* connections
* @summary Check that URLClassLoader with HTTP paths lookups produce the expected http requests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Thanks, fixed.

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

Based on the discussion in https://mail.openjdk.org/pipermail/net-dev/2026-February/030179.html, I opted to add some more redirect tests (including failing redirect targets) and to add note comments / notes explaining the somewhat suboptimal, but long-standing redirect behavior.

Could you take a look at those and re-spin any testing?

Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the cleanup.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 26, 2026
@eirbjo
Copy link
Contributor Author

eirbjo commented Feb 26, 2026

Thanks Daniel for the review and help in CI testing!

/integrate

@openjdk
Copy link

openjdk bot commented Feb 26, 2026

Going to push as commit 3b8abd4.
Since your change was applied there have been 132 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 26, 2026
@openjdk openjdk bot closed this Feb 26, 2026
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 26, 2026
@openjdk
Copy link

openjdk bot commented Feb 26, 2026

@eirbjo Pushed as commit 3b8abd4.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated net net-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants