this.queue.addStorageSizeListener(this.queueSizeListener);
this.queueSizeListener.clear();
for (int ii=0; ii<numLoop; ii++) {
DummyEntry[] queueEntries = {
new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), true),
new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), true),
new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), true)};
queue.put(queueEntries, false);
assertEquals("number of entries incremented on last invocation", 3, this.queueSizeListener.getLastIncrementEntries());
assertEquals("number of bytes incremented on last invocation", 3*queueEntries[0].getSizeInBytes(), this.queueSizeListener.getLastIncrementBytes());
for (int i=0; i < 3; i++) list.add(queueEntries[i]);
this.checkSizeAndEntries(" put(I_QueueEntry[]) ", list, queue);
assertEquals(ME+": Wrong size", (ii+1)*queueEntries.length, queue.getNumOfEntries());
}
assertEquals("number of invocations for queue size listener is wrong", numLoop, this.queueSizeListener.getCount());
int total = numLoop*3;
assertEquals(ME+": Wrong total size", total, queue.getNumOfEntries());
log.info("#1 Success, filled " + queue.getNumOfEntries() + " messages into queue");
//========== Test 2: put(I_QueueEntry)
for (int ii=0; ii<numLoop; ii++) {
DummyEntry queueEntry = new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), true);
list.add(queueEntry);
queue.put(queueEntry, false);
}
assertEquals(ME+": Wrong total size", numLoop+total, queue.getNumOfEntries());
this.checkSizeAndEntries(" put(I_QueueEntry) ", list, queue);