From d3d4f7abed3ec5ae07ba93ddd5f20d0ac8ad95f6 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 8 Aug 2013 09:46:31 -0700 Subject: [PATCH] WebSocket - quick fix to prevent jenkins test hang --- .../jetty/websocket/jsr356/server/EchoClientSocket.java | 6 +++++- .../org/eclipse/jetty/websocket/jsr356/server/EchoTest.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/EchoClientSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/EchoClientSocket.java index f974bc08a52..b4a199896a7 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/EchoClientSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/EchoClientSocket.java @@ -51,7 +51,11 @@ public class EchoClientSocket extends TrackingSocket @OnError public void onError(Throwable t) { - addError(t); + if(t == null) { + addError(new NullPointerException("Throwable should not be null")); + } else { + addError(t); + } } @OnOpen diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/EchoTest.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/EchoTest.java index d81b4ad3c3f..6d62bd2ce58 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/EchoTest.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/EchoTest.java @@ -243,7 +243,7 @@ public class EchoTest System.err.println(testcase); } - @Test + @Test(timeout=1000) public void testEcho() throws Exception { EchoClientSocket socket = new EchoClientSocket();