Package org.springframework.web.socket.sockjs.transport.session

Examples of org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession



  private void handleRequest(AbstractHttpReceivingTransportHandler transportHandler) throws Exception {

    WebSocketHandler wsHandler = mock(WebSocketHandler.class);
    AbstractSockJsSession session = new TestHttpSockJsSession("1", new StubSockJsServiceConfig(), wsHandler, null);

    transportHandler.initialize(new StubSockJsServiceConfig());
    transportHandler.handleRequest(this.request, this.response, wsHandler, session);

    assertEquals("text/plain;charset=UTF-8", this.response.getHeaders().getContentType().toString());
View Full Code Here


  private void handleRequestAndExpectFailure() throws Exception {

    resetResponse();

    WebSocketHandler wsHandler = mock(WebSocketHandler.class);
    AbstractSockJsSession session = new TestHttpSockJsSession("1", new StubSockJsServiceConfig(), wsHandler, null);

    new XhrReceivingTransportHandler().handleRequest(this.request, this.response, wsHandler, session);

    assertEquals(500, this.servletResponse.getStatus());
    verifyNoMoreInteractions(wsHandler);
View Full Code Here

  public void handleRequestXhr() throws Exception {

    XhrPollingTransportHandler transportHandler = new XhrPollingTransportHandler();
    transportHandler.initialize(this.sockJsConfig);

    AbstractSockJsSession session = transportHandler.createSession("1", this.webSocketHandler, null);
    transportHandler.handleRequest(this.request, this.response, this.webSocketHandler, session);

    assertEquals("application/javascript;charset=UTF-8", this.response.getHeaders().getContentType().toString());
    assertEquals("o\n", this.servletResponse.getContentAsString());
    assertFalse("Polling request should complete after open frame", this.servletRequest.isAsyncStarted());
View Full Code Here

  @Test
  public void handleRequestXhrStreaming() throws Exception {

    XhrStreamingTransportHandler transportHandler = new XhrStreamingTransportHandler();
    transportHandler.initialize(this.sockJsConfig);
    AbstractSockJsSession session = transportHandler.createSession("1", this.webSocketHandler, null);

    transportHandler.handleRequest(this.request, this.response, this.webSocketHandler, session);

    assertEquals("application/javascript;charset=UTF-8", this.response.getHeaders().getContentType().toString());
    assertTrue("Streaming request not started", this.servletRequest.isAsyncStarted());
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.