RFR: 8288885: Introduce a jwebserver launcher utility in test library for jtreg tests [v2]

Jaikiran Pai jpai at openjdk.org
Wed Jun 22 08:24:52 UTC 2022


On Wed, 22 Jun 2022 08:01:31 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> My main concern with locating JWebServerLauncher in the lib tree is that I don't have a good feel yet what tests might want an out-of-process HTTP server.

The use case that prompted me to create this utility is a very specific case where a certain change is/will be done in the `jwebserver`'s "entry point" which is the code here https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/master/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java__;!!ACWV5N9M2RV99hQ!NyLU4_V1HnoB2D94XzgyeCfpEYwCaHk18mv07esq_4gjXTnyvvP876zmk6xtlOwioM9cPnXifBd7L44$  (although the javadoc of that class says "Programmatic entry point...", it actually isn't a programmatic one but is the entry point from `jwebserver` (or `jwebserver.exe`) command as setup here in the build https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/master/make/modules/jdk.httpserver/Launcher.gmk__;!!ACWV5N9M2RV99hQ!NyLU4_V1HnoB2D94XzgyeCfpEYwCaHk18mv07esq_4gjXTnyvvP876zmk6xtlOwioM9cPnXiIFVuCZs$ ). So to make sure that we really are exercising the test against that specific part of the code, I thought of writing this utility to launch that tool. Using the existing `test/lib/jdk/test/lib/net/SimpleHttpServer.java` isn't going to be of use here since it doesn't enter the `JWebServer`'s `main` method.

However, you do have a valid point. I could perhaps just invoke the `JWebServer`'s `main` method to do the same testing without requiring this utility. I suspect you are right that it's a bit too early to have this hosted in the library tree. I am inclined to shelve/withdraw this PR, but will keep it open for a few more hours just to see if there are any other comments/inputs that are against withdrawing it.

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

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


More information about the net-dev mailing list