You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by mo...@apache.org on 2017/03/03 18:49:03 UTC
knox git commit: KNOX-900 - In the WebsocketMultipleConnectionTest
before sending data check whether the socket is active
Repository: knox
Updated Branches:
refs/heads/master 7484e3e7d -> ade9d7a99
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/ade9d7a9
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/ade9d7a9
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/ade9d7a9
Branch: refs/heads/master
Commit: ade9d7a9967b8f2d229e2c214566c1de0322829a
Parents: 7484e3e
Author: Sandeep More <mo...@apache.org>
Authored: Fri Mar 3 13:48:52 2017 -0500
Committer: Sandeep More <mo...@apache.org>
Committed: Fri Mar 3 13:48:52 2017 -0500
----------------------------------------------------------------------
.../gateway/websockets/WebsocketMultipleConnectionTest.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/knox/blob/ade9d7a9/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);