activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1509178 - in /activemq/trunk: activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/ activemq-unit-tests/src/test/java/org/apache/activemq/bugs/ activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/
Date Thu, 01 Aug 2013 11:44:30 GMT
Author: gtully
Date: Thu Aug  1 11:44:30 2013
New Revision: 1509178

URL: http://svn.apache.org/r1509178
Log:
https://issues.apache.org/jira/browse/AMQ-4662 - kahadb default checksumJournalFiles = true
- validate no migration impact as we currently store default checksum value of 0

Modified:
    activemq/trunk/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4368Test.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java

Modified: activemq/trunk/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java?rev=1509178&r1=1509177&r2=1509178&view=diff
==============================================================================
--- activemq/trunk/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
(original)
+++ activemq/trunk/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
Thu Aug  1 11:44:30 2013
@@ -240,7 +240,7 @@ public abstract class MessageDatabase ex
     private boolean ignoreMissingJournalfiles = false;
     private int indexCacheSize = 10000;
     private boolean checkForCorruptJournalFiles = false;
-    private boolean checksumJournalFiles = false;
+    private boolean checksumJournalFiles = true;
     protected boolean forceRecoverIndex = false;
     private final Object checkpointThreadLock = new Object();
     private boolean rewriteOnRedelivery = false;

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4368Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4368Test.java?rev=1509178&r1=1509177&r2=1509178&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4368Test.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4368Test.java
Thu Aug  1 11:44:30 2013
@@ -68,7 +68,6 @@ public class AMQ4368Test {
         broker.getDestinationPolicy().setDefaultEntry(policy);
 
         KahaDBPersistenceAdapter kahadb = new KahaDBPersistenceAdapter();
-        kahadb.setChecksumJournalFiles(true);
         kahadb.setCheckForCorruptJournalFiles(true);
         kahadb.setCleanupInterval(1000);
 

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java?rev=1509178&r1=1509177&r2=1509178&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java
Thu Aug  1 11:44:30 2013
@@ -108,7 +108,7 @@ public class KahaDBTest extends TestCase
 
     public void testCheckCorruptionNotIgnored() throws Exception {
         KahaDBStore kaha = createStore(true);
-        assertFalse(kaha.isChecksumJournalFiles());
+        assertTrue(kaha.isChecksumJournalFiles());
         assertFalse(kaha.isCheckForCorruptJournalFiles());
 
         kaha.setJournalMaxFileLength(1024*100);
@@ -135,6 +135,27 @@ public class KahaDBTest extends TestCase
 
     }
 
+
+    public void testMigrationOnNewDefaultForChecksumJournalFiles() throws Exception {
+        KahaDBStore kaha = createStore(true);
+        kaha.setChecksumJournalFiles(false);
+        assertFalse(kaha.isChecksumJournalFiles());
+        assertFalse(kaha.isCheckForCorruptJournalFiles());
+
+        kaha.setJournalMaxFileLength(1024*100);
+        BrokerService broker = createBroker(kaha);
+        sendMessages(1000);
+        broker.stop();
+
+        kaha = createStore(false);
+        kaha.setJournalMaxFileLength(1024*100);
+        kaha.setCheckForCorruptJournalFiles(true);
+        assertFalse(kaha.isIgnoreMissingJournalfiles());
+        createBroker(kaha);
+        assertEquals(1000, receiveMessages());
+    }
+
+
     private void assertExistsAndCorrupt(File file) throws IOException {
         assertTrue(file.exists());
         RandomAccessFile f = new RandomAccessFile(file, "rw");
@@ -150,7 +171,6 @@ public class KahaDBTest extends TestCase
     public void testCheckCorruptionIgnored() throws Exception {
         KahaDBStore kaha = createStore(true);
         kaha.setJournalMaxFileLength(1024*100);
-        kaha.setChecksumJournalFiles(true);
         BrokerService broker = createBroker(kaha);
         sendMessages(1000);
         broker.stop();
@@ -162,7 +182,6 @@ public class KahaDBTest extends TestCase
         kaha = createStore(false);
         kaha.setIgnoreMissingJournalfiles(true);
         kaha.setJournalMaxFileLength(1024*100);
-        kaha.setChecksumJournalFiles(true);
         kaha.setCheckForCorruptJournalFiles(true);
         broker = createBroker(kaha);
 



Mime
View raw message