http-client-branch: (WebSocket) cleanup http-client-branch
authorprappo
Thu, 01 Feb 2018 16:12:28 +0000
branchhttp-client-branch
changeset 56064 255e21e86b99
parent 56058 a02d0098c630
child 56065 67ca659b649f
http-client-branch: (WebSocket) cleanup
test/jdk/java/net/httpclient/websocket/WebSocketTest.java
--- 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<>();