Package io.netty.handler.codec.http

Examples of io.netty.handler.codec.http.FullHttpResponse.release()


    @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();
    }

    @Test
    public void webSocketNotSupported() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
View Full Code Here


    @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();
    }

    @Test
    public void cookiesNeeded() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().cookiesNeeded().build();
View Full Code Here

    @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();
    }

    @Test
    public void cookiesNotNeeded() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
View Full Code Here

    @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();
    }

    @Test
    public void origins() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
View Full Code Here

    @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();
    }

    @Test
    public void entropy() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/simplepush").disableWebSocket().build();
View Full Code Here

    @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();
    }

    @Test
    public void contentTypeHeader() throws Exception {
        assertThat(headersFromInfo().get(HttpHeaders.Names.CONTENT_TYPE), equalTo("application/json; charset=UTF-8"));
View Full Code Here

    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;
    }

    private static JsonNode infoAsJson(final FullHttpResponse response) throws Exception {
        final ObjectMapper om = new ObjectMapper();
View Full Code Here

                ctx.pipeline().remove(this);
                return;
            }
            throw new IllegalStateException("WebSocketClientHandshaker should have been non finished yet");
        } finally {
            response.release();
        }
    }
}
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.