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

Examples of org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsService.handleRequest()


  @Test
   public void handleTransportRequestJsonp() throws Exception {
    TransportHandlingSockJsService jsonpService = new TransportHandlingSockJsService(this.taskScheduler, this.jsonpHandler, this.jsonpSendHandler);
    String sockJsPath = sessionUrlPrefix+ "jsonp";
    setRequest("GET", sockJsPrefix + sockJsPath);
    jsonpService.handleRequest(this.request, this.response, sockJsPath, this.wsHandler);
    assertNotEquals(404, this.servletResponse.getStatus());

    resetRequestAndResponse();
    jsonpService.setAllowedOrigins(Arrays.asList("http://mydomain1.com"));
    setRequest("GET", sockJsPrefix + sockJsPath);
View Full Code Here


    assertNotEquals(404, this.servletResponse.getStatus());

    resetRequestAndResponse();
    jsonpService.setAllowedOrigins(Arrays.asList("http://mydomain1.com"));
    setRequest("GET", sockJsPrefix + sockJsPath);
    jsonpService.handleRequest(this.request, this.response, sockJsPath, this.wsHandler);
    assertEquals(404, this.servletResponse.getStatus());

    resetRequestAndResponse();
    jsonpService.setAllowedOrigins(null);
    setRequest("GET", sockJsPrefix + sockJsPath);
View Full Code Here

    assertEquals(404, this.servletResponse.getStatus());

    resetRequestAndResponse();
    jsonpService.setAllowedOrigins(null);
    setRequest("GET", sockJsPrefix + sockJsPath);
    jsonpService.handleRequest(this.request, this.response, sockJsPath, this.wsHandler);
    assertEquals(404, this.servletResponse.getStatus());
  }

  @Test
  public void handleTransportRequestWebsocket() throws Exception {
View Full Code Here

  @Test
  public void handleTransportRequestWebsocket() throws Exception {
    TransportHandlingSockJsService wsService = new TransportHandlingSockJsService(this.taskScheduler, this.wsTransportHandler);
    String sockJsPath = "/websocket";
    setRequest("GET", sockJsPrefix + sockJsPath);
    wsService.handleRequest(this.request, this.response, sockJsPath, this.wsHandler);
    assertNotEquals(403, this.servletResponse.getStatus());

    resetRequestAndResponse();
    OriginHandshakeInterceptor interceptor = new OriginHandshakeInterceptor();
    interceptor.setAllowedOrigins(Arrays.asList("http://mydomain1.com"));
View Full Code Here

    OriginHandshakeInterceptor interceptor = new OriginHandshakeInterceptor();
    interceptor.setAllowedOrigins(Arrays.asList("http://mydomain1.com"));
    wsService.setHandshakeInterceptors(Arrays.asList(interceptor));
    setRequest("GET", sockJsPrefix + sockJsPath);
    setOrigin("http://mydomain1.com");
    wsService.handleRequest(this.request, this.response, sockJsPath, this.wsHandler);
    assertNotEquals(403, this.servletResponse.getStatus());

    resetRequestAndResponse();
    setRequest("GET", sockJsPrefix + sockJsPath);
    setOrigin("http://mydomain2.com");
View Full Code Here

    assertNotEquals(403, this.servletResponse.getStatus());

    resetRequestAndResponse();
    setRequest("GET", sockJsPrefix + sockJsPath);
    setOrigin("http://mydomain2.com");
    wsService.handleRequest(this.request, this.response, sockJsPath, this.wsHandler);
    assertEquals(403, this.servletResponse.getStatus());
  }


  interface SessionCreatingTransportHandler extends TransportHandler, SockJsSessionFactory {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.