tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1345732 - /tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
Date Sun, 03 Jun 2012 18:14:21 GMT
Author: markt
Date: Sun Jun  3 18:14:20 2012
New Revision: 1345732

URL: http://svn.apache.org/viewvc?rev=1345732&view=rev
Log:
More refactoring - no functional change

Modified:
    tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java

Modified: tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java?rev=1345732&r1=1345731&r2=1345732&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java (original)
+++ tomcat/trunk/test/org/apache/catalina/websocket/TestWebSocket.java Sun Jun  3 18:14:20
2012
@@ -61,7 +61,7 @@ public class TestWebSocket extends Tomca
 
         tomcat.start();
 
-        WebSocketClient client= new WebSocketClient();
+        WebSocketClient client= new WebSocketClient(getPort());
 
 
         // Send the WebSocket handshake
@@ -101,7 +101,7 @@ public class TestWebSocket extends Tomca
         tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
 
         tomcat.start();
-        WebSocketClient client= new WebSocketClient();
+        WebSocketClient client= new WebSocketClient(getPort());
 
         // Send the WebSocket handshake
         client.writer.write("GET /examples/websocket/echoStream HTTP/1.1" + CRLF);
@@ -138,7 +138,7 @@ public class TestWebSocket extends Tomca
         tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
 
         tomcat.start();
-        WebSocketClient client= new WebSocketClient();
+        WebSocketClient client= new WebSocketClient(getPort());
 
 
         // Send the WebSocket handshake
@@ -166,7 +166,7 @@ public class TestWebSocket extends Tomca
         tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
 
         tomcat.start();
-        WebSocketClient client= new WebSocketClient();
+        WebSocketClient client= new WebSocketClient(getPort());
 
         // Send the WebSocket handshake
         client.writer.write("GET /examples/websocket/echoStream HTTP/1.1" + CRLF);
@@ -192,7 +192,7 @@ public class TestWebSocket extends Tomca
         tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
 
         tomcat.start();
-        WebSocketClient client= new WebSocketClient();
+        WebSocketClient client= new WebSocketClient(getPort());
 
         // Send the WebSocket handshake
         client.writer.write("GET /examples/websocket/echoStream HTTP/1.1" + CRLF);
@@ -235,8 +235,7 @@ public class TestWebSocket extends Tomca
     }
 
 
-
-    private class WebSocketClient {
+    private static class WebSocketClient {
         private OutputStream os;
         private InputStream is;
         private boolean isContinuation = false;
@@ -245,8 +244,8 @@ public class TestWebSocket extends Tomca
         private Writer writer ;
         private BufferedReader reader;
 
-        private WebSocketClient() {
-            SocketAddress addr = new InetSocketAddress("localhost", getPort());
+        public WebSocketClient(int port) {
+            SocketAddress addr = new InetSocketAddress("localhost", port);
             socket = new Socket();
             try {
                 socket.setSoTimeout(10000);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message