activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1483582 - in /activemq/trunk: activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/ activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/
Date Thu, 16 May 2013 21:50:26 GMT
Author: chirino
Date: Thu May 16 21:50:25 2013
New Revision: 1483582

URL: http://svn.apache.org/r1483582
Log:
Fixes issue in AMQ-4296: Implement a pure LevelDB test for the StoreQueueCursorNoDuplicateTest
and fix the bug that was causing it to fail.

Added:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorLevelDBNoDuplicateTest.java
      - copied, changed from r1483538, activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorJournalNoDuplicateTest.java
Removed:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorJournalNoDuplicateTest.java
Modified:
    activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala

Modified: activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala?rev=1483582&r1=1483581&r2=1483582&view=diff
==============================================================================
--- activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
(original)
+++ activemq/trunk/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBStore.scala
Thu May 16 21:50:25 2013
@@ -700,7 +700,7 @@ class LevelDBStore extends LockableServi
     }
 
     override def setBatch(id: MessageId): Unit = {
-      cursorPosition = db.queuePosition(id)
+      cursorPosition = db.queuePosition(id)+1
     }
 
   }

Copied: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorLevelDBNoDuplicateTest.java
(from r1483538, activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorJournalNoDuplicateTest.java)
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorLevelDBNoDuplicateTest.java?p2=activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorLevelDBNoDuplicateTest.java&p1=activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorJournalNoDuplicateTest.java&r1=1483538&r2=1483582&rev=1483582&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorJournalNoDuplicateTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/StoreQueueCursorLevelDBNoDuplicateTest.java
Thu May 16 21:50:25 2013
@@ -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;
     }
 }



Mime
View raw message