test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/RawChannelTest.java
equal
deleted
inserted
replaced
25 |
25 |
26 import java.io.IOException; |
26 import java.io.IOException; |
27 import java.io.InputStream; |
27 import java.io.InputStream; |
28 import java.io.OutputStream; |
28 import java.io.OutputStream; |
29 import java.io.UncheckedIOException; |
29 import java.io.UncheckedIOException; |
|
30 import java.net.InetSocketAddress; |
30 import java.net.ServerSocket; |
31 import java.net.ServerSocket; |
31 import java.net.Socket; |
32 import java.net.Socket; |
32 import java.net.URI; |
33 import java.net.URI; |
33 import java.nio.ByteBuffer; |
34 import java.nio.ByteBuffer; |
34 import java.nio.channels.SelectionKey; |
35 import java.nio.channels.SelectionKey; |
78 |
79 |
79 private final CountDownLatch exit = new CountDownLatch(1); |
80 private final CountDownLatch exit = new CountDownLatch(1); |
80 |
81 |
81 @Test |
82 @Test |
82 public void test() throws Exception { |
83 public void test() throws Exception { |
83 try (ServerSocket server = new ServerSocket(0)) { |
84 try (ServerSocket server = new ServerSocket()) { |
|
85 server.setReuseAddress(false); |
|
86 server.bind(new InetSocketAddress(0)); |
84 int port = server.getLocalPort(); |
87 int port = server.getLocalPort(); |
85 new TestServer(server).start(); |
88 new TestServer(server).start(); |
86 |
89 |
87 final RawChannel chan = channelOf(port); |
90 final RawChannel chan = channelOf(port); |
88 print("RawChannel is %s", String.valueOf(chan)); |
91 print("RawChannel is %s", String.valueOf(chan)); |