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

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsConfig.prefix()


     */
    @Test
    public void jsessionIdCookieTestBasic() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/cookie_needed_echo").cookiesNeeded().build();
        SockJsServiceFactory serviceFactory = echoService(config);
        final FullHttpResponse response = infoRequest(config.prefix(), serviceFactory);
        assertThat(response.getStatus(), is(HttpResponseStatus.OK));
        verifyNoSET_COOKIE(response);
        assertThat(infoAsJson(response).get("cookie_needed").asBoolean(), is(true));
    }

View Full Code Here


    }

    private static void verifyIframe(final String service, final String path) {
        final SockJsConfig config = SockJsConfig.withPrefix(service).cookiesNeeded().build();
        final EmbeddedChannel ch = channelForMockService(config);
        ch.writeInbound(httpRequest(config.prefix() + path));
        final FullHttpResponse response = ch.readOutbound();
        assertThat(response.getStatus().code(), is(HttpResponseStatus.OK.code()));
        assertThat(response.headers().get(CONTENT_TYPE), equalTo("text/html; charset=UTF-8"));
        assertThat(response.headers().get(CACHE_CONTROL), equalTo("max-age=31536000, public"));
        assertThat(response.headers().get(EXPIRES), is(notNullValue()));
View Full Code Here

public class IframeTest {

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

    }

    @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.NOT_FOUND.code()));
        response.release();
    }
View Full Code Here

    }

    @Test
    public void iframeHtmlUppercase() 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.NOT_FOUND.code()));
        response.release();
    }
View Full Code Here

    }

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

    }

    @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

    }

    @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

    }

    @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

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.