System.out.println("-- events: " + events); assertEquals("we should have a BLOCK and an UNBLOCK event", 2, num_events);
System.out.println("-- receiver: " + events); assertEquals("we should have a BLOCK, UNBLOCK, BLOCK, UNBLOCK sequence", 4, num_events);
    public void testBlockPush() throws Exception {        c1=factory.createMultiplexerChannel(STACK_NAME, "service-1");        c1.setOpt(Channel.BLOCK, Boolean.TRUE);        MyReceiver receiver=new MyReceiver();        c1.setReceiver(receiver);        c1.connect("bla");        c2=factory2.createMultiplexerChannel(STACK_NAME, "service-1");        c2.setOpt(Channel.BLOCK, Boolean.TRUE);        MyReceiver receiver2=new MyReceiver();        c2.setReceiver(receiver2);        c2.connect("bla");        List events=receiver.getEvents();        int num_events=events.size();        System.out.println("-- events: " + events);        assertEquals("we should have a BLOCK and an UNBLOCK event", 2, num_events);        Object evt=events.remove(0);        assertTrue(evt instanceof BlockEvent);        evt=events.remove(0);        assertTrue(evt instanceof UnblockEvent);        events=receiver2.getEvents();        num_events=events.size();        System.out.println("-- events: " + events);    }