Author: markt
Date: Fri Feb 27 15:01:53 2015
New Revision: 1662714

URL: http://svn.apache.org/r1662714
Log:
Ensure test cleans up after itself.
Without the clean-up it may trigger failures in other tests

Modified:
    
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

Modified: 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java?rev=1662714&r1=1662713&r2=1662714&view=diff
==============================================================================
--- 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
(original)
+++ 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java 
Fri Feb 27 15:01:53 2015
@@ -29,7 +29,6 @@ import javax.websocket.WebSocketContaine
 
 import org.junit.Assert;
 import org.junit.Test;
-
 import org.apache.catalina.Context;
 import org.apache.catalina.servlets.DefaultServlet;
 import org.apache.catalina.startup.Tomcat;
@@ -147,5 +146,23 @@ public class TestWebSocketFrameClientSSL
         if (openConnectionCount != 0) {
             Assert.fail("There are [" + openConnectionCount + "] connections 
still open");
         }
+
+        // Close the client session.
+        wsSession.close();
+
+        // Make sure the background process has stopped (else in some test
+        // environments it will continue to run and break other tests that 
check
+        // it has stopped.
+        count = 0;
+        while (count < 50) {
+            if (BackgroundProcessManager.getInstance().getProcessCount() == 0) 
{
+                break;
+            }
+            Thread.sleep(100);
+            count++;
+        }
+
+        Assert.assertEquals(0, 
BackgroundProcessManager.getInstance().getProcessCount());
+
     }
 }



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

Reply via email to