--- a/test/jdk/java/net/httpclient/websocket/WebSocketTest.java Thu Feb 01 15:37:38 2018 +0000
+++ b/test/jdk/java/net/httpclient/websocket/WebSocketTest.java Thu Feb 01 16:12:28 2018 +0000
@@ -145,6 +145,22 @@
}
}
+ private static DummyWebSocketServer serverWithCannedData(int... data) {
+ byte[] copy = new byte[data.length];
+ for (int i = 0; i < data.length; i++) {
+ copy[i] = (byte) data[i];
+ }
+ return new DummyWebSocketServer() {
+ @Override
+ protected void serve(SocketChannel channel) throws IOException {
+ ByteBuffer closeMessage = ByteBuffer.wrap(copy);
+ int wrote = channel.write(closeMessage);
+ System.out.println("Wrote bytes: " + wrote);
+ super.serve(channel);
+ }
+ };
+ }
+
@Test
public void testNull() throws IOException {
try (DummyWebSocketServer server = new DummyWebSocketServer()) {
@@ -226,22 +242,6 @@
};
}
- private static DummyWebSocketServer serverWithCannedData(int... data) {
- byte[] copy = new byte[data.length];
- for (int i = 0; i < data.length; i++) {
- copy[i] = (byte) data[i];
- }
- return new DummyWebSocketServer() {
- @Override
- protected void serve(SocketChannel channel) throws IOException {
- ByteBuffer closeMessage = ByteBuffer.wrap(copy);
- int wrote = channel.write(closeMessage);
- System.out.println("Wrote bytes: " + wrote);
- super.serve(channel);
- }
- };
- }
-
@Test
public void testIllegalArgument() throws IOException {
try (DummyWebSocketServer server = new DummyWebSocketServer()) {
@@ -549,7 +549,6 @@
0x00, 0x01, 0x61, // a
0x80, 0x00, // "
0x88, 0x00 // <CLOSE>
-
};
CompletableFuture<List<String>> actual = new CompletableFuture<>();