Package org.cometd.bayeux.client

Examples of org.cometd.bayeux.client.ClientSessionChannel.publish()


        Assert.assertFalse(messageLatch.get().await(1, TimeUnit.SECONDS));

        // Tell the server to resubscribe the session
        Map<String, Object> resubscribe = new HashMap<>();
        resubscribe.put(actionField, subscribeAction);
        systemChannel.publish(resubscribe);
        Assert.assertTrue(resubscribeLatch.await(5, TimeUnit.SECONDS));

        // Publish, must receive it
        messageLatch.set(new CountDownLatch(1));
        testChannel.publish(new HashMap<String, Object>());
View Full Code Here


            }
        });
        Assert.assertTrue(subscribeLatch.await(5, TimeUnit.SECONDS));

        // Publish, must receive it
        testChannel.publish(new HashMap<String, Object>());
        Assert.assertTrue(messageLatch.get().await(5, TimeUnit.SECONDS));

        // Tell the server to unsubscribe the session
        Assert.assertTrue(bayeux.getChannel(testChannelName).unsubscribe(bayeux.getSession(client.getId())));
View Full Code Here

        // Tell the server to unsubscribe the session
        Assert.assertTrue(bayeux.getChannel(testChannelName).unsubscribe(bayeux.getSession(client.getId())));

        // Publish, must receive it (service channels are always invoked)
        messageLatch.set(new CountDownLatch(1));
        testChannel.publish(new HashMap<String, Object>());
        Assert.assertTrue(messageLatch.get().await(5, TimeUnit.SECONDS));

        // Tell the server to resubscribe the session
        Assert.assertTrue(bayeux.getChannel(testChannelName).subscribe(bayeux.getSession(client.getId())));
View Full Code Here

        // Tell the server to resubscribe the session
        Assert.assertTrue(bayeux.getChannel(testChannelName).subscribe(bayeux.getSession(client.getId())));

        // Publish, must receive it
        messageLatch.set(new CountDownLatch(1));
        testChannel.publish(new HashMap<String, Object>());
        Assert.assertTrue(messageLatch.get().await(5, TimeUnit.SECONDS));

        disconnectBayeuxClient(client);
    }
View Full Code Here

            public void onMessage(ClientSessionChannel channel, Message message)
            {
                messageLatch.get().countDown();
            }
        });
        testChannel.publish(new HashMap<String, Object>());
        client.endBatch();
        Assert.assertTrue(messageLatch.get().await(5, TimeUnit.SECONDS));

        // Tell the server to unsubscribe the session
        Map<String, Object> unsubscribe = new HashMap<>();
View Full Code Here

        // Tell the server to unsubscribe the session
        Map<String, Object> unsubscribe = new HashMap<>();
        unsubscribe.put(actionField, unsubscribeAction);
        ClientSessionChannel systemChannel = client.getChannel(systemChannelName);
        systemChannel.publish(unsubscribe);
        Assert.assertTrue(unsubscribeLatch.await(5, TimeUnit.SECONDS));

        // Publish, must not receive it
        messageLatch.set(new CountDownLatch(1));
        testChannel.publish(new HashMap<String, Object>());
View Full Code Here

                assertTrue(message.isSuccessful());
                assertEquals(calleeData, message.getData());
                latch.countDown();
            }
        });
        channel.publish(callerData);

        assertTrue(latch.await(5, TimeUnit.SECONDS));
    }

    @Service
View Full Code Here

                    return;
                assertEquals(parameter, message.getData());
                latch.countDown();
            }
        });
        channel.publish(new HashMap());

        assertTrue(latch.await(5, TimeUnit.SECONDS));
    }

    @Service
View Full Code Here

                latch.countDown();
            }
        });

        channel1.publish("1");
        channel2.publish("2");

        assertTrue(latch.await(5, TimeUnit.SECONDS));

        assertEquals(2, responses.size());
        Message response1 = responses.get(0);
View Full Code Here

                assertFalse(message.isSuccessful());
                assertEquals(failure, message.getData());
                latch.countDown();
            }
        });
        channel.publish(failure);

        assertTrue(latch.await(5, TimeUnit.SECONDS));
    }

    @Service
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.