diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JsonUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JsonUtil.java index c9b17ad34d..0e116b18e7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JsonUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JsonUtil.java @@ -340,6 +340,7 @@ public final class JsonUtil { return getString(); } + @Override public String toString() { if (this.value == null) { return null; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java index b0998b8a6c..9ee120fa26 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java @@ -374,7 +374,7 @@ public class ClientProducerImpl implements ClientProducerInternal { for (long pos = 0; pos < bodySize; ) { final boolean lastChunk; - final int chunkLength = (int) Math.min((bodySize - pos), (long) minLargeMessageSize); + final int chunkLength = (int) Math.min((bodySize - pos), minLargeMessageSize); final ActiveMQBuffer bodyBuffer = ActiveMQBuffers.fixedBuffer(chunkLength); diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java index 4a2c9914d2..0ce65db697 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java @@ -254,7 +254,7 @@ public class JDBCSequentialFileFactoryDriver extends AbstractJDBCDriver { if (rs.next()) { Blob blob = rs.getBlob(1); readLength = (int) calculateReadLength(blob.length(), bytes.remaining(), file.position()); - byte[] data = blob.getBytes(file.position() + 1, (int) readLength); + byte[] data = blob.getBytes(file.position() + 1, readLength); bytes.put(data); } connection.commit(); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedFile.java index 72221f4706..6dca716cef 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedFile.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedFile.java @@ -146,7 +146,7 @@ final class MappedFile implements AutoCloseable { * then the position is updated with the number of bytes actually read. */ public int read(ByteBuf dst, int dstStart, int dstLength) throws IOException { - final int remaining = (int) Math.min(this.length - this.position, (long) Integer.MAX_VALUE); + final int remaining = (int) Math.min(this.length - this.position, Integer.MAX_VALUE); final int read = Math.min(remaining, dstLength); final int bufferPosition = checkOffset(position, read); final long srcAddress = PlatformDependent.directBufferAddress(lastMapped) + bufferPosition; @@ -172,7 +172,7 @@ final class MappedFile implements AutoCloseable { * then the position is updated with the number of bytes actually read. */ public int read(ByteBuffer dst, int dstStart, int dstLength) throws IOException { - final int remaining = (int) Math.min(this.length - this.position, (long) Integer.MAX_VALUE); + final int remaining = (int) Math.min(this.length - this.position, Integer.MAX_VALUE); final int read = Math.min(remaining, dstLength); final int bufferPosition = checkOffset(position, read); final long srcAddress = PlatformDependent.directBufferAddress(lastMapped) + bufferPosition; diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java index ba87669fe8..381a47c89a 100644 --- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java +++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/TimeoutTask.java @@ -153,7 +153,6 @@ public class TimeoutTask implements Runnable { // Finally, freely shutdown all expired consumers. if (expiredCallbacks.size() > 0) { - long startTime = System.currentTimeMillis(); List tokens = new ArrayList<>(expiredCallbacks.size()); for (String token : expiredCallbacks.keySet()) { tokens.add(token); diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ColocatedActiveMQServer.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ColocatedActiveMQServer.java index d76a72c9ab..806e0f26d5 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ColocatedActiveMQServer.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ColocatedActiveMQServer.java @@ -68,7 +68,6 @@ public class ColocatedActiveMQServer extends ActiveMQServerImpl { @Override protected NodeManager createNodeManager(final File directory, boolean replicatingBackup) { if (replicatingBackup) { - NodeManager manager; if (getConfiguration().getJournalType() == JournalType.ASYNCIO && LibaioContext.isLoaded()) { return new AIOFileLockNodeManager(directory, replicatingBackup, getConfiguration().getJournalLockAcquisitionTimeout()); } diff --git a/docs/hacking-guide/en/building.md b/docs/hacking-guide/en/building.md index 1b883a706d..9501343c64 100644 --- a/docs/hacking-guide/en/building.md +++ b/docs/hacking-guide/en/building.md @@ -11,7 +11,7 @@ still unsolved. This is specially true for the ['site' plugin](https://maven.apa #### Upgrading the `gitbook` version and regenerating the `npm-shrinkwrap.json` file The full release uses `gitbook` to build a static website from the documentation. This is automatically installed using -an `NPM` plugin and is controled via a package.json file. +an `NPM` plugin and is controlled via a package.json file. Install `NPM` using the instructions below diff --git a/docs/user-manual/en/persistence.md b/docs/user-manual/en/persistence.md index f14fda89d1..cee06f4473 100644 --- a/docs/user-manual/en/persistence.md +++ b/docs/user-manual/en/persistence.md @@ -367,7 +367,7 @@ application state) using a database. N.B. Address full policy Paging (See: [The supported with the JDBC persistence layer. Using the ActiveMQ Artemis File Journal is the recommended configuration as it offers higher levels of performance and is -more mature. The JDBC persistence layer is targetted to those users who must use a database e.g. due to internal company +more mature. The JDBC persistence layer is targeted to those users who must use a database e.g. due to internal company policy. ActiveMQ Artemis currently has support for a limited number of database vendors (older versions may work but mileage may diff --git a/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java b/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java index f3ce9a05d4..10592c9652 100644 --- a/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java +++ b/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java @@ -23,7 +23,6 @@ import javax.jms.MessageProducer; import javax.jms.Session; import javax.jms.TextMessage; import javax.jms.Topic; -import javax.naming.InitialContext; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; @@ -39,10 +38,6 @@ public class ClusteredTopicExample { Connection connection1 = null; - InitialContext ic0 = null; - - InitialContext ic1 = null; - try { // Step 1. Instantiate topic @@ -116,14 +111,6 @@ public class ClusteredTopicExample { if (connection1 != null) { connection1.close(); } - - if (ic0 != null) { - ic0.close(); - } - - if (ic1 != null) { - ic1.close(); - } } } } diff --git a/pom.xml b/pom.xml index 4456c657bc..1ca7414d8c 100644 --- a/pom.xml +++ b/pom.xml @@ -1241,9 +1241,10 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.16 + 2.17 ${activemq.basedir}/etc/checkstyle.xml + ${activemq.basedir}/etc/checkstyle-suppressions.xml false diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java index e06001ae00..a81f9aa1b3 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java @@ -31,7 +31,6 @@ import org.apache.activemq.TransportLoggerSupport; import org.apache.activemq.artemiswrapper.ArtemisBrokerHelper; import org.apache.activemq.broker.BrokerRegistry; import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.artemiswrapper.ArtemisBrokerWrapper; import org.apache.activemq.openwire.OpenWireFormat; import org.apache.activemq.transport.*; import org.apache.activemq.util.IOExceptionSupport; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java index 5bc647ec1c..4142f93a02 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java @@ -26,7 +26,6 @@ import javax.jms.Session; import junit.framework.TestCase; -import org.apache.activemq.artemiswrapper.ArtemisBrokerHelper; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.transport.tcp.TcpTransportFactory; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTransactionTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTransactionTestSupport.java index 0ced1cd482..0171bfa9e9 100755 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTransactionTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTransactionTestSupport.java @@ -36,7 +36,6 @@ import org.apache.activemq.broker.BrokerFactory; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.test.JmsResourceProvider; import org.apache.activemq.test.TestSupport; -import org.apache.activemq.transport.tcp.TcpTransportFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java index 4ae2feb237..8d7da366d5 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java @@ -26,7 +26,6 @@ import javax.jms.Session; import junit.framework.TestCase; -import org.apache.activemq.artemiswrapper.ArtemisBrokerHelper; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.transport.tcp.TcpTransportFactory; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/TransactionContextTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/TransactionContextTest.java index d2e917d37f..a0bcced65e 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/TransactionContextTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/TransactionContextTest.java @@ -23,14 +23,10 @@ import java.util.concurrent.atomic.AtomicInteger; import javax.jms.TransactionRolledBackException; -import org.apache.activemq.artemiswrapper.ArtemisBrokerHelper; -import org.apache.activemq.broker.BrokerService; import org.apache.activemq.transaction.Synchronization; import org.apache.activemq.transport.tcp.TcpTransportFactory; import org.junit.After; -import org.junit.AfterClass; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; public class TransactionContextTest { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/partition/SpringPartitionBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/partition/SpringPartitionBrokerTest.java index c82cb1ba65..382db21b7c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/partition/SpringPartitionBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/partition/SpringPartitionBrokerTest.java @@ -35,7 +35,6 @@ public class SpringPartitionBrokerTest extends TestCase { Partitioning config = plugin.getConfig(); assertEquals(2, config.getBrokers().size()); - Object o; String json = "{\n" + " \"by_client_id\":{\n" + " \"client1\":{\"ids\":[\"broker1\"]},\n" + diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/region/QueueDuplicatesFromStoreTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/region/QueueDuplicatesFromStoreTest.java index 9729793286..47c0e09d90 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/region/QueueDuplicatesFromStoreTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/region/QueueDuplicatesFromStoreTest.java @@ -169,7 +169,7 @@ public class QueueDuplicatesFromStoreTest extends TestCase { @Override public void destroy() { - }; + } @Override public void gc() { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/jmx/OpenTypeSupportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/jmx/OpenTypeSupportTest.java index 63d1b7102a..1f71e14e24 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/jmx/OpenTypeSupportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/jmx/OpenTypeSupportTest.java @@ -104,9 +104,7 @@ public class OpenTypeSupportTest { private String extractText(CompositeData message) { Byte content[] = (Byte[]) message.get(CompositeDataConstants.BODY_PREVIEW); byte out[] = new byte[content.length]; - for (int i = 0; i < content.length; i++) { - out[i] = content[i]; - } + System.arraycopy(content, 0, out, 0, content.length); return new String(out); } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java index 73cecb885d..2ae7bc7663 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java @@ -24,7 +24,6 @@ import java.net.URI; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import javax.jms.BytesMessage; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/SoWriteTimeoutTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/SoWriteTimeoutTest.java index 0c0ab301d3..bf7bb25759 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/SoWriteTimeoutTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/SoWriteTimeoutTest.java @@ -31,7 +31,6 @@ import junit.framework.Test; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.JmsTestSupport; -import org.apache.activemq.artemis.core.protocol.stomp.StompProtocolManagerFactory; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java index 08d456cdb0..3765bb3dc7 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ConnectionHangOnStartupTest.java @@ -27,7 +27,6 @@ import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl; import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest; import org.junit.After; -import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java index 0875a61b85..4fc5c42299 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java @@ -22,8 +22,6 @@ import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; import javax.jms.Session; -import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.artemis.api.jms.management.JMSServerControl; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java index f51885b049..95e90219e3 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java @@ -20,7 +20,6 @@ import static org.junit.Assert.assertTrue; import java.util.Vector; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -41,7 +40,6 @@ import org.apache.activemq.ActiveMQMessageTransformation; import org.apache.activemq.ActiveMQSession; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection; -import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext; import org.apache.activemq.artemis.core.server.impl.QueueImpl; import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java index 2e40459a5b..89ba1d7091 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java @@ -17,7 +17,6 @@ package org.apache.activemq.transport.failover; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -34,7 +33,6 @@ import javax.jms.TextMessage; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection; -import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext; import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest; import org.apache.activemq.util.Wait; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java index 92ddd5b477..a262033e20 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java @@ -25,14 +25,12 @@ import javax.jms.Session; import javax.jms.TextMessage; import java.util.Vector; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.activemq.ActiveMQConnection; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection; -import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext; import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest; import org.jboss.byteman.contrib.bmunit.BMRule; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRedeliveryTransactionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRedeliveryTransactionTest.java index 3be2593ad6..06f15c8f6c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRedeliveryTransactionTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRedeliveryTransactionTest.java @@ -18,7 +18,6 @@ package org.apache.activemq.transport.failover; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; -import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.region.policy.PolicyEntry; import org.apache.activemq.broker.region.policy.PolicyMap; import org.junit.Test; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverUpdateURIsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverUpdateURIsTest.java index ef0614f889..b7863e1a71 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverUpdateURIsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverUpdateURIsTest.java @@ -29,16 +29,11 @@ import javax.jms.MessageProducer; import javax.jms.Queue; import javax.jms.Session; -import junit.framework.TestCase; - import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl; import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; -import org.apache.activemq.broker.BrokerService; -import org.apache.activemq.broker.TransportConnector; import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest; -import org.apache.activemq.network.NetworkConnector; import org.apache.log4j.Logger; import org.junit.After; import org.junit.Assert; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/InitalReconnectDelayTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/InitalReconnectDelayTest.java index 763a020e5c..44c2010e84 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/InitalReconnectDelayTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/InitalReconnectDelayTest.java @@ -76,7 +76,7 @@ public class InitalReconnectDelayTest extends OpenwireArtemisBaseTest { producer.send(session.createTextMessage("TEST")); end = (new Date()).getTime(); - //Inital reconnection should kick in and be darned close to what we expected + //Initial reconnection should kick in and be darned close to what we expected LOG.info("Failover took " + (end - start) + " ms."); assertTrue("Failover took " + (end - start) + " ms and should be > 14000.", (end - start) > 14000); connection.close(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java index a372b79bba..a9ebe9630a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java @@ -23,12 +23,8 @@ import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; -import junit.framework.TestCase; - import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; -import org.apache.activemq.broker.BrokerFactory; -import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest; import org.apache.activemq.util.MessageIdList; import org.junit.After; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java index 38ada79433..49a67c8e3c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java @@ -217,7 +217,7 @@ public class FanoutTransportBrokerTest extends OpenwireArtemisBaseTest { // The MockTransport is on the remote connection. // Slip in a new transport filter after the MockTransport - MockTransport mt = (MockTransport) connection3.getTransport().narrow(MockTransport.class); + MockTransport mt = connection3.getTransport().narrow(MockTransport.class); mt.install(new TransportFilter(mt.getNext()) { @Override public void oneway(Object command) throws IOException { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java index 72dcd01138..a5f53daf9a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java @@ -21,7 +21,6 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import org.apache.activemq.EmbeddedBrokerTestSupport; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpAbstractResource.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpAbstractResource.java index b99c56b79f..20bedcc1a2 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpAbstractResource.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpAbstractResource.java @@ -293,7 +293,7 @@ public abstract class AmqpAbstractResource implements AmqpRe } /** - * When aborting the open operation, and there isnt an error condition, + * When aborting the open operation, and there isn't an error condition, * provided by the peer, the returned exception will be used instead. * A subclass may override this method to provide alternative behaviour. */ diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpUnknownFilterType.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpUnknownFilterType.java index 8a4ce6b7f7..4dacbde63d 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpUnknownFilterType.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpUnknownFilterType.java @@ -25,10 +25,10 @@ import org.apache.qpid.proton.amqp.UnsignedLong; */ public class AmqpUnknownFilterType implements DescribedType { - public static final AmqpUnknownFilterType UNKOWN_FILTER = new AmqpUnknownFilterType(); + public static final AmqpUnknownFilterType UNKNOWN_FILTER = new AmqpUnknownFilterType(); public static final UnsignedLong UNKNOWN_FILTER_CODE = UnsignedLong.valueOf(0x0000468C00000099L); - public static final Symbol UNKNOWN_FILTER_NAME = Symbol.valueOf("apache.org:unkown-filter:string"); + public static final Symbol UNKNOWN_FILTER_NAME = Symbol.valueOf("apache.org:unknown-filter:string"); public static final Object[] UNKNOWN_FILTER_IDS = new Object[]{UNKNOWN_FILTER_CODE, UNKNOWN_FILTER_NAME}; private final String payload; diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FailureXATest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FailureXATest.java index e279309454..63ca340af7 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FailureXATest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/FailureXATest.java @@ -88,7 +88,7 @@ public class FailureXATest extends ActiveMQTestBase { private void doTestCrashServerAfterXACommit(boolean onePhase) throws Exception { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(); - XAConnection connection = (XAConnection) connectionFactory.createXAConnection(); + XAConnection connection = connectionFactory.createXAConnection(); try { Session session = connection.createSession(true, Session.SESSION_TRANSACTED); diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/GroupingTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/GroupingTest.java index d7d418122a..6cc2e855ee 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/GroupingTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/GroupingTest.java @@ -91,8 +91,6 @@ public class GroupingTest extends JMSTestBase { connection.start(); connection2.start(); - final String jmsxgroupID = null; - Thread t = new Thread(new Runnable() { @Override public void run() { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/jms/SendingAndReceivingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/jms/SendingAndReceivingTest.java index e0b18998db..d2982671be 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/jms/SendingAndReceivingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/jms/SendingAndReceivingTest.java @@ -89,7 +89,7 @@ public class SendingAndReceivingTest extends ActiveMQTestBase { private static String createMessage(int messageSize) { final String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Random rnd = new Random(); - StringBuilder sb = new StringBuilder((int) messageSize); + StringBuilder sb = new StringBuilder(messageSize); for (int j = 0; j < messageSize; j++ ) { sb.append(AB.charAt(rnd.nextInt(AB.length()))); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/WildCardRoutingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/WildCardRoutingTest.java index 64968dd5e4..6a3619b510 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/WildCardRoutingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/WildCardRoutingTest.java @@ -484,7 +484,6 @@ public class WildCardRoutingTest extends ActiveMQTestBase { public void testWildcardRoutingWithHashMultiLengthAddresses() throws Exception { SimpleString addressAB = new SimpleString("a.b.c.f"); SimpleString addressAC = new SimpleString("a.c.f"); - SimpleString addressAD = new SimpleString("a.d"); SimpleString address = new SimpleString("a.#.f"); SimpleString queueName1 = new SimpleString("Q1"); SimpleString queueName2 = new SimpleString("Q2"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java index 671555423f..405acde9f7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java @@ -32,8 +32,6 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import static org.junit.Assert.assertEquals; - public class JDBCJournalTest extends ActiveMQTestBase { @Rule diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java index 4df9c8903a..9e8bc8fae2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java @@ -215,9 +215,6 @@ public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase { private void testSettersThrowException(final ActiveMQConnectionFactory cf) { - String discoveryAddress = RandomUtil.randomString(); - int discoveryPort = RandomUtil.randomPositiveInt(); - long discoveryRefreshTimeout = RandomUtil.randomPositiveLong(); String clientID = RandomUtil.randomString(); long clientFailureCheckPeriod = RandomUtil.randomPositiveLong(); long connectionTTL = RandomUtil.randomPositiveLong(); @@ -235,14 +232,12 @@ public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase { String loadBalancingPolicyClassName = RandomUtil.randomString(); int dupsOKBatchSize = RandomUtil.randomPositiveInt(); int transactionBatchSize = RandomUtil.randomPositiveInt(); - long initialWaitTimeout = RandomUtil.randomPositiveLong(); boolean useGlobalPools = RandomUtil.randomBoolean(); int scheduledThreadPoolMaxSize = RandomUtil.randomPositiveInt(); int threadPoolMaxSize = RandomUtil.randomPositiveInt(); long retryInterval = RandomUtil.randomPositiveLong(); double retryIntervalMultiplier = RandomUtil.randomDouble(); int reconnectAttempts = RandomUtil.randomPositiveInt(); - boolean failoverOnServerShutdown = RandomUtil.randomBoolean(); try { cf.setClientID(clientID); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java index 73c86950b1..8cafc070eb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireTestBase.java @@ -133,7 +133,6 @@ public class OpenWireTestBase extends ActiveMQTestBase { final double retryIntervalMultiplier = 1.0; final int reconnectAttempts = -1; final int callTimeout = 30000; - final boolean ha = false; List connectorNames = registerConnectors(server, connectorConfigs); String cfName = name.getMethodName(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RestartSMTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RestartSMTest.java index a60e05fa3e..15e96b2279 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RestartSMTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RestartSMTest.java @@ -20,7 +20,6 @@ import org.apache.activemq.artemis.core.persistence.GroupingInfo; import org.apache.activemq.artemis.core.persistence.QueueBindingInfo; import org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager; import org.apache.activemq.artemis.core.postoffice.PostOffice; -import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger; import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakeJournalLoader; import org.apache.activemq.artemis.tests.unit.core.server.impl.fakes.FakePostOffice; @@ -31,9 +30,7 @@ import org.junit.Test; import java.io.File; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.concurrent.ExecutorService; public class RestartSMTest extends ActiveMQTestBase { @@ -78,8 +75,6 @@ public class RestartSMTest extends ActiveMQTestBase { journal.loadBindingJournal(queueBindingInfos, new ArrayList()); - Map queues = new HashMap<>(); - journal.loadMessageJournal(postOffice, null, null, null, null, null, null, new FakeJournalLoader()); journal.stop(); @@ -88,8 +83,6 @@ public class RestartSMTest extends ActiveMQTestBase { journal.start(); - queues = new HashMap<>(); - journal.loadMessageJournal(postOffice, null, null, null, null, null, null, new FakeJournalLoader()); queueBindingInfos = new ArrayList<>(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQClusteredTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQClusteredTest.java index b8fdfe0765..676c8ade30 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQClusteredTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQClusteredTest.java @@ -142,9 +142,6 @@ public class ActiveMQClusteredTest extends ActiveMQRAClusteredTestBase { managedConnections.add(mc); ActiveMQConnectionFactory cf1 = mc.getConnectionFactory(); - long timeout = 10000; - long now = System.currentTimeMillis(); - while (!((ServerLocatorImpl)cf1.getServerLocator()).isReceivedTopology()) { Thread.sleep(50); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java index aea899cf79..7bc678a240 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java @@ -133,7 +133,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase { String testBalancer = "testBalancer"; String testParams = "key=val"; String testaddress = "testaddress"; - String loadbalancer = "loadbalancer"; String testpass = "testpass"; String testuser = "testuser"; ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter(); @@ -153,7 +152,6 @@ public class ResourceAdapterTest extends ActiveMQRATestBase { String testBalancer = "testBalancer2"; String testParams = "key=val2"; String testaddress = "testaddress2"; - String loadbalancer = "loadbalancer2"; String testpass = "testpass2"; String testuser = "testuser2"; ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter(); diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/PreACKPerf.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/PreACKPerf.java index acb5354c8c..9a389ef337 100644 --- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/PreACKPerf.java +++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/PreACKPerf.java @@ -60,8 +60,6 @@ public class PreACKPerf extends AbstractSendReceivePerfTest { } - long end = System.currentTimeMillis(); - printMsgsSec(start, nmessages); }