Package org.jboss.aerogear.io.netty.handler.codec.sockjs

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsConfig$Builder


        response.release();
    }

    @Test
    public void iframeUppercase() throws Exception {
        final SockJsConfig config = config();
        final String path = config.prefix() + "/IFRAME";
        final FullHttpResponse response = Iframe.response(config, createHttpRequest(path));
        assertThat(response.getStatus().code(), is(HttpResponseStatus.NOT_FOUND.code()));
        response.release();
    }
View Full Code Here


        response.release();
    }

    @Test
    public void ifNoneMatchHeader() throws Exception {
        final SockJsConfig config = config();
        final String path = config.prefix() + "/iframe.html";
        final HttpRequest httpRequest = createHttpRequest(path);
        httpRequest.headers().set(HttpHeaders.Names.IF_NONE_MATCH, "*");
        final FullHttpResponse response = Iframe.response(config, httpRequest);
        assertThat(response.headers().get(HttpHeaders.Names.SET_COOKIE), equalTo("JSESSIONID=dummy; path=/"));
        assertThat(response.getStatus().code(), is(HttpResponseStatus.NOT_MODIFIED.code()));
View Full Code Here

        response.release();
    }

    @Test
    public void iframeHtml() throws Exception {
        final SockJsConfig config = config();
        final String path = config.prefix() + "/iframe.html";
        final FullHttpResponse response = Iframe.response(config, createHttpRequest(path));
        assertThat(response.getStatus().code(), is(HttpResponseStatus.OK.code()));
        assertThat(response.headers().get(HttpHeaders.Names.CONTENT_TYPE), equalTo("text/html; charset=UTF-8"));
        assertThat(response.headers().get(HttpHeaders.Names.CACHE_CONTROL), equalTo("max-age=31536000, public"));
        assertThat(response.headers().get(HttpHeaders.Names.EXPIRES), is(notNullValue()));
View Full Code Here

public class InfoTest {

    @Test
    public void webSocketSupported() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").build();
        final FullHttpResponse response = Info.response(config, createHttpRequest("/simplepush"));
        assertThat(infoAsJson(response).get("websocket").asBoolean(), is(true));
        response.release();
    }
View Full Code Here

        response.release();
    }

    @Test
    public void webSocketNotSupported() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
        final FullHttpResponse response = Info.response(config, createHttpRequest("/simplepush"));
        assertThat(infoAsJson(response).get("websocket").asBoolean(), is(false));
        response.release();
    }
View Full Code Here

        response.release();
    }

    @Test
    public void cookiesNeeded() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().cookiesNeeded().build();
        final FullHttpResponse response = Info.response(config, createHttpRequest("/simplepush"));
        assertThat(infoAsJson(response).get("cookie_needed").asBoolean(), is(true));
        response.release();
    }
View Full Code Here

        response.release();
    }

    @Test
    public void cookiesNotNeeded() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
        final FullHttpResponse response = Info.response(config, createHttpRequest("/simplepush"));
        assertThat(infoAsJson(response).get("cookie_needed").asBoolean(), is(false));
        response.release();
    }
View Full Code Here

        response.release();
    }

    @Test
    public void origins() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
        final FullHttpResponse response = Info.response(config, createHttpRequest("/simplepush"));
        assertThat(infoAsJson(response).get("origins").get(0).asText(), is("*:*"));
        response.release();
    }
View Full Code Here

        response.release();
    }

    @Test
    public void entropy() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
        final FullHttpResponse response = Info.response(config, createHttpRequest("/simplepush"));
        assertThat(infoAsJson(response).get("entropy").asLong(), is(notNullValue()));
        response.release();
    }
View Full Code Here

        assertThat(cacheControl.contains("must-revalidate"), is(true));
        assertThat(cacheControl.contains("max-age"), is(true));
    }

    private static HttpHeaders headersFromInfo() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
        final FullHttpResponse response = Info.response(config, createHttpRequest("/simplepush"));
        final HttpHeaders headers = response.headers();
        response.release();
        return headers;
    }
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsConfig$Builder

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.