activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-artemis git commit: ARTEMIS-560 Small improvements on JDBC tests for paging + adding a logger
Date Tue, 17 Jan 2017 20:01:06 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master a79094b6e -> 43aaf52d4


ARTEMIS-560 Small improvements on JDBC tests for paging + adding a logger


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b4cbd36a
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b4cbd36a
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b4cbd36a

Branch: refs/heads/master
Commit: b4cbd36af4d7b7120f38f4ea63e4e32489350c96
Parents: 118c272
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Tue Jan 17 14:57:39 2017 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Jan 17 14:58:53 2017 -0500

----------------------------------------------------------------------
 .../jdbc/store/file/JDBCSequentialFile.java     |  1 +
 .../tests/integration/paging/PagingTest.java    | 47 ++++++++++----------
 2 files changed, 25 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b4cbd36a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java
b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java
index 3f078c2..69ff11a 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFile.java
@@ -92,6 +92,7 @@ public class JDBCSequentialFile implements SequentialFile {
       try {
          return fileFactory.listFiles(extension).contains(filename);
       } catch (Exception e) {
+         logger.warn(e.getMessage(), e);
          return false;
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b4cbd36a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
index bc614ea..3a932b9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
@@ -56,10 +56,9 @@ import org.apache.activemq.artemis.core.config.DivertConfiguration;
 import org.apache.activemq.artemis.core.config.StoreConfiguration;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.io.IOCallback;
-import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory;
+import org.apache.activemq.artemis.core.journal.Journal;
 import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
 import org.apache.activemq.artemis.core.journal.RecordInfo;
-import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
 import org.apache.activemq.artemis.core.paging.PagingManager;
 import org.apache.activemq.artemis.core.paging.PagingStore;
 import org.apache.activemq.artemis.core.paging.cursor.PageCursorProvider;
@@ -1461,8 +1460,6 @@ public class PagingTest extends ActiveMQTestBase {
 
    @Test
    public void testMissingTXEverythingAcked() throws Exception {
-      if (storeType == StoreConfiguration.StoreType.DATABASE) return;
-
       clearDataRecreateServerDirs();
 
       Configuration config = createDefaultInVMConfig().setJournalSyncNonTransactional(false);
@@ -1516,31 +1513,35 @@ public class PagingTest extends ActiveMQTestBase {
          }
          session.commit();
          session.close();
-      } finally {
-         try {
-            server.stop();
-         } catch (Throwable ignored) {
-         }
-      }
 
-      ArrayList<RecordInfo> records = new ArrayList<>();
 
-      List<PreparedTransactionInfo> list = new ArrayList<>();
+         ArrayList<RecordInfo> records = new ArrayList<>();
+
+         List<PreparedTransactionInfo> list = new ArrayList<>();
+
+         server.getStorageManager().getMessageJournal().stop();
 
-      JournalImpl jrn = new JournalImpl(config.getJournalFileSize(), 2, 2, 0, 0, new NIOSequentialFileFactory(server.getConfiguration().getJournalLocation(),
1), "activemq-data", "amq", 1);
-      jrn.start();
-      jrn.load(records, list, null);
+         Journal jrn = server.getStorageManager().getMessageJournal();
+         jrn.start();
+         jrn.load(records, list, null);
 
-      // Delete everything from the journal
-      for (RecordInfo info : records) {
-         if (!info.isUpdate && info.getUserRecordType() != JournalRecordIds.PAGE_CURSOR_COUNTER_VALUE
&&
-            info.getUserRecordType() != JournalRecordIds.PAGE_CURSOR_COUNTER_INC &&
-            info.getUserRecordType() != JournalRecordIds.PAGE_CURSOR_COMPLETE) {
-            jrn.appendDeleteRecord(info.id, false);
+         // Delete everything from the journal
+         for (RecordInfo info : records) {
+            if (!info.isUpdate && info.getUserRecordType() != JournalRecordIds.PAGE_CURSOR_COUNTER_VALUE
&&
+               info.getUserRecordType() != JournalRecordIds.PAGE_CURSOR_COUNTER_INC &&
+               info.getUserRecordType() != JournalRecordIds.PAGE_CURSOR_COMPLETE) {
+               jrn.appendDeleteRecord(info.id, false);
+            }
          }
-      }
 
-      jrn.stop();
+         jrn.stop();
+
+      } finally {
+         try {
+            server.stop();
+         } catch (Throwable ignored) {
+         }
+      }
 
       server = createServer(true, config, PagingTest.PAGE_SIZE, PagingTest.PAGE_MAX);
 


Mime
View raw message