StorageId queueId = new StorageId(glob, Constants.RELATING_CALLBACK, "initialEntries");
try {
String type = PLUGIN_TYPES[this.count];
this.glob.getProperty().set("cb.queue.persistent.tableNamePrefix", "TEST");
QueuePluginManager pluginManager = new QueuePluginManager(glob);
PluginInfo pluginInfo = new PluginInfo(glob, pluginManager, type, "1.0");
java.util.Properties prop = (java.util.Properties)pluginInfo.getParameters();
prop.put("tableNamePrefix", "TEST");
prop.put("entriesTableName", "_entries");
I_Queue tmpQueue = pluginManager.getPlugin(pluginInfo, queueId, cbProp);
tmpQueue.clear();
// add some persistent entries and then shutdown ...
DummyEntry entry = new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), 100, true);
tmpQueue.put(entry, false);
entry = new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), 100, true);
tmpQueue.put(entry, false);
entry = new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), 100, true);
tmpQueue.put(entry, false);
tmpQueue.shutdown(); // to allow to initialize again
I_Queue tmpQueue2 = pluginManager.getPlugin(pluginInfo, queueId, cbProp);
long numOfEntries = tmpQueue2.getNumOfEntries();
assertEquals("Wrong number of entries in queue", 3L, numOfEntries);
List<I_Entry> lst = tmpQueue2.peek(-1, -1L);
assertEquals("Wrong number of entries retrieved from queue", 3, lst.size());
queue.shutdown();