From 68c7c2575d0a4f9d701d0880b819c6f54e0963af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi> Date: Thu, 28 Jul 2016 18:16:58 +0300 Subject: [PATCH] Remove dead code --- .../activemq/artemis/rest/util/TimeoutTask.java | 1 - .../artemis/tests/util/ColocatedActiveMQServer.java | 1 - .../artemis/jms/example/ClusteredTopicExample.java | 12 ------------ .../broker/partition/SpringPartitionBrokerTest.java | 1 - .../artemis/tests/extras/byteman/GroupingTest.java | 2 -- .../integration/client/WildCardRoutingTest.java | 1 - .../jms/ActiveMQConnectionFactoryTest.java | 5 ----- .../tests/integration/openwire/OpenWireTestBase.java | 1 - .../tests/integration/persistence/RestartSMTest.java | 7 ------- .../tests/integration/ra/ActiveMQClusteredTest.java | 3 --- .../tests/integration/ra/ResourceAdapterTest.java | 2 -- .../artemis/tests/performance/sends/PreACKPerf.java | 2 -- 12 files changed, 38 deletions(-) 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<String> 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/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..2d8e2de986 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 @@ -39,10 +39,6 @@ public class ClusteredTopicExample { Connection connection1 = null; - InitialContext ic0 = null; - - InitialContext ic1 = null; - try { // Step 1. Instantiate topic @@ -116,14 +112,6 @@ public class ClusteredTopicExample { if (connection1 != null) { connection1.close(); } - - if (ic0 != null) { - ic0.close(); - } - - if (ic1 != null) { - ic1.close(); - } } } } 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/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/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/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<String> 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<GroupingInfo>()); - Map<Long, Queue> 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); }