From 994da4e53abe98a0f0004d7bb8c57e08c621570d Mon Sep 17 00:00:00 2001 From: jfarcand Date: Thu, 18 Oct 2012 10:53:13 -0400 Subject: [PATCH] Fix test --- .../org/atmosphere/cpr/WebSocketHandlerTest.java | 12 ++++++------ .../org/atmosphere/cpr/WebSocketProcessorTest.java | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/cpr/src/test/java/org/atmosphere/cpr/WebSocketHandlerTest.java b/modules/cpr/src/test/java/org/atmosphere/cpr/WebSocketHandlerTest.java index 1d3441b5ea5..c13232656ce 100644 --- a/modules/cpr/src/test/java/org/atmosphere/cpr/WebSocketHandlerTest.java +++ b/modules/cpr/src/test/java/org/atmosphere/cpr/WebSocketHandlerTest.java @@ -92,7 +92,7 @@ public void basicWorkflow() throws IOException, ServletException, ExecutionExcep processor.registerWebSocketHandler("/*", new EchoHandler()); AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("yoComet").pathInfo("/a").build(); - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); processor.invokeWebSocketProtocol(w, "yoWebSocket"); assertEquals(b.toString(), "yoWebSocket"); @@ -108,7 +108,7 @@ public void invalidPathHandler() throws IOException, ServletException, Execution AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("yoComet").pathInfo("/abcd").build(); try { - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); fail(); } catch (Exception ex) { assertEquals(ex.getClass(), AtmosphereMappingException.class); @@ -126,13 +126,13 @@ public void multipleWebSocketHandler() throws IOException, ServletException, Exe processor.registerWebSocketHandler("/b", new EchoHandler()); AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("a").pathInfo("/a").build(); - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); processor.invokeWebSocketProtocol(w, "a"); assertEquals(b.toString(), "a"); request = new AtmosphereRequest.Builder().destroyable(false).body("b").pathInfo("/b").build(); - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); processor.invokeWebSocketProtocol(w, "b"); // The WebSocketHandler is shared. @@ -155,14 +155,14 @@ public void onTextMessage(WebSocket webSocket, String data) throws IOException { }); AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("a").pathInfo("/a").build(); - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); processor.invokeWebSocketProtocol(w, "a"); assertEquals(b.toString(), "a"); ByteArrayOutputStream b2 = new ByteArrayOutputStream(); final WebSocket w2 = new ArrayBaseWebSocket(b2); request = new AtmosphereRequest.Builder().destroyable(false).body("b").pathInfo("/b").build(); - processor.open(w2, request); + processor.open(w2, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); processor.invokeWebSocketProtocol(w2, "b"); // The WebSocketHandler is shared. diff --git a/modules/cpr/src/test/java/org/atmosphere/cpr/WebSocketProcessorTest.java b/modules/cpr/src/test/java/org/atmosphere/cpr/WebSocketProcessorTest.java index 5c16b7ef246..12241d24ee5 100644 --- a/modules/cpr/src/test/java/org/atmosphere/cpr/WebSocketProcessorTest.java +++ b/modules/cpr/src/test/java/org/atmosphere/cpr/WebSocketProcessorTest.java @@ -107,7 +107,7 @@ public void destroy() { }); AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("yoComet").pathInfo("/a").build(); - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); processor.invokeWebSocketProtocol(w, "yoWebSocket"); BroadcasterFactory.getDefault().lookup("/*").broadcast("yoBroadcast").get(); @@ -146,7 +146,7 @@ public void destroy() { c.add(new Cookie("yo", "man")); AtmosphereRequest request = new AtmosphereRequest.Builder().cookies(c).pathInfo("/a").build(); - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); r.get().getBroadcaster().broadcast("yo").get(); assertNotNull(cValue.get()); @@ -186,7 +186,7 @@ public void destroy() { }); AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("yoComet").pathInfo("/a").build(); - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); processor.invokeWebSocketProtocol(w, "yoWebSocket"); processor.notifyListener(w, new WebSocketEventListener.WebSocketEvent("Disconnect", DISCONNECT, w)); @@ -224,7 +224,7 @@ public void destroy() { }); AtmosphereRequest request = new AtmosphereRequest.Builder().destroyable(false).body("yoComet").pathInfo("/a").build(); - processor.open(w, request); + processor.open(w, request, AtmosphereResponse.newInstance(framework.getAtmosphereConfig(), request, w)); processor.invokeWebSocketProtocol(w, "yoWebSocket"); processor.notifyListener(w, new WebSocketEventListener.WebSocketEvent("Close", WebSocketEventListener.WebSocketEvent.TYPE.CLOSE, w));