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

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


        assertThat(message, equalTo("x"));
    }

    @Test
    public void firefox602ConnectionHeader() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/echo").build();
        final EmbeddedChannel ch = webSocketChannel(config);
        final FullHttpRequest request = webSocketUpgradeRequest("/websocket", WebSocketVersion.V08);
        request.headers().set(CONNECTION, "keep-alive, Upgrade");
        ch.writeInbound(request);
        final HttpResponse response = decode(ch);
View Full Code Here


        verifyHeaders(WebSocketVersion.V08);
        verifyHeaders(WebSocketVersion.V13);
    }

    private static void verifyHeaders(final WebSocketVersion version) throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/echo").build();
        final EmbeddedChannel ch = webSocketChannel(config);
        final FullHttpRequest request = webSocketUpgradeRequest("/websocket", version);
        ch.writeInbound(request);
        final HttpResponse response = decode(ch);
        assertThat(response.getStatus(), is(HttpResponseStatus.SWITCHING_PROTOCOLS));
View Full Code Here

    }

    private static FullHttpResponse writeFrame(final Frame frame, final boolean withCallback) {
        final String queryUrl = withCallback ? "/jsonp?c=callback" : "/jsonp";
        final DefaultFullHttpRequest request = new DefaultFullHttpRequest(HTTP_1_1, GET, queryUrl);
        final SockJsConfig config = SockJsConfig.withPrefix(queryUrl).cookiesNeeded().build();
        final JsonpPollingTransport jsonpPollingOutbound = new JsonpPollingTransport(config, request);
        final EmbeddedChannel ch = new EmbeddedChannel(jsonpPollingOutbound);
        ch.writeInbound(request);
        ch.writeOutbound(frame);
        final FullHttpResponse response =  ch.readOutbound();
View Full Code Here

            final ModelNode operation,
            final ModelNode model,
            final ServiceVerificationHandler verificationHandler,
            final List<ServiceController<?>> newControllers) throws OperationFailedException {
        final Builder simplePushConfig = parseSimplePushOptions(context, model);
        final SockJsConfig sockJsConfig = parseSockJsOptions(context, model);
        final SimplePushService simplePushService = new SimplePushService(simplePushConfig, sockJsConfig);

        final String serverName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();
        final ServiceName serviceName = SimplePushService.createServiceName(serverName);
        final ServiceBuilder<SimplePushService> sb = context.getServiceTarget().addService(serviceName, simplePushService);
View Full Code Here

            final ModelNode operation,
            final ModelNode model,
            final ServiceVerificationHandler verificationHandler,
            final List<ServiceController<?>> newControllers) throws OperationFailedException {
        final Builder simplePushConfig = parseSimplePushOptions(context, model);
        final SockJsConfig sockJsConfig = parseSockJsOptions(context, model);
        final SimplePushService simplePushService = new SimplePushService(simplePushConfig, sockJsConfig);

        final String serverName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();
        final ServiceName serviceName = SimplePushService.createServiceName(serverName);
        final ServiceBuilder<SimplePushService> sb = context.getServiceTarget().addService(serviceName, simplePushService);
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

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

        response.release();
    }

    @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

    private static final EventLoopGroup workerGroup = new NioEventLoopGroup();
    private static final DefaultEventExecutorGroup eventExecutorGroup = new DefaultEventExecutorGroup(1);

    @BeforeClass
    public static void startSimplePushServer() throws Exception {
        final SockJsConfig sockJSConfig = SockJsConfig.withPrefix("/simplepush").cookiesNeeded().build();
        final DataStore datastore = new InMemoryDataStore();
        final ServerBootstrap sb = new ServerBootstrap();
        final SimplePushServerConfig simplePushConfig = DefaultSimplePushConfig.create()
                .userAgentReaperTimeout(2000L)
                .password("test")
View Full Code Here

        response.release();
    }

    @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

TOP

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

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.