RFR: 8377675: java.net.http tests should not depend on ../../../com/sun/net/httpserver test classes [v3]
Daniel Fuchs
dfuchs at openjdk.org
Fri Feb 13 12:30:43 UTC 2026
> Some HttpClient tests - like `test/jdk/java/net/httpclient/SmokeTest.java`, depend on non-library test classes that were developed for testing the HttpServer, such as `../../../com/sun/net/httpserver/FileServerHandler.java` which requires compiling using `@compile`.
>
> Instead of depending on HttpServer test classes, these tests should use functionalities from the common servers provided by the `HttpServerAdapters`, offered by the `test/jdk/java/net/httpclient/lib` library. An adapted version of the `../../../com/sun/net/httpserver/FileServerHandler.java` could be provided by the `HttpServerAdapters` helper.
>
> There are also 5 implementations of stand-alone echo handlers in the httpclient test base. This change remove 4 of them, keep only the implementation in `HttpServerAdapters`, and updates all tests that were relying on the removed implementations to use that provided by `HttpServerAdapters`.
>
> This is a test-only change.
Daniel Fuchs has updated the pull request incrementally with two additional commits since the last revision:
- Update test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java
Co-authored-by: Daniel Jelinski <djelinski1 at gmail.com>
- Update test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java
Co-authored-by: Daniel Jelinski <djelinski1 at gmail.com>
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/29702/files
- new: https://git.openjdk.org/jdk/pull/29702/files/5d183ca4..91ee1b7b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=29702&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=29702&range=01-02
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/29702.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29702/head:pull/29702
PR: https://git.openjdk.org/jdk/pull/29702
More information about the net-dev
mailing list