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

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


    /*
     * Equivalent to Http11.test_streaming in sockjs-protocol-0.3.3.py.
     */
    @Test
    public void http11TestStreaming() throws Exception {
        final SockJsServiceFactory closeFactory = closeService();
        final String sessionUrl = closeFactory.config().prefix() + "/222/" + UUID.randomUUID().toString();
        final EmbeddedChannel ch = channelForService(closeFactory);
        removeLastInboundMessageHandlers(ch);
        final FullHttpRequest request = httpPostRequest(sessionUrl + Transports.Type.XHR_STREAMING.path(), HTTP_1_1);
        request.headers().set(CONNECTION, KEEP_ALIVE);
        ch.writeInbound(request);
View Full Code Here


    private static void webSocketTestTransport(final WebSocketVersion version) {
        final String serviceName = "/echo";
        final String sessionUrl = serviceName + "/222/" + UUID.randomUUID().toString();
        final SockJsConfig config = SockJsConfig.withPrefix(serviceName).build();
        final SockJsServiceFactory service = echoService(config);
        final EmbeddedChannel ch = wsChannelForService(service);

        final FullHttpRequest request = webSocketUpgradeRequest(sessionUrl + "/websocket", version);
        ch.writeInbound(request);
        // Discard the HTTP Response (this will be a ByteBuf and not an object
View Full Code Here

    private static void webSocketTestClose(final WebSocketVersion version) {
        final String serviceName = "/close";
        final String sessionUrl = serviceName + "/222/" + UUID.randomUUID().toString();
        final SockJsConfig config = SockJsConfig.withPrefix(serviceName).build();
        final SockJsServiceFactory service = closeService(config);
        final EmbeddedChannel ch = wsChannelForService(service);

        final FullHttpRequest request = webSocketUpgradeRequest(sessionUrl + "/websocket", version.toHttpHeaderValue());
        ch.writeInbound(request);
View Full Code Here

        final SockJsService service = mock(SockJsService.class);
        return channelForService(factoryFor(service, config));
    }

    private static SockJsServiceFactory factoryFor(final SockJsService service, final SockJsConfig config) {
        final SockJsServiceFactory factory = mock(SockJsServiceFactory.class);
        when(service.config()).thenReturn(config);
        when(factory.config()).thenReturn(config);
        when(factory.create()).thenReturn(service);
        return factory;
    }
View Full Code Here

    }

    @Test
    public void websocketHandleAcknowledgement() throws Exception {
        final SimplePushServer simplePushServer = defaultPushServer();
        final SockJsServiceFactory serviceFactory = defaultFactory(simplePushServer);
        final EmbeddedChannel channel = createWebSocketChannel(serviceFactory);
        final String uaid = UUIDUtil.newUAID();
        final String channelId = UUID.randomUUID().toString();
        sendWebSocketHttpUpgradeRequest(sessionUrl, channel);
        sendWebSocketHelloFrame(uaid, channel);
View Full Code Here

    }

    @Test
    public void websocketHandleAcknowledgements() throws Exception {
        final SimplePushServer simplePushServer = defaultPushServer();
        final SockJsServiceFactory serviceFactory = defaultFactory(simplePushServer);
        final EmbeddedChannel channel = createWebSocketChannel(serviceFactory);
        final String uaid = UUIDUtil.newUAID();
        final String channelId1 = UUID.randomUUID().toString();
        final String channelId2 = UUID.randomUUID().toString();
        sendWebSocketHttpUpgradeRequest(sessionUrl, channel);
View Full Code Here

    @Test
    @Ignore("Need to figure out how to run a schedules job with the new EmbeddedChannel")
    // https://groups.google.com/forum/#!topic/netty/Q-_wat_9Odo
    public void websocketHandleOneUnacknowledgement() throws Exception {
        final SimplePushServer simplePushServer = defaultPushServer();
        final SockJsServiceFactory serviceFactory = defaultFactory(simplePushServer);
        final EmbeddedChannel channel = createWebSocketChannel(serviceFactory);
        final String uaid = UUIDUtil.newUAID();
        final String channelId1 = UUID.randomUUID().toString();
        final String channelId2 = UUID.randomUUID().toString();
        sendWebSocketHttpUpgradeRequest(sessionUrl, channel);
View Full Code Here

    @Test
    @Ignore("Need to figure out how to run a schedules job with the new EmbeddedChannel")
    // https://groups.google.com/forum/#!topic/netty/Q-_wat_9Odo
    public void websocketHandleUnacknowledgement() throws Exception {
        final SimplePushServer simplePushServer = defaultPushServer();
        final SockJsServiceFactory serviceFactory = defaultFactory(simplePushServer);
        final EmbeddedChannel channel = createWebSocketChannel(serviceFactory);
        final String uaid = UUIDUtil.newUAID();
        final String channelId1 = UUID.randomUUID().toString();
        final String channelId2 = UUID.randomUUID().toString();
        sendWebSocketHttpUpgradeRequest(sessionUrl, channel);
View Full Code Here

        return new SimplePushServiceFactory(sockjsConf, pushServer);
    }

    private SockJsServiceFactory defaultFactory(final SimplePushServer simplePushServer) {
        final SockJsConfig sockJSConfig = SockJsConfig.withPrefix("/simplepush").build();
        return new SockJsServiceFactory() {
            @Override
            public SockJsService create() {
                return new SimplePushSockJSService(config(), simplePushServer);
            }
View Full Code Here

TOP

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

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.