.println("!!!!!!!!!!!!!!!Begin testConsumeBatchWhenAvailable!!!!!!!!!!!!");
resetNum();
// Set queue length to bigger enough
DisruptorQueue queue = createQueue("messageOrder", ProducerType.MULTI,
128);
push(queue, 128);
queue.consumeBatchWhenAvailable(handler);
Assert.assertEquals("produce: " + produceNum.get() + ", consume:"
+ consumerNum.get(), produceNum.get(), consumerNum.get());
System.out
.println("!!!!!! finish testConsumeBatchWhenAvailable test 1");
resetNum();
queue.consumerStarted();
push(queue, 128);
queue.consumeBatchWhenAvailable(handler);
Assert.assertEquals("produce: " + produceNum.get() + ", consume:"
+ consumerNum.get(), produceNum.get(), consumerNum.get());
System.out
.println("!!!!!! finish testConsumeBatchWhenAvailable test 2");
System.out
.println("!!!!!!!!!!!!!!!Finsh testConsumeBatchWhenAvailable for MULTI!!!!!!!!!!!!");
resetNum();
// Set queue length to bigger enough
DisruptorQueue queue2 = createQueue("messageOrder",
ProducerType.SINGLE, 128);
push(queue2, 128);
queue2.consumeBatchWhenAvailable(handler);
Assert.assertEquals("produce: " + produceNum.get() + ", consume:"
+ consumerNum.get(), produceNum.get(), consumerNum.get());
System.out
.println("!!!!!! finish testConsumeBatchWhenAvailable test 3");
resetNum();
queue2.consumerStarted();
push(queue2, 128);
queue2.consumeBatchWhenAvailable(handler);
Assert.assertEquals("produce: " + produceNum.get() + ", consume:"
+ consumerNum.get(), produceNum.get(), consumerNum.get());
System.out
.println("!!!!!! finish testConsumeBatchWhenAvailable test 4");