--- a/test/jdk/com/sun/net/httpserver/bugs/6725892/Test.java Wed Mar 27 13:00:57 2019 -0700
+++ b/test/jdk/com/sun/net/httpserver/bugs/6725892/Test.java Wed Mar 27 09:06:43 2019 -0700
@@ -24,6 +24,7 @@
/**
* @test
* @bug 6725892
+ * @library /test/lib
* @run main/othervm -Dsun.net.httpserver.maxReqTime=2 Test
* @summary
*/
@@ -36,6 +37,8 @@
import java.net.*;
import javax.net.ssl.*;
+import jdk.test.lib.net.URIBuilder;
+
public class Test {
static HttpServer s1;
@@ -76,7 +79,13 @@
port = s1.getAddress().getPort();
System.out.println ("Server on port " + port);
- url = new URL ("http://127.0.0.1:"+port+"/foo");
+ url = URIBuilder.newBuilder()
+ .scheme("http")
+ .loopback()
+ .port(port)
+ .path("/foo")
+ .toURLUnchecked();
+ System.out.println("URL: " + url);
test1();
test2();
test3();