for (int i=0; i < entries1; i++) {
this.queue.put(entries[i], false);
// assertEquals(ME + " number of entries after putting transients is wrong ", transients.length, queue.getNumOfEntries());
}
CacheQueueInterceptorPlugin cacheQueue = (CacheQueueInterceptorPlugin)this.queue;
cacheQueue.storageUnavailable(I_StorageProblemListener.AVAILABLE);
for (int i=entries1; i < entries2; i++) {
this.queue.put(entries[i], false);
}
List<I_Entry> list = this.queue.peek(-1, -1L);
assertEquals(ME + " number of entries when retrieving is wrong ", entries2, list.size());
for (int i=0; i < list.size(); i++) {
long uniqueId = ((I_QueueEntry)list.get(i)).getUniqueId();
assertEquals(ME + " entry sequence is wrong ", entries[i].getUniqueId(), uniqueId);
}
long ret = 0L;
boolean[] tmpArr = this.queue.removeRandom( (I_QueueEntry[])list.toArray(new I_QueueEntry[list.size()]) );
for (int i=0; i < tmpArr.length; i++) if (tmpArr[i]) ret++;
assertEquals(ME + " number of entries removed is wrong ", (long)entries2, ret);
list = this.queue.peek(-1, -1L);
assertEquals(ME + " number of entries peeked after removal is wrong ", 0, list.size());
long num = this.queue.getNumOfEntries();
assertEquals(ME + " number of entries after removal is wrong ", 0L, num);
cacheQueue.storageAvailable(I_StorageProblemListener.UNAVAILABLE);
list = this.queue.peek(-1, -1L);
assertEquals(ME + " number of entries peeked after reconnecting is wrong ", 0, list.size());
num = this.queue.getNumOfEntries();
assertEquals(ME + " number of entries after reconnecting is wrong ", 0L, num);