tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From violet...@apache.org
Subject svn commit: r1695724 - /tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java
Date Thu, 13 Aug 2015 15:07:02 GMT
Author: violetagg
Date: Thu Aug 13 15:07:01 2015
New Revision: 1695724

URL: http://svn.apache.org/r1695724
Log:
Do not use try-with-resources

Modified:
    tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java

Modified: tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java?rev=1695724&r1=1695723&r2=1695724&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java
(original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java
Thu Aug 13 15:07:01 2015
@@ -79,7 +79,9 @@ public class TestWsServerContainer exten
         SimpleClient client = new SimpleClient();
         URI uri = new URI("ws://localhost:" + getPort() + "/echoBasic");
 
-        try (Session session = wsContainer.connectToServer(client, uri);) {
+        Session session = null;
+        try {
+            session = wsContainer.connectToServer(client, uri);
             CountDownLatch latch = new CountDownLatch(1);
             BasicText handler = new BasicText(latch);
             session.addMessageHandler(handler);
@@ -93,6 +95,10 @@ public class TestWsServerContainer exten
             for (String message : messages) {
                 Assert.assertEquals("echoBasic", message);
             }
+        } finally {
+            if (session != null) {
+                session.close();
+            }
         }
     }
 



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


Mime
View raw message