You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2015/12/11 11:35:42 UTC

svn commit: r1719334 - /tomcat/trunk/test/org/apache/tomcat/websocket/server/TestClose.java

Author: markt
Date: Fri Dec 11 10:35:42 2015
New Revision: 1719334

URL: http://svn.apache.org/viewvc?rev=1719334&view=rev
Log:
Remove invalid test.
>From section 2.1.5 of the WebSocket 1.1 specification:
"If the close was initiated by the remote peer, the implementation must use the close code and reason sent in the WebSocket protocol close frame."
So even though the sending of the server's close frame fails, the server endpoint still must see the close code from the client.

Enable tests now they all pass.

Modified:
    tomcat/trunk/test/org/apache/tomcat/websocket/server/TestClose.java

Modified: tomcat/trunk/test/org/apache/tomcat/websocket/server/TestClose.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/server/TestClose.java?rev=1719334&r1=1719333&r2=1719334&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/websocket/server/TestClose.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/server/TestClose.java Fri Dec 11 10:35:42 2015
@@ -35,7 +35,7 @@ import javax.websocket.server.ServerEndp
 
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Ignore;
+//import org.junit.Ignore;
 import org.junit.Test;
 
 import org.apache.catalina.Context;
@@ -49,7 +49,7 @@ import org.apache.juli.logging.LogFactor
 /**
  * Test the behavior of closing websockets under various conditions.
  */
-@Ignore // Only because they don't pass at the moment.
+//@Ignore // Only because they don't pass at the moment.
 public class TestClose extends TomcatBaseTest {
 
     private static Log log = LogFactory.getLog(TestClose.class);
@@ -198,23 +198,6 @@ public class TestClose extends TomcatBas
 
 
     @Test
-    public void testWsCloseThenTcpCloseInOnMessage() throws Exception {
-        startServer(TestEndpointConfig.class);
-
-        TesterWsCloseClient client = new TesterWsCloseClient("localhost", getPort());
-        client.httpUpgrade(BaseEndpointConfig.PATH);
-        client.sendMessage("Test");
-        awaitLatch(events.onMessageCalled, "onMessage not called");
-
-        client.sendCloseFrame(CloseCodes.NORMAL_CLOSURE);
-        client.closeSocket();
-        events.onMessageWait.countDown();
-
-        awaitOnClose(CloseCodes.CLOSED_ABNORMALLY);
-    }
-
-
-    @Test
     public void testTcpCloseWhenOnMessageSends() throws Exception {
         events.onMessageSends = true;
         testTcpCloseInOnMessage();
@@ -231,13 +214,26 @@ public class TestClose extends TomcatBas
     @Test
     public void testWsCloseThenTcpCloseWhenOnMessageSends() throws Exception {
         events.onMessageSends = true;
-        testWsCloseThenTcpCloseInOnMessage();
+
+        startServer(TestEndpointConfig.class);
+
+        TesterWsCloseClient client = new TesterWsCloseClient("localhost", getPort());
+        client.httpUpgrade(BaseEndpointConfig.PATH);
+        client.sendMessage("Test");
+        awaitLatch(events.onMessageCalled, "onMessage not called");
+
+        client.sendCloseFrame(CloseCodes.NORMAL_CLOSURE);
+        client.closeSocket();
+        events.onMessageWait.countDown();
+
+        awaitOnClose(CloseCodes.CLOSED_ABNORMALLY);
     }
 
 
     @Test
     public void testWsCloseThenTcpResetWhenOnMessageSends() throws Exception {
         events.onMessageSends = true;
+
         startServer(TestEndpointConfig.class);
 
         TesterWsCloseClient client = new TesterWsCloseClient("localhost", getPort());



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