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

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


public class WebSocketSslServerSslContextTest {

    @Test
    public void createSSLEngine() {
        final SockJsConfig sockJsConfig = SockJsConfig.withPrefix("/echo")
                .tls(true)
                .keyStore("/simplepush-sample.keystore")
                .keyStorePassword("simplepush")
                .build();
        final SSLEngine engine = new WebSocketSslServerSslContext(sockJsConfig).sslContext().createSSLEngine();
View Full Code Here


        assertThat(engine, is(notNullValue()));
    }

    @Test (expected = RuntimeException.class)
    public void createSSLContextKeyStoreNotFound() {
        final SockJsConfig sockJsConfig = SockJsConfig.withPrefix("/echo")
                .tls(true)
                .keyStore("/missing.keystore")
                .keyStorePassword("simplepush")
                .build();
        new WebSocketSslServerSslContext(sockJsConfig).sslContext();
View Full Code Here

    }

    @Test
    public void rawWebSocketUpgradeRequest() throws Exception {
        final SimplePushServerConfig simplePushConfig = DefaultSimplePushConfig.create().password("test").build();
        final SockJsConfig sockjsConf = SockJsConfig.withPrefix("/simplepush").webSocketProtocols("push-notification").build();
        final byte[] privateKey = CryptoUtil.secretKey(simplePushConfig.password(), "someSaltForTesting".getBytes());
        final SimplePushServer pushServer = new DefaultSimplePushServer(new InMemoryDataStore(), simplePushConfig, privateKey);
        final SimplePushServiceFactory factory = new SimplePushServiceFactory(sockjsConf, pushServer);
        final EmbeddedChannel channel = createChannel(factory);
        final FullHttpRequest request = websocketUpgradeRequest(factory.config().prefix() + Transports.Type.WEBSOCKET.path());
View Full Code Here

        return new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, path);
    }

    private SockJsServiceFactory defaultFactory() {
        final SimplePushServerConfig simplePushConfig = DefaultSimplePushConfig.create().password("test").build();
        final SockJsConfig sockjsConf = SockJsConfig.withPrefix("/simplepush").build();
        final byte[] privateKey = CryptoUtil.secretKey(simplePushConfig.password(), "someSaltForTesting".getBytes());
        final SimplePushServer pushServer = new DefaultSimplePushServer(new InMemoryDataStore(), simplePushConfig, privateKey);
        return new SimplePushServiceFactory(sockjsConf, pushServer);
    }
View Full Code Here

        final SimplePushServer pushServer = new DefaultSimplePushServer(new InMemoryDataStore(), simplePushConfig, privateKey);
        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.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.