Polish DefaultHandshakeHandler
After this change the DefaultHandshakeHandler delegates to a server-specific RequestUpgradeStrategy to update the HTTP response for the handshake request and to begin the WebSocket interaction. The DefaultHandshakeHandler however still retains the initial validation of the WebSocket handshake including negotation of origin, sub-protocol, etc. This allows sub-classes to override various aspects of the negotiation independant of the WebSocket engine.
This commit is contained in:
@@ -215,6 +215,17 @@ public class AbstractSockJsSessionTests extends BaseAbstractSockJsSessionTests<T
|
||||
assertClosed();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tryCloseWithWebSocketHandlerExceptions() throws Exception {
|
||||
|
||||
this.session.delegateConnectionEstablished();
|
||||
this.session.setActive(true);
|
||||
this.session.tryCloseWithSockJsTransportError(new Exception(), CloseStatus.BAD_DATA);
|
||||
|
||||
assertEquals(CloseStatus.BAD_DATA, this.session.getCloseStatus());
|
||||
assertClosed();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void writeFrame() throws Exception {
|
||||
this.session.writeFrame(SockJsFrame.openFrame());
|
||||
|
||||
Reference in New Issue
Block a user