[1/3] activemq-artemis git commit: This closes #2460

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/3] activemq-artemis git commit: This closes #2460

nigrofranz
Repository: activemq-artemis
Updated Branches:
  refs/heads/master aac7b8373 -> e41a24af7


This closes #2460


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

Branch: refs/heads/master
Commit: e41a24af782f1127b48095d73074b6e32bba4f1e
Parents: aac7b83 a3001fd
Author: Francesco Nigro <[hidden email]>
Authored: Fri Dec 14 11:32:13 2018 +0100
Committer: Francesco Nigro <[hidden email]>
Committed: Fri Dec 14 11:32:13 2018 +0100

----------------------------------------------------------------------
 .../journal/impl/JournalFilesRepository.java    |  4 ++
 .../core/config/impl/FileConfigurationTest.java | 40 ++++++++++++++++++++
 2 files changed, 44 insertions(+)
----------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

[2/3] activemq-artemis git commit: ARTEMIS-2201 Added tests on DEFAULT_JOURNAL_FILE_OPEN_TIMEOUT value

nigrofranz
ARTEMIS-2201 Added tests on DEFAULT_JOURNAL_FILE_OPEN_TIMEOUT value


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

Branch: refs/heads/master
Commit: a3001fd9bd8456f30ba0ddddc9ba767e32bad7e1
Parents: 6dfa9a1
Author: feuillemorte <[hidden email]>
Authored: Thu Dec 13 15:14:05 2018 +0100
Committer: Francesco Nigro <[hidden email]>
Committed: Fri Dec 14 11:32:13 2018 +0100

----------------------------------------------------------------------
 .../artemis/core/journal/impl/JournalFilesRepository.java     | 4 ++++
 .../artemis/core/config/impl/FileConfigurationTest.java       | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a3001fd9/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
index eb4740f..2c6033b 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
@@ -242,6 +242,10 @@ public class JournalFilesRepository {
       return dataFiles.size();
    }
 
+   public int getJournalFileOpenTimeout() {
+      return journalFileOpenTimeout;
+   }
+
    public Collection<JournalFile> getDataFiles() {
       return dataFiles;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a3001fd9/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
index cf78e2d..66d1e9e 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
@@ -29,6 +29,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
 import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBasePlugin;
 import org.apache.activemq.artemis.utils.RandomUtil;
@@ -677,6 +678,8 @@ public class FileConfigurationTest extends ConfigurationImplTest {
       ActiveMQServerImpl server = new ActiveMQServerImpl();
       try {
          server.start();
+         JournalImpl journal = (JournalImpl) server.getStorageManager().getBindingsJournal();
+         Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalFileOpenTimeout(), journal.getFilesRepository().getJournalFileOpenTimeout());
          Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalFileOpenTimeout(), server.getConfiguration().getJournalFileOpenTimeout());
       } finally {
          server.stop();
@@ -685,12 +688,14 @@ public class FileConfigurationTest extends ConfigurationImplTest {
 
    @Test
    public void testJournalFileOpenTimeoutValue() throws Exception {
-      int timeout = RandomUtil.randomInt();
+      int timeout = RandomUtil.randomPositiveInt();
       Configuration configuration = createConfiguration("shared-store-master-hapolicy-config.xml");
       configuration.setJournalFileOpenTimeout(timeout);
       ActiveMQServerImpl server = new ActiveMQServerImpl(configuration);
       try {
          server.start();
+         JournalImpl journal = (JournalImpl) server.getStorageManager().getBindingsJournal();
+         Assert.assertEquals(timeout, journal.getFilesRepository().getJournalFileOpenTimeout());
          Assert.assertEquals(timeout, server.getConfiguration().getJournalFileOpenTimeout());
       } finally {
          server.stop();

Reply | Threaded
Open this post in threaded view
|

[3/3] activemq-artemis git commit: #ARTEMIS-2201 Added tests on DEFAULT_JOURNAL_FILE_OPEN_TIMEOUT value

nigrofranz
In reply to this post by nigrofranz
#ARTEMIS-2201 Added tests on DEFAULT_JOURNAL_FILE_OPEN_TIMEOUT value


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

Branch: refs/heads/master
Commit: 6dfa9a1fa4a22705ed6c3ee9a1c0f20046cbfb0a
Parents: aac7b83
Author: feuillemorte <[hidden email]>
Authored: Tue Dec 11 15:05:45 2018 +0100
Committer: Francesco Nigro <[hidden email]>
Committed: Fri Dec 14 11:32:13 2018 +0100

----------------------------------------------------------------------
 .../core/config/impl/FileConfigurationTest.java | 35 ++++++++++++++++++++
 1 file changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6dfa9a1f/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
index a60eb2d..cf78e2d 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
@@ -29,7 +29,9 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
+import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBasePlugin;
+import org.apache.activemq.artemis.utils.RandomUtil;
 import org.apache.activemq.artemis.utils.critical.CriticalAnalyzerPolicy;
 import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration;
 import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
@@ -670,6 +672,31 @@ public class FileConfigurationTest extends ConfigurationImplTest {
       assertTrue("check failed, " + defaultConfirmationWinSize + ":" + defaultIdCacheSize, ConfigurationImpl.checkoutDupCacheSize(defaultConfirmationWinSize, defaultIdCacheSize));
    }
 
+   @Test
+   public void testJournalFileOpenTimeoutDefaultValue() throws Exception {
+      ActiveMQServerImpl server = new ActiveMQServerImpl();
+      try {
+         server.start();
+         Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalFileOpenTimeout(), server.getConfiguration().getJournalFileOpenTimeout());
+      } finally {
+         server.stop();
+      }
+   }
+
+   @Test
+   public void testJournalFileOpenTimeoutValue() throws Exception {
+      int timeout = RandomUtil.randomInt();
+      Configuration configuration = createConfiguration("shared-store-master-hapolicy-config.xml");
+      configuration.setJournalFileOpenTimeout(timeout);
+      ActiveMQServerImpl server = new ActiveMQServerImpl(configuration);
+      try {
+         server.start();
+         Assert.assertEquals(timeout, server.getConfiguration().getJournalFileOpenTimeout());
+      } finally {
+         server.stop();
+      }
+   }
+
    @Override
    protected Configuration createConfiguration() throws Exception {
       FileConfiguration fc = new FileConfiguration();
@@ -679,6 +706,14 @@ public class FileConfigurationTest extends ConfigurationImplTest {
       return fc;
    }
 
+   private Configuration createConfiguration(String filename) throws Exception {
+      FileConfiguration fc = new FileConfiguration();
+      FileDeploymentManager deploymentManager = new FileDeploymentManager(filename);
+      deploymentManager.addDeployable(fc);
+      deploymentManager.readConfiguration();
+      return fc;
+   }
+
    public static class EmptyPlugin1 implements ActiveMQServerPlugin {
 
    }