Fixes issue in AMQ-4296: Implement a pure LevelDB test for the StoreQueueCursorNoDuplicateTest and fix the bug that was causing it to fail.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1483582 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2013-05-16 21:50:25 +00:00
parent 7071102b13
commit ef6df68831
2 changed files with 6 additions and 14 deletions

View File

@ -700,7 +700,7 @@ class LevelDBStore extends LockableServiceSupport with BrokerServiceAware with P
}
override def setBatch(id: MessageId): Unit = {
cursorPosition = db.queuePosition(id)
cursorPosition = db.queuePosition(id)+1
}
}

View File

@ -17,32 +17,24 @@
package org.apache.activemq.broker.region.cursors;
import java.io.File;
import org.apache.activeio.journal.active.JournalImpl;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.leveldb.LevelDBStore;
import org.apache.activemq.store.journal.JournalPersistenceAdapter;
import java.io.File;
/**
* @author gtully
* @see https://issues.apache.org/activemq/browse/AMQ-2020
**/
public class StoreQueueCursorJournalNoDuplicateTest extends StoreQueueCursorNoDuplicateTest {
public class StoreQueueCursorLevelDBNoDuplicateTest extends StoreQueueCursorNoDuplicateTest {
@Override
protected BrokerService createBroker() throws Exception {
BrokerService broker = super.createBroker();
File dataFileDir = new File("target/activemq-data/StoreQueueCursorJournalNoDuplicateTest");
File journalDir = new File(dataFileDir, "journal").getCanonicalFile();
JournalImpl journal = new JournalImpl(journalDir, 3, 1024 * 1024 * 20);
LevelDBStore store = new LevelDBStore();
store.setDirectory(dataFileDir);
JournalPersistenceAdapter journalAdaptor = new JournalPersistenceAdapter(journal, store, broker.getTaskRunnerFactory());
journalAdaptor.setMaxCheckpointWorkers(1);
broker.setPersistenceAdapter(journalAdaptor);
store.setDirectory(new File("target/activemq-data/leveldb"));
broker.setPersistenceAdapter(store);
return broker;
}
}