[jdk11u-dev] RFR: 8061729: Update java/net tests to eliminate dependency on sun.net.www.MessageHeader and some other internal APIs
Amos Shi
ashi at openjdk.org
Fri Mar 15 07:43:59 UTC 2024
Backport of [JDK-8061729](https://bugs.openjdk.org/browse/JDK-8061729)
There are 3 commits in this PR
- Commit 1. `git apply` clean backport from original commit. All files is clean, except `ProxyFromCache.java`
- Commit 2. Manully apply changes to `ProxyFromCache.java`. the following lines in the file cannot be applied automatically, we manually merged the same change.
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,22 @@
* @test
* @bug 6498566
* @summary URL.openConnection(Proxy.NO_PROXY) may connect through a proxy.
- * @modules java.base/sun.net.www
* @library /test/lib
* @run main/othervm ProxyFromCache
*/
-import java.net.*;
-import java.io.*;
-import sun.net.www.MessageHeader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.Proxy;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URL;
+
+import jdk.test.lib.net.HttpHeaderParser;
import jdk.test.lib.net.URIBuilder;
/* Creates a simple proxy and http server that just return 200 OK.
- Commit 3. Fix compile error in `HttpHeaderParser.java`: the `switch case arrow` is not avaible in Java 11
Testing
- Local: Passed on MacOS M1 laptop
- `ProxyFromCache.java` - Test results: passed: 1
- `RequestURI.java` - Test results: passed: 1
- `CloseOptionHeader.java` - Test results: passed: 1
- `HttpHeaderParserTest.java` - Test results: passed: 1
- `NTLMTest.java` - Test results: passed: 1
- `NoNTLM.java` - Test results: passed: 1
- `RetryUponTimeout.java` - Test results: passed: 1
- `UserAgent.java` - Test results: passed: 1
- `B6226610.java` - Test results: passed: 1
- `TunnelProxy.java` - Not a test or directory containing tests: sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java
- `HttpHeaderParser.java` - Cannot determine test suite from test (is TEST.ROOT missing?): dev-8061729-11/test/lib/jdk/test/lib/net/HttpHeaderParser.java
- Pipeline: All checks have passed
- Testing Machine: SAP nightlies passed on `2024-03-13,14,15`
-------------
Commit messages:
- Fix pipeline issue: Whitespace errors
- Fix compile error on Java 11: switch case arrow
- ProxyFromCache.java manually apply
- Backport 0f3d3ac32c9d163a5d91c6839d313111c72f1ad4
Changes: https://git.openjdk.org/jdk11u-dev/pull/2596/files
Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=2596&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8061729
Stats: 979 lines in 11 files changed: 922 ins; 11 del; 46 mod
Patch: https://git.openjdk.org/jdk11u-dev/pull/2596.diff
Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/2596/head:pull/2596
PR: https://git.openjdk.org/jdk11u-dev/pull/2596
More information about the jdk-updates-dev
mailing list