activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [3/3] activemq-artemis git commit: ARTEMIS-560 Small improvements on JDBC tests for paging + adding a logger
Date Tue, 17 Jan 2017 20:02:36 GMT
ARTEMIS-560 Small improvements on JDBC tests for paging + adding a logger

(cherry picked from commit b4cbd36af4d7b7120f38f4ea63e4e32489350c96)


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

Branch: refs/heads/1.x
Commit: 52d03c885c446104c6b89eaf203d62590ad444c3
Parents: 115ccf8
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 15:02:24 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/52d03c88/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/52d03c88/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 76f3dfd..832b1aa 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;
@@ -1459,8 +1458,6 @@ public class PagingTest extends ActiveMQTestBase {
 
    @Test
    public void testMissingTXEverythingAcked() throws Exception {
-      if (storeType == StoreConfiguration.StoreType.DATABASE) return;
-
       clearDataRecreateServerDirs();
 
       Configuration config = createDefaultInVMConfig().setJournalSyncNonTransactional(false);
@@ -1514,31 +1511,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