assertEquals("", 3, i_map.getNumOfEntries());
assertEquals("", 2, i_map.getNumOfPersistentEntries());
for (int ii=0; ii<10; ii++) {
I_MapEntry result = i_map.get(queueEntries[0].getUniqueId());
assertTrue("Missing entry", result != null);
assertEquals(ME+": Wrong result", queueEntries[0].getUniqueId(), result.getUniqueId());
result = i_map.get(queueEntries[1].getUniqueId());
assertTrue("Missing entry", result != null);
assertEquals(ME+": Wrong result", queueEntries[1].getUniqueId(), result.getUniqueId());
result = i_map.get(queueEntries[2].getUniqueId());
assertTrue("Missing entry", result != null);
assertEquals(ME+": Wrong result", queueEntries[2].getUniqueId(), result.getUniqueId());
}
assertEquals("", 3, i_map.getNumOfEntries());
assertEquals("", 2, i_map.getNumOfPersistentEntries());
log.info("storage before remove [0], bytes sum=" + i_map.getNumOfBytes() + " with persistent bytes=" + i_map.getNumOfPersistentBytes());
i_map.remove(queueEntries[0]); // Remove one
log.info("storage after remove [0], bytes sum=" + i_map.getNumOfBytes() + " with persistent bytes=" + i_map.getNumOfPersistentBytes());
ArrayList list = new ArrayList();
list.add(queueEntries[1]);
list.add(queueEntries[2]);
this.checkSizeAndEntries(" getMsg() ", list, i_map);
for (int ii=0; ii<10; ii++) {
I_MapEntry result = i_map.get(queueEntries[1].getUniqueId());
assertTrue("Missing entry", result != null);
assertEquals(ME+": Wrong result", queueEntries[1].getUniqueId(), result.getUniqueId());
}
i_map.remove(queueEntries[1].getUniqueId()); // Remove one
assertEquals("", 1, i_map.getNumOfEntries());
assertEquals("", 1, i_map.getNumOfPersistentEntries());
for (int ii=0; ii<10; ii++) {
I_MapEntry result = i_map.get(queueEntries[2].getUniqueId());
assertTrue("Missing entry", result != null);
assertEquals(ME+": Wrong result", queueEntries[2].getUniqueId(), result.getUniqueId());
}
i_map.remove(queueEntries[2]); // Remove one
for (int ii=0; ii<10; ii++) {
I_MapEntry result = i_map.get(queueEntries[0].getUniqueId());
assertTrue("Unexpected entry", result == null);
}
assertEquals("", 0, i_map.getNumOfEntries());
assertEquals("", 0, i_map.getNumOfPersistentEntries());
log.info("#1 Success, get()");