Skip to content

Commit

Permalink
Adapt even more usage of HttpServer to API in jdk17
Browse files Browse the repository at this point in the history
  • Loading branch information
RealCLanger committed Jul 4, 2024
1 parent 620d016 commit 25e9b8a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/jdk/java/net/ProxySelector/LoopbackAddresses.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
3 changes: 2 additions & 1 deletion test/jdk/java/net/ProxySelector/ProxyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion test/jdk/java/net/URL/PerConnectionProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
3 changes: 2 additions & 1 deletion test/jdk/java/net/URLConnection/B5052093.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 25e9b8a

Please sign in to comment.