*/
private void config(I_Queue queue) {
ME = "I_QueueTest.config(" + queue.getStorageId() + ")[" + queue.getClass().getName() + "]";
System.out.println("***" + ME);
QueuePropertyBase prop1 = null;
QueuePropertyBase prop = null;
try {
// test initialize()
prop1 = new CbQueueProperty(glob, Constants.RELATING_CALLBACK, "/node/test");
int max = 12;
prop1.setMaxEntries(max);
prop1.setMaxEntriesCache(max);
assertEquals(ME+": Wrong capacity", max, prop1.getMaxEntries());
assertEquals(ME+": Wrong cache capacity", max, prop1.getMaxEntriesCache());
//PluginInfo pluginInfo = new PluginInfo(glob, null, "");
//queue.init(glob, pluginInfo); // Init from pluginloader is first
StorageId queueId = new StorageId(glob, Constants.RELATING_CALLBACK, "SomeQueueId");
queue.initialize(queueId, prop1);
queue.clear(); // this is needed since the tearDown has cleaned the queue with previous cfg (other StorageId)
assertEquals(ME+": Wrong queue ID", queueId, queue.getStorageId());
try {
prop = new CbQueueProperty(glob, Constants.RELATING_SUBJECT, "/node/test");
prop.setMaxEntries(99);
prop.setMaxEntriesCache(99);
queue.setProperties(prop);
}
catch(XmlBlasterException e) {
fail("Changing properties failed");
}
}
catch(XmlBlasterException e) {
fail(ME + ": Exception thrown: " + e.getMessage());
}
long len = prop.getMaxEntries();
assertEquals(ME+": Wrong capacity", prop.getMaxEntries(), queue.getMaxNumOfEntries());
assertEquals(ME+": Wrong capacity", prop.getMaxEntries(), ((QueuePropertyBase)queue.getProperties()).getMaxEntries());
assertEquals(ME+": Wrong size", 0, queue.getNumOfEntries());
try {
for (int ii=0; ii<len; ii++) {
queue.put(new DummyEntry(glob, PriorityEnum.NORM_PRIORITY, queue.getStorageId(), true), false);