From 6bf1241628e74ca9cfe41027fad0e3972a6062b7 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 13 Oct 2015 09:26:50 -0400 Subject: [PATCH] ARTEMIS-257 cleaning up dependencies on artemis-core-client --- .../activemq/artemis/ArtemisConstants.java | 25 ++++++++++++++++++ artemis-core-client/pom.xml | 11 -------- .../config/ActiveMQDefaultConfiguration.java | 10 +++---- artemis-jms-client/pom.xml | 5 ++++ .../core/io/aio/AIOSequentialFileFactory.java | 6 ++--- .../core/io/nio/NIOSequentialFileFactory.java | 6 ++--- .../core/journal/impl/JournalConstants.java | 12 ++++----- artemis-server/pom.xml | 5 ++++ .../artemis/core/config/Configuration.java | 8 +++--- .../impl/FileConfigurationParser.java | 26 +++++++++---------- .../config/impl/ConfigurationImplTest.java | 10 +++---- .../impl/DefaultsFileConfigurationTest.java | 22 +++++++--------- .../journal/AIOJournalCompactTest.java | 6 ++--- .../journal/AIOJournalImplTest.java | 4 +-- .../ValidateTransactionHealthTest.java | 16 ++++++------ .../AIOAllPossibilitiesCompactStressTest.java | 4 +-- 16 files changed, 99 insertions(+), 77 deletions(-) create mode 100644 artemis-commons/src/main/java/org/apache/activemq/artemis/ArtemisConstants.java diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/ArtemisConstants.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/ArtemisConstants.java new file mode 100644 index 0000000000..4e3602c627 --- /dev/null +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/ArtemisConstants.java @@ -0,0 +1,25 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.activemq.artemis; + +public class ArtemisConstants { + public static final int DEFAULT_JOURNAL_BUFFER_SIZE_AIO = 490 * 1024; + public static final int DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO = (int) (1000000000d / 2000); + public static final int DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO = (int) (1000000000d / 300); + public static final int DEFAULT_JOURNAL_BUFFER_SIZE_NIO = 490 * 1024; +} diff --git a/artemis-core-client/pom.xml b/artemis-core-client/pom.xml index 97d880ffb9..2445ffa13a 100644 --- a/artemis-core-client/pom.xml +++ b/artemis-core-client/pom.xml @@ -47,21 +47,10 @@ artemis-commons ${project.version} - - org.apache.activemq - artemis-selector - ${project.version} - - - org.apache.activemq - artemis-journal - ${project.version} - io.netty netty-all - junit junit diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java index 6b1bb5cf43..21d97a31c4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java @@ -16,8 +16,8 @@ */ package org.apache.activemq.artemis.api.config; +import org.apache.activemq.artemis.ArtemisConstants; import org.apache.activemq.artemis.api.core.SimpleString; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; /** * Default values of ActiveMQ Artemis configuration parameters. @@ -99,11 +99,11 @@ public final class ActiveMQDefaultConfiguration { // These defaults are applied depending on whether the journal type // is NIO or AIO. private static int DEFAULT_JOURNAL_MAX_IO_AIO = 500; - private static int DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO = JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO; - private static int DEFAULT_JOURNAL_BUFFER_SIZE_AIO = JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO; + private static int DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO = ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO; + private static int DEFAULT_JOURNAL_BUFFER_SIZE_AIO = ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO; private static int DEFAULT_JOURNAL_MAX_IO_NIO = 1; - private static int DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO = JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO; - private static int DEFAULT_JOURNAL_BUFFER_SIZE_NIO = JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO; + private static int DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO = ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO; + private static int DEFAULT_JOURNAL_BUFFER_SIZE_NIO = ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO; // XXX not on schema. //properties passed to acceptor/connectors. diff --git a/artemis-jms-client/pom.xml b/artemis-jms-client/pom.xml index bc2ed4865d..3001e6ad6c 100644 --- a/artemis-jms-client/pom.xml +++ b/artemis-jms-client/pom.xml @@ -50,6 +50,11 @@ artemis-core-client ${project.version} + + org.apache.activemq + artemis-selector + ${project.version} + org.apache.geronimo.specs geronimo-jms_2.0_spec diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java index 0b80ec69cc..292d683218 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java @@ -27,12 +27,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.activemq.artemis.ArtemisConstants; import org.apache.activemq.artemis.api.core.ActiveMQInterruptedException; import org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory; import org.apache.activemq.artemis.core.io.IOCallback; import org.apache.activemq.artemis.core.io.IOCriticalErrorListener; import org.apache.activemq.artemis.core.io.SequentialFile; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; import org.apache.activemq.artemis.jlibaio.LibaioContext; import org.apache.activemq.artemis.jlibaio.LibaioFile; import org.apache.activemq.artemis.jlibaio.SubmitInfo; @@ -64,11 +64,11 @@ public final class AIOSequentialFileFactory extends AbstractSequentialFileFactor } public AIOSequentialFileFactory(final File journalDir, int maxIO) { - this(journalDir, JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, maxIO, false, null); + this(journalDir, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, maxIO, false, null); } public AIOSequentialFileFactory(final File journalDir, final IOCriticalErrorListener listener, int maxIO) { - this(journalDir, JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, maxIO, false, listener); + this(journalDir, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, maxIO, false, listener); } public AIOSequentialFileFactory(final File journalDir, diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFileFactory.java index 36962b77ad..8880f1a752 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFileFactory.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFileFactory.java @@ -20,10 +20,10 @@ import java.io.File; import java.lang.ref.WeakReference; import java.nio.ByteBuffer; +import org.apache.activemq.artemis.ArtemisConstants; import org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory; import org.apache.activemq.artemis.core.io.IOCriticalErrorListener; import org.apache.activemq.artemis.core.io.SequentialFile; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; public class NIOSequentialFileFactory extends AbstractSequentialFileFactory { @@ -32,7 +32,7 @@ public class NIOSequentialFileFactory extends AbstractSequentialFileFactory { } public NIOSequentialFileFactory(final File journalDir, final IOCriticalErrorListener listener, final int maxIO) { - this(journalDir, false, JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, maxIO, false, listener); + this(journalDir, false, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, maxIO, false, listener); } public NIOSequentialFileFactory(final File journalDir, final boolean buffered, final int maxIO) { @@ -43,7 +43,7 @@ public class NIOSequentialFileFactory extends AbstractSequentialFileFactory { final boolean buffered, final IOCriticalErrorListener listener, final int maxIO) { - this(journalDir, buffered, JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, maxIO, false, listener); + this(journalDir, buffered, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, maxIO, false, listener); } public NIOSequentialFileFactory(final File journalDir, diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalConstants.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalConstants.java index 257065a85f..037e319b2b 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalConstants.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalConstants.java @@ -16,11 +16,11 @@ */ package org.apache.activemq.artemis.core.journal.impl; -public final class JournalConstants { - - public static final int DEFAULT_JOURNAL_BUFFER_SIZE_AIO = 490 * 1024; - public static final int DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO = (int) (1000000000d / 2000); - public static final int DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO = (int) (1000000000d / 300); - public static final int DEFAULT_JOURNAL_BUFFER_SIZE_NIO = 490 * 1024; +import org.apache.activemq.artemis.ArtemisConstants; +@Deprecated +/** + * @deprecated Use ArtemisConstants instead. + */ +public final class JournalConstants extends ArtemisConstants { } diff --git a/artemis-server/pom.xml b/artemis-server/pom.xml index 36cef29408..1611525110 100644 --- a/artemis-server/pom.xml +++ b/artemis-server/pom.xml @@ -56,6 +56,11 @@ artemis-commons ${project.version} + + org.apache.activemq + artemis-selector + ${project.version} + org.apache.activemq artemis-journal diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java index 4a69128b11..529f6cfb23 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java @@ -583,7 +583,7 @@ public interface Configuration { /** * Returns the timeout (in nanoseconds) used to flush buffers in the AIO queue. *
- * Default value is {@link org.apache.activemq.artemis.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO}. + * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO}. */ int getJournalBufferTimeout_AIO(); @@ -595,7 +595,7 @@ public interface Configuration { /** * Returns the buffer size (in bytes) for AIO. *
- * Default value is {@link org.apache.activemq.artemis.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_SIZE_AIO}. + * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_SIZE_AIO}. */ int getJournalBufferSize_AIO(); @@ -618,7 +618,7 @@ public interface Configuration { /** * Returns the timeout (in nanoseconds) used to flush buffers in the NIO. *
- * Default value is {@link org.apache.activemq.artemis.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}. + * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}. */ int getJournalBufferTimeout_NIO(); @@ -630,7 +630,7 @@ public interface Configuration { /** * Returns the buffer size (in bytes) for NIO. *
- * Default value is {@link org.apache.activemq.artemis.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_SIZE_NIO}. + * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_SIZE_NIO}. */ int getJournalBufferSize_NIO(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java index 7beeb23da6..0b081ad1cb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java @@ -16,6 +16,17 @@ */ package org.apache.activemq.artemis.core.deployers.impl; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.activemq.artemis.ArtemisConstants; import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; import org.apache.activemq.artemis.api.core.BroadcastEndpointFactory; import org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration; @@ -42,7 +53,6 @@ import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfigur import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; import org.apache.activemq.artemis.core.config.impl.Validators; import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; import org.apache.activemq.artemis.core.security.Role; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; import org.apache.activemq.artemis.core.server.JournalType; @@ -64,16 +74,6 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - /** * Parses an XML document according to the {@literal artemis-configuration.xsd} schema. */ @@ -439,9 +439,9 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { config.setJournalFileSize(getInteger(e, "journal-file-size", config.getJournalFileSize(), Validators.GT_ZERO)); - int journalBufferTimeout = getInteger(e, "journal-buffer-timeout", config.getJournalType() == JournalType.ASYNCIO ? JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO : JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, Validators.GT_ZERO); + int journalBufferTimeout = getInteger(e, "journal-buffer-timeout", config.getJournalType() == JournalType.ASYNCIO ? ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO : ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, Validators.GT_ZERO); - int journalBufferSize = getInteger(e, "journal-buffer-size", config.getJournalType() == JournalType.ASYNCIO ? JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO : JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, Validators.GT_ZERO); + int journalBufferSize = getInteger(e, "journal-buffer-size", config.getJournalType() == JournalType.ASYNCIO ? ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO : ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, Validators.GT_ZERO); int journalMaxIO = getInteger(e, "journal-max-io", config.getJournalType() == JournalType.ASYNCIO ? ActiveMQDefaultConfiguration.getDefaultJournalMaxIoAio() : ActiveMQDefaultConfiguration.getDefaultJournalMaxIoNio(), Validators.GT_ZERO); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java index 447d51bb9b..441af60e82 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java @@ -18,11 +18,11 @@ package org.apache.activemq.artemis.core.config.impl; import java.io.File; +import org.apache.activemq.artemis.ArtemisConstants; import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; import org.apache.activemq.artemis.core.server.JournalType; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.RandomUtil; @@ -69,10 +69,10 @@ public class ConfigurationImplTest extends ActiveMQTestBase { Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultPagingDir(), conf.getPagingDirectory()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultLargeMessagesDir(), conf.getLargeMessagesDirectory()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalCompactPercentage(), conf.getJournalCompactPercentage()); - Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO()); - Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO()); - Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO()); - Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO()); + Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO()); + Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO()); + Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO()); + Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJournalLogWriteRate(), conf.isLogJournalWriteRate()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalPerfBlastPages(), conf.getJournalPerfBlastPages()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultMessageCounterEnabled(), conf.isMessageCounterEnabled()); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DefaultsFileConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DefaultsFileConfigurationTest.java index cd5a3f6a5f..700c290a07 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DefaultsFileConfigurationTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DefaultsFileConfigurationTest.java @@ -16,17 +16,15 @@ */ package org.apache.activemq.artemis.core.config.impl; -import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; -import org.apache.activemq.artemis.core.config.FileDeploymentManager; -import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration; -import org.junit.Test; - import java.util.Collections; -import org.junit.Assert; - +import org.apache.activemq.artemis.ArtemisConstants; +import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; import org.apache.activemq.artemis.core.config.Configuration; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; +import org.apache.activemq.artemis.core.config.FileDeploymentManager; +import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration; +import org.junit.Assert; +import org.junit.Test; public class DefaultsFileConfigurationTest extends ConfigurationImplTest { @@ -98,15 +96,15 @@ public class DefaultsFileConfigurationTest extends ConfigurationImplTest { Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMaxIoAio(), conf.getJournalMaxIO_AIO()); - Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO()); + Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO()); - Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO()); + Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMaxIoNio(), conf.getJournalMaxIO_NIO()); - Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO()); + Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO()); - Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO()); + Assert.assertEquals(ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultCreateBindingsDir(), conf.isCreateBindingsDir()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java index 9ca2ae3281..b0c8dc061f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalCompactTest.java @@ -18,10 +18,10 @@ package org.apache.activemq.artemis.tests.integration.journal; import java.io.File; -import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.apache.activemq.artemis.ArtemisConstants; import org.apache.activemq.artemis.core.io.SequentialFileFactory; import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; +import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.BeforeClass; public class AIOJournalCompactTest extends NIOJournalCompactTest { @@ -39,6 +39,6 @@ public class AIOJournalCompactTest extends NIOJournalCompactTest { file.mkdir(); - return new AIOSequentialFileFactory(getTestDirfile(), JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, 100000, 10, false); + return new AIOSequentialFileFactory(getTestDirfile(), ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, 100000, 10, false); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalImplTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalImplTest.java index 7c36cfeb77..a220ab659b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalImplTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalImplTest.java @@ -18,9 +18,9 @@ package org.apache.activemq.artemis.tests.integration.journal; import java.io.File; +import org.apache.activemq.artemis.ArtemisConstants; import org.apache.activemq.artemis.core.io.SequentialFileFactory; import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; import org.apache.activemq.artemis.jlibaio.LibaioContext; import org.apache.activemq.artemis.tests.unit.core.journal.impl.JournalImplTestUnit; import org.junit.Assert; @@ -59,7 +59,7 @@ public class AIOJournalImplTest extends JournalImplTestUnit { file.mkdir(); - return new AIOSequentialFileFactory(getTestDirfile(), JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, 1000000, 10, false); + return new AIOSequentialFileFactory(getTestDirfile(), ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, 1000000, 10, false); } @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java index 1872f5eb51..cc49dc6c78 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/ValidateTransactionHealthTest.java @@ -21,17 +21,17 @@ import java.nio.ByteBuffer; import java.util.List; import java.util.concurrent.atomic.AtomicLong; -import org.apache.activemq.artemis.jlibaio.LibaioContext; -import org.apache.activemq.artemis.tests.util.SpawnedVMSupport; -import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.apache.activemq.artemis.ArtemisConstants; +import org.apache.activemq.artemis.core.io.SequentialFileFactory; +import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory; +import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory; import org.apache.activemq.artemis.core.journal.LoaderCallback; import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo; import org.apache.activemq.artemis.core.journal.RecordInfo; -import org.apache.activemq.artemis.core.io.SequentialFileFactory; -import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; import org.apache.activemq.artemis.core.journal.impl.JournalImpl; -import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory; +import org.apache.activemq.artemis.jlibaio.LibaioContext; +import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; +import org.apache.activemq.artemis.tests.util.SpawnedVMSupport; import org.junit.Assert; import org.junit.Test; @@ -314,7 +314,7 @@ public class ValidateTransactionHealthTest extends ActiveMQTestBase { public static SequentialFileFactory getFactory(final String factoryType, final String directory) { if (factoryType.equals("aio")) { - return new AIOSequentialFileFactory(new File(directory), JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, 10, false); + return new AIOSequentialFileFactory(new File(directory), ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, 10, false); } else if (factoryType.equals("nio2")) { return new NIOSequentialFileFactory(new File(directory), true, 1); diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AIOAllPossibilitiesCompactStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AIOAllPossibilitiesCompactStressTest.java index 3d584fdbb1..b2604368aa 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AIOAllPossibilitiesCompactStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AIOAllPossibilitiesCompactStressTest.java @@ -18,9 +18,9 @@ package org.apache.activemq.artemis.tests.stress.journal; import java.io.File; +import org.apache.activemq.artemis.ArtemisConstants; import org.apache.activemq.artemis.core.io.SequentialFileFactory; import org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory; -import org.apache.activemq.artemis.core.journal.impl.JournalConstants; public class AIOAllPossibilitiesCompactStressTest extends AllPossibilitiesCompactStressTest { @@ -49,7 +49,7 @@ public class AIOAllPossibilitiesCompactStressTest extends AllPossibilitiesCompac file.mkdir(); - return new AIOSequentialFileFactory(getTestDirfile(), JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, 1000000, 1000, false); + return new AIOSequentialFileFactory(getTestDirfile(), ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, 1000000, 1000, false); } }