diff --git a/test/jdk/java/net/ProxySelector/LoopbackAddresses.java b/test/jdk/java/net/ProxySelector/LoopbackAddresses.java index 8e27185d518..4af9f4db866 100644 --- a/test/jdk/java/net/ProxySelector/LoopbackAddresses.java +++ b/test/jdk/java/net/ProxySelector/LoopbackAddresses.java @@ -64,7 +64,8 @@ public static void main(String[] args) { // to answer both for the loopback and "localhost". // Though "localhost" usually point to the loopback there is no // hard guarantee. - server = HttpServer.create(new InetSocketAddress(loopback, 0), 10, "/", new LoopbackAddressesHandler()); + server = HttpServer.create(new InetSocketAddress(loopback, 0), 10); + server.createContext("/", new LoopbackAddressesHandler()); server.setExecutor(Executors.newSingleThreadExecutor()); server.start(); ProxyServer pserver = new ProxyServer(InetAddress.getByName("localhost"), server.getAddress().getPort()); diff --git a/test/jdk/java/net/ProxySelector/ProxyTest.java b/test/jdk/java/net/ProxySelector/ProxyTest.java index 179cc886c00..4459f796b91 100644 --- a/test/jdk/java/net/ProxySelector/ProxyTest.java +++ b/test/jdk/java/net/ProxySelector/ProxyTest.java @@ -79,7 +79,8 @@ public static void main(String[] args) { ProxySelector.setDefault(new MyProxySelector()); try { InetAddress loopback = InetAddress.getLoopbackAddress(); - server = HttpServer.create(new InetSocketAddress(loopback, 0), 10, "/", new ProxyTestHandler()); + server = HttpServer.create(new InetSocketAddress(loopback, 0), 10); + server.createContext("/", new ProxyTestHandler()); server.setExecutor(Executors.newSingleThreadExecutor()); server.start(); URL url = URIBuilder.newBuilder() diff --git a/test/jdk/java/net/URL/PerConnectionProxy.java b/test/jdk/java/net/URL/PerConnectionProxy.java index 1877e7cef28..6c66c10d12e 100644 --- a/test/jdk/java/net/URL/PerConnectionProxy.java +++ b/test/jdk/java/net/URL/PerConnectionProxy.java @@ -54,7 +54,8 @@ public class PerConnectionProxy { public static void main(String[] args) { try { InetAddress loopbackAddress = InetAddress.getLoopbackAddress(); - server = HttpServer.create(new InetSocketAddress(loopbackAddress, 0), 10, "/", new PerConnectionProxyHandler()); + server = HttpServer.create(new InetSocketAddress(loopbackAddress, 0), 10); + server.createContext("/", new PerConnectionProxyHandler()); server.setExecutor(Executors.newSingleThreadExecutor()); server.start(); ProxyServer pserver = new ProxyServer(loopbackAddress, server.getAddress().getPort()); diff --git a/test/jdk/java/net/URLConnection/B5052093.java b/test/jdk/java/net/URLConnection/B5052093.java index c93098f2de8..cb1b591d322 100644 --- a/test/jdk/java/net/URLConnection/B5052093.java +++ b/test/jdk/java/net/URLConnection/B5052093.java @@ -67,7 +67,8 @@ public LargeFileURLConnection(LargeFile f) throws IOException { public static void main(String[] args) throws Exception { InetAddress loopback = InetAddress.getLoopbackAddress(); - server = HttpServer.create(new InetSocketAddress(loopback, 0), 10, "/", new B5052093Handler()); + server = HttpServer.create(new InetSocketAddress(loopback, 0), 10); + server.createContext("/", new B5052093Handler()); server.setExecutor(Executors.newSingleThreadExecutor()); server.start(); try {