Package org.cometd.client

Examples of org.cometd.client.BayeuxClient.waitFor()


        clientOptions.put("ws.maxMessageSize", maxMessageSize);
        ClientTransport webSocketTransport = newWebSocketTransport(clientOptions);
        BayeuxClient client = new BayeuxClient(cometdURL, webSocketTransport);

        client.handshake();
        Assert.assertTrue(client.waitFor(5000, BayeuxClient.State.CONNECTED));

        ClientSessionChannel channel = client.getChannel("/test");
        final CountDownLatch latch = new CountDownLatch(1);
        channel.subscribe(new ClientSessionChannel.MessageListener()
        {
View Full Code Here


        new SetiService(seti2);

        BayeuxClient client1 = startClient(oort1, null);
        Assert.assertTrue(client1.waitFor(5000, BayeuxClient.State.CONNECTED));
        BayeuxClient client2 = startClient(oort2, null);
        Assert.assertTrue(client2.waitFor(5000, BayeuxClient.State.CONNECTED));

        CountDownLatch presenceAddedLatch = new CountDownLatch(4);
        seti1.addPresenceListener(new UserPresentListener(presenceAddedLatch));
        seti2.addPresenceListener(new UserPresentListener(presenceAddedLatch));
View Full Code Here

        new SetiService(seti1);
        new SetiService(seti2);

        BayeuxClient client1 = startClient(oort1, null);
        Assert.assertTrue(client1.waitFor(5000, BayeuxClient.State.CONNECTED));

        CountDownLatch presenceAddedLatch = new CountDownLatch(2);
        seti1.addPresenceListener(new UserPresentListener(presenceAddedLatch));
        seti2.addPresenceListener(new UserPresentListener(presenceAddedLatch));
View Full Code Here

        }
        prepareAndStart(initParams);

        BayeuxClient client = newBayeuxClient();
        client.handshake();
        Assert.assertTrue(client.waitFor(5000, BayeuxClient.State.CONNECTED));
        Thread.sleep(1000);

        client.disconnect();

        switch (wsTransportType)
View Full Code Here

            stopOort(oort1);
            stopServer(server1);

            // Disconnect user and login it to node2
            client1.disconnect();
            Assert.assertTrue(client1.waitFor(5000, BayeuxClient.State.DISCONNECTED));
            client1 = startClient(oort2, null);
            final CountDownLatch loginLatch2 = new CountDownLatch(1);
            loginChannel1 = client1.getChannel("/service/login");
            loginChannel1.publish(login1, new ClientSessionChannel.MessageListener()
            {
View Full Code Here

            stopOort(oort2);
            stopServer(server2);

            // Disconnect user and login it to node1
            client1.disconnect();
            Assert.assertTrue(client1.waitFor(5000, BayeuxClient.State.DISCONNECTED));
            client1 = startClient(oort1, null);
            final CountDownLatch loginLatch3 = new CountDownLatch(1);
            loginChannel1 = client1.getChannel("/service/login");
            loginChannel1.publish(login1, new ClientSessionChannel.MessageListener()
            {
View Full Code Here

        }
        prepareAndStart(initParams);

        BayeuxClient client = newBayeuxClient();
        client.handshake();
        Assert.assertTrue(client.waitFor(5000, BayeuxClient.State.CONNECTED));
        Thread.sleep(1000);

        client.disconnect(1000);

        switch (wsTransportType)
View Full Code Here

        new SetiService(seti1);
        new SetiService(seti2);

        BayeuxClient client1 = startClient(oort1, null);
        Assert.assertTrue(client1.waitFor(5000, BayeuxClient.State.CONNECTED));
        BayeuxClient client2 = startClient(oort2, null);
        Assert.assertTrue(client2.waitFor(5000, BayeuxClient.State.CONNECTED));

        CountDownLatch presenceAddedLatch = new CountDownLatch(4);
        seti1.addPresenceListener(new UserPresentListener(presenceAddedLatch));
View Full Code Here

        new SetiService(seti2);

        BayeuxClient client1 = startClient(oort1, null);
        Assert.assertTrue(client1.waitFor(5000, BayeuxClient.State.CONNECTED));
        BayeuxClient client2 = startClient(oort2, null);
        Assert.assertTrue(client2.waitFor(5000, BayeuxClient.State.CONNECTED));

        CountDownLatch presenceAddedLatch = new CountDownLatch(4);
        seti1.addPresenceListener(new UserPresentListener(presenceAddedLatch));
        seti2.addPresenceListener(new UserPresentListener(presenceAddedLatch));
View Full Code Here

        options.put(AbstractServerTransport.MAX_INTERVAL_OPTION, String.valueOf(maxInterval));
        prepareAndStart(options);

        BayeuxClient client = newBayeuxClient();
        client.handshake();
        Assert.assertTrue(client.waitFor(5000, BayeuxClient.State.CONNECTED));

        // Allow long poll to establish
        Thread.sleep(1000);

        final CountDownLatch latch = new CountDownLatch(1);
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.