Author: markt Date: Fri Sep 18 15:34:30 2015 New Revision: 1703890 URL: http://svn.apache.org/viewvc?rev=1703890&view=rev Log: Test case for bug 58414. This passes without any changes. Is there something else going on?
Modified: tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java Modified: tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java?rev=1703890&r1=1703889&r2=1703890&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java (original) +++ tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java Fri Sep 18 15:34:30 2015 @@ -62,6 +62,7 @@ import org.apache.tomcat.websocket.serve public class TestWsWebSocketContainer extends TomcatBaseTest { + private static final String MESSAGE_EMPTY = ""; private static final String MESSAGE_STRING_1 = "qwerty"; private static final String MESSAGE_TEXT_4K; private static final byte[] MESSAGE_BINARY_4K = new byte[4096]; @@ -937,7 +938,18 @@ public class TestWsWebSocketContainer ex @Test - public void testPerMessageDefalteClient() throws Exception { + public void testPerMessageDefalteClient01() throws Exception { + doTestPerMessageDefalteClient01(MESSAGE_STRING_1); + } + + + @Test + public void testPerMessageDefalteClient02() throws Exception { + doTestPerMessageDefalteClient01(MESSAGE_EMPTY); + } + + + private void doTestPerMessageDefalteClient01(String msg) throws Exception { Tomcat tomcat = getTomcatInstance(); // No file system docBase required Context ctx = tomcat.addContext("", null); @@ -964,7 +976,7 @@ public class TestWsWebSocketContainer ex CountDownLatch latch = new CountDownLatch(1); BasicText handler = new BasicText(latch); wsSession.addMessageHandler(handler); - wsSession.getBasicRemote().sendText(MESSAGE_STRING_1); + wsSession.getBasicRemote().sendText(msg); boolean latchResult = handler.getLatch().await(10, TimeUnit.SECONDS); @@ -972,7 +984,7 @@ public class TestWsWebSocketContainer ex Queue<String> messages = handler.getMessages(); Assert.assertEquals(1, messages.size()); - Assert.assertEquals(MESSAGE_STRING_1, messages.peek()); + Assert.assertEquals(msg, messages.peek()); ((WsWebSocketContainer) wsContainer).destroy(); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org