Example usage for org.springframework.web.socket.sockjs.client AbstractXhrTransport setXhrStreamingDisabled

List of usage examples for org.springframework.web.socket.sockjs.client AbstractXhrTransport setXhrStreamingDisabled

Introduction

In this page you can find the example usage for org.springframework.web.socket.sockjs.client AbstractXhrTransport setXhrStreamingDisabled.

Prototype

public void setXhrStreamingDisabled(boolean disabled) 

Source Link

Document

An XhrTransport can support both the "xhr_streaming" and "xhr" SockJS server transports.

Usage

From source file:org.springframework.web.socket.sockjs.client.AbstractSockJsIntegrationTests.java

@Test
public void echoXhr() throws Exception {
    AbstractXhrTransport xhrTransport = createXhrTransport();
    xhrTransport.setXhrStreamingDisabled(true);
    testEcho(100, xhrTransport, null);/*from   w ww .ja  va2  s. c om*/
}

From source file:org.springframework.web.socket.sockjs.client.AbstractSockJsIntegrationTests.java

@Test
public void echoXhrWithHeaders() throws Exception {
    AbstractXhrTransport xhrTransport = createXhrTransport();
    xhrTransport.setXhrStreamingDisabled(true);

    WebSocketHttpHeaders headers = new WebSocketHttpHeaders();
    headers.add("auth", "123");
    testEcho(10, xhrTransport, headers);

    for (Map.Entry<String, HttpHeaders> entry : this.testFilter.requests.entrySet()) {
        HttpHeaders httpHeaders = entry.getValue();
        assertEquals("No auth header for: " + entry.getKey(), "123", httpHeaders.getFirst("auth"));
    }//from   w  ww  .j a v a2 s . c  om
}

From source file:org.springframework.web.socket.sockjs.client.AbstractSockJsIntegrationTests.java

@Test
public void receiveOneMessageXhr() throws Exception {
    AbstractXhrTransport xhrTransport = createXhrTransport();
    xhrTransport.setXhrStreamingDisabled(true);
    testReceiveOneMessage(xhrTransport, null);
}