knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From su...@apache.org
Subject knox git commit: KNOX-900 - In the WebsocketMultipleConnectionTest before sending data check whether the socket is active
Date Sat, 04 Mar 2017 11:30:03 GMT
Repository: knox
Updated Branches:
  refs/heads/v0.12.0 ebc9c520c -> f47259c0c


KNOX-900 - In the WebsocketMultipleConnectionTest before sending data check whether the socket
is active


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/f47259c0
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/f47259c0
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/f47259c0

Branch: refs/heads/v0.12.0
Commit: f47259c0ca78ba7774c72f92793777dd1501ecf4
Parents: ebc9c52
Author: Sandeep More <more@apache.org>
Authored: Fri Mar 3 13:48:52 2017 -0500
Committer: Sumit Gupta <sumit@apache.org>
Committed: Sat Mar 4 06:29:57 2017 -0500

----------------------------------------------------------------------
 .../gateway/websockets/WebsocketMultipleConnectionTest.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/f47259c0/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
b/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
index a8e8d46..6ca2a8b 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/websockets/WebsocketMultipleConnectionTest.java
@@ -161,8 +161,10 @@ public class WebsocketMultipleConnectionTest {
     }
 
     for (int i = 0; i < MAX_CONNECTIONS; i++) {
-
-      sessions[i].getBasicRemote().sendText("OK");
+      /* make sure the session is active and valid before trying to connect */
+      if(sessions[i].isOpen() && sessions[i].getBasicRemote() != null) {
+        sessions[i].getBasicRemote().sendText("OK");
+      }
     }
 
     latch.await(5 * MAX_CONNECTIONS, TimeUnit.MILLISECONDS);


Mime
View raw message