Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Oct 18, 2012
1 parent 9d834f0 commit 994da4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
Expand All @@ -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.
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 994da4e

Please sign in to comment.