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

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


  public void setup() {
    super.setUp();
    MockitoAnnotations.initMocks(this);

    Map<String, Object> attributes = Collections.emptyMap();
    this.session = new TestSockJsSession(sessionId, new StubSockJsServiceConfig(), this.wsHandler, attributes);

    given(this.xhrHandler.getTransportType()).willReturn(TransportType.XHR);
    given(this.xhrHandler.createSession(sessionId, this.wsHandler, attributes)).willReturn(this.session);
    given(this.xhrSendHandler.getTransportType()).willReturn(TransportType.XHR_SEND);
    given(this.jsonpHandler.getTransportType()).willReturn(TransportType.JSONP);
View Full Code Here


  }

  @Test
  public void delegateMessageException() throws Exception {

    StubSockJsServiceConfig sockJsConfig = new StubSockJsServiceConfig();

    this.servletRequest.setContent("[\"x\"]".getBytes("UTF-8"));

    WebSocketHandler wsHandler = mock(WebSocketHandler.class);
    TestHttpSockJsSession session = new TestHttpSockJsSession("1", sockJsConfig, wsHandler, null);
View Full Code Here


  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());
    verify(wsHandler).handleMessage(session, new TextMessage("x"));
  }
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

    super.setUp();

    this.webSocketHandler = mock(WebSocketHandler.class);
    this.taskScheduler = mock(TaskScheduler.class);

    this.sockJsConfig = new StubSockJsServiceConfig();
    this.sockJsConfig.setTaskScheduler(this.taskScheduler);

    setRequest("POST", "/");
  }
View Full Code Here

TOP

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

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.