Package org.springframework.web.socket.sockjs.frame

Examples of org.springframework.web.socket.sockjs.frame.SockJsFrameFormat


    this.servletRequest.setQueryString("c=callback");
    this.servletRequest.addParameter("c", "callback");

    SockJsFrame frame = SockJsFrame.openFrame();

    SockJsFrameFormat format = new XhrPollingTransportHandler().getFrameFormat(this.request);
    String formatted = format.format(frame);
    assertEquals(frame.getContent() + "\n", formatted);

    format = new XhrStreamingTransportHandler().getFrameFormat(this.request);
    formatted = format.format(frame);
    assertEquals(frame.getContent() + "\n", formatted);

    format = new HtmlFileTransportHandler().getFrameFormat(this.request);
    formatted = format.format(frame);
    assertEquals("<script>\np(\"" + frame.getContent() + "\");\n</script>\r\n", formatted);

    format = new EventSourceTransportHandler().getFrameFormat(this.request);
    formatted = format.format(frame);
    assertEquals("data: " + frame.getContent() + "\r\n\r\n", formatted);

    format = new JsonpPollingTransportHandler().getFrameFormat(this.request);
    formatted = format.format(frame);
    assertEquals("callback(\"" + frame.getContent() + "\");\r\n", formatted);
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.sockjs.frame.SockJsFrameFormat

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.