Polish WebSocketSession

Update methods available on WebSocketSession interface.
Introduce DelegatingWebSocketSession interface.
This commit is contained in:
Rossen Stoyanchev
2013-08-09 09:38:13 -04:00
parent 14ac023e01
commit 01feae0ad5
36 changed files with 735 additions and 590 deletions

View File

@@ -91,7 +91,18 @@ public class SubProtocolWebSocketHandlerTests {
}
@Test
public void noSubProtocol() throws Exception {
public void nullSubProtocol() throws Exception {
this.webSocketHandler.setDefaultProtocolHandler(defaultHandler);
this.webSocketHandler.afterConnectionEstablished(session);
verify(this.defaultHandler).afterSessionStarted(session, this.channel);
verify(this.stompHandler, times(0)).afterSessionStarted(session, this.channel);
verify(this.mqttHandler, times(0)).afterSessionStarted(session, this.channel);
}
@Test
public void emptySubProtocol() throws Exception {
this.session.setAcceptedProtocol("");
this.webSocketHandler.setDefaultProtocolHandler(defaultHandler);
this.webSocketHandler.afterConnectionEstablished(session);