session0.getChannel("/foo/bar").unsubscribe(listener);
Assert.assertEquals(3,_bayeux.getChannel("/foo/bar").getSubscribers().size());
session0.getChannel("/foo/bar").unsubscribe(listener);
Assert.assertEquals(2,_bayeux.getChannel("/foo/bar").getSubscribers().size());
ClientSessionChannel foobar0=session0.getChannel("/foo/bar");
foobar0.subscribe(listener);
foobar0.subscribe(listener);
ClientSessionChannel foostar0=session0.getChannel("/foo/*");
foostar0.subscribe(listener);
Assert.assertEquals(3,_bayeux.getChannel("/foo/bar").getSubscribers().size());
Assert.assertEquals(session0,foobar0.getSession());
Assert.assertEquals("/foo/bar",foobar0.getId());
Assert.assertEquals(false,foobar0.isDeepWild());
Assert.assertEquals(false,foobar0.isWild());
Assert.assertEquals(false,foobar0.isMeta());
Assert.assertEquals(false,foobar0.isService());
foobar0.publish("hello");
Assert.assertEquals(session0.getId(),events.poll());
Assert.assertEquals("hello",events.poll());
Assert.assertEquals(session0.getId(),events.poll());
Assert.assertEquals("hello",events.poll());
Assert.assertEquals(session0.getId(),events.poll());
Assert.assertEquals("hello",events.poll());
Assert.assertEquals(session1.getId(),events.poll());
Assert.assertEquals("hello",events.poll());
Assert.assertEquals(session2.getId(),events.poll());
Assert.assertEquals("hello",events.poll());
foostar0.unsubscribe(listener);
session1.batch(new Runnable()
{
public void run()
{
ClientSessionChannel foobar1=session1.getChannel("/foo/bar");
foobar1.publish("part1");
Assert.assertEquals(null,events.poll());
foobar1.publish("part2");
}
});
Assert.assertEquals(session1.getId(),events.poll());
Assert.assertEquals("part1",events.poll());