Examples of connectToServer()


Examples of javax.websocket.WebSocketContainer.connectToServer()

        WebSocketContainer wsContainer =
                ContainerProvider.getWebSocketContainer();
        ClientEndpointConfig clientEndpointConfig =
                ClientEndpointConfig.Builder.create().build();
        Session wsSession = wsContainer.connectToServer(
                TesterProgrammaticEndpoint.class,
                clientEndpointConfig,
                new URI("ws://localhost:" + getPort() +
                        TesterFirehoseServer.Config.PATH));
        CountDownLatch latch =
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

                "org/apache/tomcat/util/net/ca.jks");
        File truststoreFile = new File(truststoreUrl.toURI());
        clientEndpointConfig.getUserProperties().put(
                WsWebSocketContainer.SSL_TRUSTSTORE_PROPERTY,
                truststoreFile.getAbsolutePath());
        Session wsSession = wsContainer.connectToServer(
                TesterProgrammaticEndpoint.class,
                clientEndpointConfig,
                new URI("wss://localhost:" + getPort() +
                        TesterFirehoseServer.Config.PATH));
        CountDownLatch latch =
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

        ClientEndpointConfig clientEndpointConfig =
                ClientEndpointConfig.Builder.create().build();
        clientEndpointConfig.getUserProperties().put(
                WsWebSocketContainer.SSL_TRUSTSTORE_PROPERTY,
                "test/org/apache/tomcat/util/net/ca.jks");
        Session wsSession = wsContainer.connectToServer(
                TesterProgrammaticEndpoint.class,
                clientEndpointConfig,
                new URI("wss://localhost:" + getPort() +
                        TesterFirehoseServer.Config.PATH));
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

        WebSocketContainer wsContainer = ContainerProvider
                .getWebSocketContainer();

        tomcat.start();

        Session wsSession = wsContainer.connectToServer(
                TesterProgrammaticEndpoint.class, ClientEndpointConfig.Builder
                        .create().build(), new URI("ws://localhost:"
                        + getPort() + TesterEchoServer.Config.PATH_ASYNC));

        CountDownLatch latch = new CountDownLatch(1);
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

        tomcat.start();

        Client client = new Client();
        URI uri = new URI("ws://localhost:" + getPort() + "/");

        wsContainer.connectToServer(client, uri);

        // Server should close the connection after the exception on open.
        boolean closed = client.waitForClose(5);
        Assert.assertTrue("Server failed to close connection", closed);
    }
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

        tomcat.start();

        Client client = new Client();
        URI uri = new URI("ws://localhost:" + getPort() + "/");

        Session session = wsContainer.connectToServer(client, uri);

        client.waitForClose(5);
        Assert.assertTrue(session.isOpen());
    }
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

        tomcat.start();

        Client client = new Client();
        URI uri = new URI("ws://localhost:" + getPort() + PATH_PROGRAMMATIC_EP);
        Session session = wsContainer.connectToServer(client, uri);

        MsgString msg1 = new MsgString();
        msg1.setData(MESSAGE_ONE);
        session.getBasicRemote().sendObject(msg1);
        // Should not take very long
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

        tomcat.start();

        Client client = new Client();
        URI uri = new URI("ws://localhost:" + getPort() + PATH_ANNOTATED_EP);
        Session session = wsContainer.connectToServer(client, uri);

        MsgString msg1 = new MsgString();
        msg1.setData(MESSAGE_ONE);
        session.getBasicRemote().sendObject(msg1);
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

        tomcat.start();

        GenericsClient client = new GenericsClient();
        URI uri = new URI("ws://localhost:" + getPort() + PATH_GENERICS_EP);
        Session session = wsContainer.connectToServer(client, uri);

        ArrayList<String> list = new ArrayList<String>(2);
        list.add("str1");
        list.add("str2");
        session.getBasicRemote().sendObject(list);
View Full Code Here

Examples of javax.websocket.WebSocketContainer.connectToServer()

        this.endpoint = new MessageEndpoint(this.latch);
        WebSocketContainer container = ContainerProvider.getWebSocketContainer();
        ClientEndpointConfig config = ClientEndpointConfig.Builder.create().build();
        String uri = "ws://localhost:8080/lightfish/snapshots/";
        System.out.println("Connecting to " + uri);
        this.session = container.connectToServer(this.endpoint, config, URI.create(uri));
    }

    /**
     * Setup updates to 2 seconds before performing this test
     */
 
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.