http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java index 3054321..9e53c01 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java @@ -197,7 +197,7 @@ public class FailoverTest extends FailoverTestBase { final ClientConsumer consumer = session.createConsumer(FailoverTestBase.ADDRESS); session.start(); - final Map<Integer, ClientMessage> received = new HashMap<Integer, ClientMessage>(); + final Map<Integer, ClientMessage> received = new HashMap<>(); consumer.setMessageHandler(new MessageHandler() { @@ -260,7 +260,7 @@ public class FailoverTest extends FailoverTestBase { final ClientConsumer consumer = session.createConsumer(FailoverTestBase.ADDRESS); session.start(); - final Map<Integer, ClientMessage> received = new HashMap<Integer, ClientMessage>(); + final Map<Integer, ClientMessage> received = new HashMap<>(); Thread t = new Thread() { @Override @@ -1427,12 +1427,12 @@ public class FailoverTest extends FailoverTestBase { final int numConsumersPerSession = 5; - Map<ClientSession, List<ClientConsumer>> sessionConsumerMap = new HashMap<ClientSession, List<ClientConsumer>>(); + Map<ClientSession, List<ClientConsumer>> sessionConsumerMap = new HashMap<>(); for (int i = 0; i < numSessions; i++) { ClientSession session = createSession(sf, true, true); - List<ClientConsumer> consumers = new ArrayList<ClientConsumer>(); + List<ClientConsumer> consumers = new ArrayList<>(); for (int j = 0; j < numConsumersPerSession; j++) { SimpleString queueName = new SimpleString("queue" + i + "-" + j);
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java index bb711ab..67123df 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java @@ -296,8 +296,8 @@ public abstract class FailoverTestBase extends ActiveMQTestBase { public static final class LatchClusterTopologyListener implements ClusterTopologyListener { final CountDownLatch latch; - List<String> liveNode = new ArrayList<String>(); - List<String> backupNode = new ArrayList<String>(); + List<String> liveNode = new ArrayList<>(); + List<String> backupNode = new ArrayList<>(); public LatchClusterTopologyListener(CountDownLatch latch) { this.latch = latch; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java index a6ab97b..edc8b11 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java @@ -39,7 +39,7 @@ import java.util.Map; */ public class MultipleLivesMultipleBackupsFailoverTest extends MultipleBackupsFailoverTestBase { - protected Map<Integer, TestableServer> servers = new HashMap<Integer, TestableServer>(); + protected Map<Integer, TestableServer> servers = new HashMap<>(); private ServerLocator locator2; private ServerLocator locator; private final boolean sharedStore = true; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java index 156400b..3926172 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java @@ -48,13 +48,13 @@ public abstract class MultipleServerFailoverTestBase extends ActiveMQTestBase { // Attributes ---------------------------------------------------- - protected List<TestableServer> liveServers = new ArrayList<TestableServer>(); + protected List<TestableServer> liveServers = new ArrayList<>(); - protected List<TestableServer> backupServers = new ArrayList<TestableServer>(); + protected List<TestableServer> backupServers = new ArrayList<>(); - protected List<Configuration> backupConfigs = new ArrayList<Configuration>(); + protected List<Configuration> backupConfigs = new ArrayList<>(); - protected List<Configuration> liveConfigs = new ArrayList<Configuration>(); + protected List<Configuration> liveConfigs = new ArrayList<>(); protected List<NodeManager> nodeManagers; @@ -72,10 +72,10 @@ public abstract class MultipleServerFailoverTestBase extends ActiveMQTestBase { @Before public void setUp() throws Exception { super.setUp(); - liveServers = new ArrayList<TestableServer>(); - backupServers = new ArrayList<TestableServer>(); - backupConfigs = new ArrayList<Configuration>(); - liveConfigs = new ArrayList<Configuration>(); + liveServers = new ArrayList<>(); + backupServers = new ArrayList<>(); + backupConfigs = new ArrayList<>(); + liveConfigs = new ArrayList<>(); for (int i = 0; i < getLiveServerCount(); i++) { HAPolicyConfiguration haPolicyConfiguration = null; @@ -104,7 +104,7 @@ public abstract class MultipleServerFailoverTestBase extends ActiveMQTestBase { TransportConfiguration livetc = getConnectorTransportConfiguration(true, i); configuration.addConnectorConfiguration(livetc.getName(), livetc); - List<String> connectors = new ArrayList<String>(); + List<String> connectors = new ArrayList<>(); for (int j = 0; j < getLiveServerCount(); j++) { if (j != i) { TransportConfiguration staticTc = getConnectorTransportConfiguration(true, j); @@ -149,7 +149,7 @@ public abstract class MultipleServerFailoverTestBase extends ActiveMQTestBase { TransportConfiguration backuptc = getConnectorTransportConfiguration(false, i); configuration.addConnectorConfiguration(backuptc.getName(), backuptc); - List<String> connectors = new ArrayList<String>(); + List<String> connectors = new ArrayList<>(); for (int j = 0; j < getBackupServerCount(); j++) { TransportConfiguration staticTc = getConnectorTransportConfiguration(true, j); configuration.addConnectorConfiguration(staticTc.getName(), staticTc); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java index 775a7d9..2c1ccfd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java @@ -46,7 +46,7 @@ public class NettyFailoverTest extends FailoverTest { @Test public void testFailoverWithHostAlias() throws Exception { - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.HOST_PROP_NAME, "127.0.0.1"); TransportConfiguration tc = createTransportConfiguration(true, false, params); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverTest.java index cdba3f7..955e34c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverTest.java @@ -102,7 +102,7 @@ public class QuorumFailOverTest extends StaticClusterWithBackupFailoverTest { private static class TopologyListener implements ClusterTopologyListener { final String prefix; - final Map<String, Pair<TransportConfiguration, TransportConfiguration>> nodes = new ConcurrentHashMap<String, Pair<TransportConfiguration, TransportConfiguration>>(); + final Map<String, Pair<TransportConfiguration, TransportConfiguration>> nodes = new ConcurrentHashMap<>(); public TopologyListener(String string) { prefix = string; @@ -110,7 +110,7 @@ public class QuorumFailOverTest extends StaticClusterWithBackupFailoverTest { @Override public void nodeUP(TopologyMember topologyMember, boolean last) { - Pair<TransportConfiguration, TransportConfiguration> connectorPair = new Pair<TransportConfiguration, TransportConfiguration>(topologyMember.getLive(), topologyMember.getBackup()); + Pair<TransportConfiguration, TransportConfiguration> connectorPair = new Pair<>(topologyMember.getLive(), topologyMember.getBackup()); nodes.put(topologyMember.getBackupGroupName(), connectorPair); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedMultipleServerFailoverExtraBackupsTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedMultipleServerFailoverExtraBackupsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedMultipleServerFailoverExtraBackupsTest.java index 6dfec71..c1f3942 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedMultipleServerFailoverExtraBackupsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedMultipleServerFailoverExtraBackupsTest.java @@ -105,7 +105,7 @@ public class ReplicatedMultipleServerFailoverExtraBackupsTest extends Replicated waitForDistribution(ADDRESS, backupServers.get(0).getServer(), 100); waitForDistribution(ADDRESS, backupServers.get(1).getServer(), 100); - List<TestableServer> toCrash = new ArrayList<TestableServer>(); + List<TestableServer> toCrash = new ArrayList<>(); for (TestableServer backupServer : backupServers) { if (!backupServer.getServer().getHAPolicy().isBackup()) { toCrash.add(backupServer); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java index 2564189..121a650 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java @@ -104,7 +104,7 @@ public class SecurityFailoverTest extends FailoverTest { ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getServer().getSecurityManager(); securityManager.getConfiguration().addUser("a", "b"); Role role = new Role("arole", true, true, true, true, true, true, true); - Set<Role> roles = new HashSet<Role>(); + Set<Role> roles = new HashSet<>(); roles.add(role); server.getServer().getSecurityRepository().addMatch("#", roles); securityManager.getConfiguration().addRole("a", "arole"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java index 066da16..069eb32 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java @@ -39,7 +39,7 @@ import java.util.Map; */ public class SingleLiveMultipleBackupsFailoverTest extends MultipleBackupsFailoverTestBase { - protected Map<Integer, TestableServer> servers = new HashMap<Integer, TestableServer>(); + protected Map<Integer, TestableServer> servers = new HashMap<>(); protected ServerLocatorImpl locator; private NodeManager nodeManager; final boolean sharedStore = true; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java index ce2e7b1..5b04a14 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java @@ -297,8 +297,8 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString(threadNum + "sub" + i); @@ -323,7 +323,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt sendMessages(sessSend, producer, numMessages, threadNum); - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(threadNum, numMessages); @@ -375,8 +375,8 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString(threadNum + "sub" + i); @@ -403,7 +403,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt session.start(); } - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(threadNum, numMessages); @@ -457,8 +457,8 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString(threadNum + "sub" + i); @@ -489,7 +489,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt sessSend.commit(); - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(threadNum, numMessages); @@ -557,8 +557,8 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString(threadNum + " sub" + i); @@ -592,7 +592,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt session.start(); } - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(threadNum, numMessages); @@ -684,8 +684,8 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString(threadNum + "sub" + i); @@ -741,8 +741,8 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString(threadNum + "sub" + i); @@ -800,8 +800,8 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString(threadNum + "sub" + i); @@ -873,8 +873,8 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString(threadNum + "sub" + i); @@ -1159,14 +1159,14 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt final int numMessages, final int threadNum) throws Exception { // We make sure the messages arrive in the order they were sent from a particular producer - Map<ClientConsumer, Map<Integer, Integer>> counts = new HashMap<ClientConsumer, Map<Integer, Integer>>(); + Map<ClientConsumer, Map<Integer, Integer>> counts = new HashMap<>(); for (int i = 0; i < numMessages; i++) { for (ClientConsumer consumer : consumers) { Map<Integer, Integer> consumerCounts = counts.get(consumer); if (consumerCounts == null) { - consumerCounts = new HashMap<Integer, Integer>(); + consumerCounts = new HashMap<>(); counts.put(consumer, consumerCounts); } @@ -1206,7 +1206,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt CountDownLatch latch = new CountDownLatch(1); - private final Map<Integer, Integer> counts = new HashMap<Integer, Integer>(); + private final Map<Integer, Integer> counts = new HashMap<>(); volatile String failure; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java index 3a41924..e36475a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadReattachSupportTestBase.java @@ -117,7 +117,7 @@ public abstract class MultiThreadReattachSupportTestBase extends ActiveMQTestBas } do { - List<Runner> threads = new ArrayList<Runner>(); + List<Runner> threads = new ArrayList<>(); for (int i = 0; i < numThreads; i++) { Runner runner = new Runner(runnable, i); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java index f38b703..f0aac93 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java @@ -73,7 +73,7 @@ public class OrderReattachTest extends ActiveMQTestBase { final ClientSession session = sf.createSession(false, true, true); - final LinkedBlockingDeque<Boolean> failureQueue = new LinkedBlockingDeque<Boolean>(); + final LinkedBlockingDeque<Boolean> failureQueue = new LinkedBlockingDeque<>(); final CountDownLatch ready = new CountDownLatch(1); @@ -158,8 +158,8 @@ public class OrderReattachTest extends ActiveMQTestBase { final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -229,7 +229,7 @@ public class OrderReattachTest extends ActiveMQTestBase { } } - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java index 4332a80..8d1fe32 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java @@ -232,8 +232,8 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -290,7 +290,7 @@ public class RandomReattachTest extends ActiveMQTestBase { } } - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(); @@ -335,8 +335,8 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numSessions = 50; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -388,7 +388,7 @@ public class RandomReattachTest extends ActiveMQTestBase { } } - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(); @@ -435,8 +435,8 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numSessions = 1; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -504,7 +504,7 @@ public class RandomReattachTest extends ActiveMQTestBase { } } - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(); @@ -576,8 +576,8 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -639,7 +639,7 @@ public class RandomReattachTest extends ActiveMQTestBase { } } - Set<MyHandler> handlers = new HashSet<MyHandler>(); + Set<MyHandler> handlers = new HashSet<>(); for (ClientConsumer consumer : consumers) { MyHandler handler = new MyHandler(); @@ -713,8 +713,8 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -789,8 +789,8 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -873,8 +873,8 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -985,8 +985,8 @@ public class RandomReattachTest extends ActiveMQTestBase { final int numSessions = 10; - Set<ClientConsumer> consumers = new HashSet<ClientConsumer>(); - Set<ClientSession> sessions = new HashSet<ClientSession>(); + Set<ClientConsumer> consumers = new HashSet<>(); + Set<ClientSession> sessions = new HashSet<>(); for (int i = 0; i < numSessions; i++) { SimpleString subName = new SimpleString("sub" + i); @@ -1304,7 +1304,7 @@ public class RandomReattachTest extends ActiveMQTestBase { } } - private final ArrayList<AssertionError> errors = new ArrayList<AssertionError>(); + private final ArrayList<AssertionError> errors = new ArrayList<>(); /* (non-Javadoc) * @see MessageHandler#onMessage(ClientMessage) http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java index 85f6d32..e45679a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/IsolatedTopologyTest.java @@ -81,24 +81,24 @@ public class IsolatedTopologyTest extends ActiveMQTestBase { } private ActiveMQServer createServer1() throws Exception { - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.CLUSTER_CONNECTION, "cc1"); params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "1"); TransportConfiguration acceptor1VM1 = new TransportConfiguration(ActiveMQTestBase.INVM_ACCEPTOR_FACTORY, params, "acceptor-cc1"); - params = new HashMap<String, Object>(); + params = new HashMap<>(); params.put(TransportConstants.CLUSTER_CONNECTION, "cc2"); params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "2"); TransportConfiguration acceptor2VM1 = new TransportConfiguration(ActiveMQTestBase.INVM_ACCEPTOR_FACTORY, params, "acceptor-cc2"); - List<String> connectTo = new ArrayList<String>(); + List<String> connectTo = new ArrayList<>(); connectTo.add("other-cc1"); ClusterConnectionConfiguration server1CC1 = new ClusterConnectionConfiguration().setName("cc1").setAddress("jms").setConnectorName("local-cc1").setRetryInterval(250).setConfirmationWindowSize(1024).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setStaticConnectors(connectTo); - ArrayList<String> connectTo2 = new ArrayList<String>(); + ArrayList<String> connectTo2 = new ArrayList<>(); connectTo2.add("other-cc2"); ClusterConnectionConfiguration server1CC2 = new ClusterConnectionConfiguration().setName("cc2").setAddress("jms").setConnectorName("local-cc2").setRetryInterval(250).setConfirmationWindowSize(1024).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setStaticConnectors(connectTo2); @@ -113,24 +113,24 @@ public class IsolatedTopologyTest extends ActiveMQTestBase { private ActiveMQServer createServer2() throws Exception { - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.CLUSTER_CONNECTION, "cc1"); params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "3"); TransportConfiguration acceptor1VM1 = new TransportConfiguration(ActiveMQTestBase.INVM_ACCEPTOR_FACTORY, params, "acceptor-cc1"); - params = new HashMap<String, Object>(); + params = new HashMap<>(); params.put(TransportConstants.CLUSTER_CONNECTION, "cc2"); params.put(org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.SERVER_ID_PROP_NAME, "4"); TransportConfiguration acceptor2VM1 = new TransportConfiguration(ActiveMQTestBase.INVM_ACCEPTOR_FACTORY, params, "acceptor-cc2"); - List<String> connectTo = new ArrayList<String>(); + List<String> connectTo = new ArrayList<>(); connectTo.add("other-cc1"); ClusterConnectionConfiguration server1CC1 = new ClusterConnectionConfiguration().setName("cc1").setAddress("jms").setConnectorName("local-cc1").setRetryInterval(250).setConfirmationWindowSize(1024).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setStaticConnectors(connectTo); - List<String> connectTo2 = new ArrayList<String>(); + List<String> connectTo2 = new ArrayList<>(); connectTo2.add("other-cc2"); ClusterConnectionConfiguration server1CC2 = new ClusterConnectionConfiguration().setName("cc2").setAddress("jms").setConnectorName("local-cc2").setRetryInterval(250).setConfirmationWindowSize(1024).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setStaticConnectors(connectTo2); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java index 4bad259..b6eed8a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java @@ -64,7 +64,7 @@ public class NonHATopologyTest extends ActiveMQTestBase { server.getConfiguration().getAcceptorConfigurations().add(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY)); server.getConfiguration().getConnectorConfigurations().put("netty", new TransportConfiguration(NETTY_CONNECTOR_FACTORY)); - ArrayList<String> list = new ArrayList<String>(); + ArrayList<String> list = new ArrayList<>(); list.add("netty"); Configuration config = server.getConfiguration(); config.getClusterConfigurations().add(new ClusterConnectionConfiguration().setName("tst").setAddress("jms").setConnectorName("netty").setRetryInterval(1000).setConfirmationWindowSize(1000).setMessageLoadBalancingType(MessageLoadBalancingType.ON_DEMAND).setStaticConnectors(list).setAllowDirectConnectionsOnly(true)); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java index 536b0ca..8ca823c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/MultiServerTestBase.java @@ -160,7 +160,7 @@ public class MultiServerTestBase extends ActiveMQTestBase { Configuration configuration = createBasicConfig(node).setJournalMaxIO_AIO(1000).setThreadPoolMaxSize(10).clearAcceptorConfigurations().addAcceptorConfiguration(serverConfigAcceptor).addConnectorConfiguration("thisConnector", thisConnector).setHAPolicyConfiguration(sharedStorage ? new SharedStoreMasterPolicyConfiguration() : new ReplicatedPolicyConfiguration()); - List<String> targetServersOnConnection = new ArrayList<String>(); + List<String> targetServersOnConnection = new ArrayList<>(); for (int targetNode = 0; targetNode < getNumberOfServers(); targetNode++) { if (targetNode == node) { @@ -196,7 +196,7 @@ public class MultiServerTestBase extends ActiveMQTestBase { addServer(server); - return new Pair<ActiveMQServer, NodeManager>(server, nodeManager); + return new Pair<>(server, nodeManager); } protected ActiveMQServer setupBackupServer(final int node, @@ -207,7 +207,7 @@ public class MultiServerTestBase extends ActiveMQTestBase { Configuration configuration = createBasicConfig(useSharedStorage() ? liveNode : node).clearAcceptorConfigurations().addAcceptorConfiguration(serverConfigAcceptor).addConnectorConfiguration("thisConnector", thisConnector).setHAPolicyConfiguration(useSharedStorage() ? new SharedStoreSlavePolicyConfiguration() : new ReplicaPolicyConfiguration()); - List<String> targetServersOnConnection = new ArrayList<String>(); + List<String> targetServersOnConnection = new ArrayList<>(); for (int targetNode = 0; targetNode < getNumberOfServers(); targetNode++) { // if (targetNode == node) http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java index 137d252..44bb31a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java @@ -77,7 +77,7 @@ public class DiscoveryBaseTest extends ActiveMQTestBase { protected TransportConfiguration generateTC(String debug) { String className = "org.foo.bar." + debug + "|" + UUIDGenerator.getInstance().generateStringUUID() + ""; String name = UUIDGenerator.getInstance().generateStringUUID(); - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(UUIDGenerator.getInstance().generateStringUUID(), 123); params.put(UUIDGenerator.getInstance().generateStringUUID(), UUIDGenerator.getInstance().generateStringUUID()); params.put(UUIDGenerator.getInstance().generateStringUUID(), true); @@ -99,7 +99,7 @@ public class DiscoveryBaseTest extends ActiveMQTestBase { List<DiscoveryEntry> actual) { assertNotNull(actual); - List<TransportConfiguration> sortedExpected = new ArrayList<TransportConfiguration>(expected); + List<TransportConfiguration> sortedExpected = new ArrayList<>(expected); Collections.sort(sortedExpected, new Comparator<TransportConfiguration>() { @Override @@ -107,7 +107,7 @@ public class DiscoveryBaseTest extends ActiveMQTestBase { return o2.toString().compareTo(o1.toString()); } }); - List<DiscoveryEntry> sortedActual = new ArrayList<DiscoveryEntry>(actual); + List<DiscoveryEntry> sortedActual = new ArrayList<>(actual); Collections.sort(sortedActual, new Comparator<DiscoveryEntry>() { @Override public int compare(DiscoveryEntry o1, DiscoveryEntry o2) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java index 071389f..119be87 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java @@ -52,7 +52,7 @@ public class CoreClientOverHttpTest extends ActiveMQTestBase { @Before public void setUp() throws Exception { super.setUp(); - HashMap<String, Object> params = new HashMap<String, Object>(); + HashMap<String, Object> params = new HashMap<>(); params.put(TransportConstants.HTTP_ENABLED_PROP_NAME, true); conf = createDefaultInVMConfig().clearAcceptorConfigurations().addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params)); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java ---------------------------------------------------------------------- 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 c4ddd2c..93f03bf 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 @@ -509,9 +509,9 @@ public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase { private void startServer() throws Exception { liveTC = new TransportConfiguration(INVM_CONNECTOR_FACTORY); - Map<String, TransportConfiguration> connectors = new HashMap<String, TransportConfiguration>(); + Map<String, TransportConfiguration> connectors = new HashMap<>(); connectors.put(liveTC.getName(), liveTC); - List<String> connectorNames = new ArrayList<String>(); + List<String> connectorNames = new ArrayList<>(); connectorNames.add(liveTC.getName()); Configuration liveConf = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY)).setConnectorConfigurations(connectors).setHAPolicyConfiguration(new SharedStoreMasterPolicyConfiguration()); @@ -524,7 +524,7 @@ public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase { BroadcastGroupConfiguration bcConfig1 = new BroadcastGroupConfiguration().setName(bcGroupName).setBroadcastPeriod(broadcastPeriod).setConnectorInfos(connectorNames).setEndpointFactory(new UDPBroadcastEndpointFactory().setGroupAddress(groupAddress).setGroupPort(groupPort).setLocalBindPort(localBindPort)); - List<BroadcastGroupConfiguration> bcConfigs1 = new ArrayList<BroadcastGroupConfiguration>(); + List<BroadcastGroupConfiguration> bcConfigs1 = new ArrayList<>(); bcConfigs1.add(bcConfig1); liveConf.setBroadcastGroupConfigurations(bcConfigs1); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java index 36ae11f..9ef5f6d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/FloodServerTest.java @@ -102,7 +102,7 @@ public class FloodServerTest extends ActiveMQTestBase { int reconnectAttempts = -1; long callTimeout = 30000; - List<TransportConfiguration> connectorConfigs = new ArrayList<TransportConfiguration>(); + List<TransportConfiguration> connectorConfigs = new ArrayList<>(); connectorConfigs.add(new TransportConfiguration(NettyConnectorFactory.class.getName())); serverManager.createConnectionFactory("ManualReconnectionToSingleServerTest", false, JMSFactoryType.CF, registerConnectors(server, connectorConfigs), null, 1000, ActiveMQClient.DEFAULT_CONNECTION_TTL, callTimeout, ActiveMQClient.DEFAULT_CALL_FAILOVER_TIMEOUT, ActiveMQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT, ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, ActiveMQClient.DEFAULT_COMPRESS_LARGE_MESSAGES, ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE, ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE, ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE, ActiveMQClient.DEFAULT_PRODUCER_WINDOW_SIZE, ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE, false, false, false, ActiveMQClient.DEFAULT_AUTO_GROUP, false, ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE, ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS, ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE, ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE, retryInterva l, retryIntervalMultiplier, 1000, reconnectAttempts, ActiveMQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION, null, "/cf"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java index a8a44e0..aff6e01 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ManualReconnectionToSingleServerTest.java @@ -149,7 +149,7 @@ public class ManualReconnectionToSingleServerTest extends ActiveMQTestBase { configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl().setName(QUEUE_NAME).setBindings(QUEUE_NAME)); - ArrayList<TransportConfiguration> configs = new ArrayList<TransportConfiguration>(); + ArrayList<TransportConfiguration> configs = new ArrayList<>(); configs.add(new TransportConfiguration(NETTY_CONNECTOR_FACTORY)); ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName("cf").setConnectorNames(registerConnectors(server, configs)).setBindings("/cf").setRetryInterval(1000).setReconnectAttempts(-1); configuration.getConnectionFactoryConfigurations().add(cfConfig); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java index e0e74a4..c4df3f2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java @@ -393,9 +393,9 @@ public class SimpleJNDIClientTest extends ActiveMQTestBase { private void startServer() throws Exception { liveTC = new TransportConfiguration(INVM_CONNECTOR_FACTORY); - Map<String, TransportConfiguration> connectors = new HashMap<String, TransportConfiguration>(); + Map<String, TransportConfiguration> connectors = new HashMap<>(); connectors.put(liveTC.getName(), liveTC); - List<String> connectorNames = new ArrayList<String>(); + List<String> connectorNames = new ArrayList<>(); connectorNames.add(liveTC.getName()); Map params = new HashMap(); @@ -411,7 +411,7 @@ public class SimpleJNDIClientTest extends ActiveMQTestBase { BroadcastGroupConfiguration bcConfig1 = new BroadcastGroupConfiguration().setName(bcGroupName).setBroadcastPeriod(broadcastPeriod).setConnectorInfos(connectorNames).setEndpointFactory(new UDPBroadcastEndpointFactory().setGroupAddress(groupAddress).setGroupPort(groupPort).setLocalBindPort(localBindPort)); - List<BroadcastGroupConfiguration> bcConfigs1 = new ArrayList<BroadcastGroupConfiguration>(); + List<BroadcastGroupConfiguration> bcConfigs1 = new ArrayList<>(); bcConfigs1.add(bcConfig1); liveConf.setBroadcastGroupConfigurations(bcConfigs1); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java index d2a2b81..aad5d53 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReSendMessageTest.java @@ -62,7 +62,7 @@ public class ReSendMessageTest extends JMSTestBase { conn.start(); Session sess = conn.createSession(true, Session.SESSION_TRANSACTED); - ArrayList<Message> msgs = new ArrayList<Message>(); + ArrayList<Message> msgs = new ArrayList<>(); for (int i = 0; i < 10; i++) { BytesMessage bm = sess.createBytesMessage(); @@ -96,7 +96,7 @@ public class ReSendMessageTest extends JMSTestBase { conn.start(); Session sess = conn.createSession(true, Session.SESSION_TRANSACTED); - ArrayList<Message> msgs = new ArrayList<Message>(); + ArrayList<Message> msgs = new ArrayList<>(); for (int i = 0; i < 1; i++) { MapMessage mm = sess.createMapMessage(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java index 515858d..4f664f1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java @@ -59,7 +59,7 @@ public class SessionClosedOnRemotingConnectionFailureTest extends JMSTestBase { @Test public void testSessionClosedOnRemotingConnectionFailure() throws Exception { - List<TransportConfiguration> connectorConfigs = new ArrayList<TransportConfiguration>(); + List<TransportConfiguration> connectorConfigs = new ArrayList<>(); connectorConfigs.add(new TransportConfiguration(INVM_CONNECTOR_FACTORY)); jmsServer.createConnectionFactory("cffoo", false, JMSFactoryType.CF, registerConnectors(server, connectorConfigs), null, ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD, ActiveMQClient.DEFAULT_CONNECTION_TTL, ActiveMQClient.DEFAULT_CALL_TIMEOUT, ActiveMQClient.DEFAULT_CALL_FAILOVER_TIMEOUT, ActiveMQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT, ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, ActiveMQClient.DEFAULT_COMPRESS_LARGE_MESSAGES, ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE, ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE, ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE, ActiveMQClient.DEFAULT_PRODUCER_WINDOW_SIZE, ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE, ActiveMQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE, ActiveMQClient.DEFAULT_BLOCK_ON_DURABLE_SEND, ActiveMQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND, ActiveMQClient.DEFAULT_AUTO_GROUP, ActiveMQClient.DEFAULT_PRE_ACKNOWLEDGE, ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE, Acti veMQClient.DEFAULT_ACK_BATCH_SIZE, ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS, ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE, ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE, ActiveMQClient.DEFAULT_RETRY_INTERVAL, ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER, ActiveMQClient.DEFAULT_MAX_RETRY_INTERVAL, 0, ActiveMQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION, null, "/cffoo"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java index a6b85df..131cb0e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java @@ -47,7 +47,7 @@ public class StoreConfigTest extends JMSTestBase { server.getConfiguration().getConnectorConfigurations().put("np", new TransportConfiguration(INVM_CONNECTOR_FACTORY)); - List<String> transportConfigurations = new ArrayList<String>(); + List<String> transportConfigurations = new ArrayList<>(); transportConfigurations.add("tst"); ConnectionFactoryConfigurationImpl factCFG = (ConnectionFactoryConfigurationImpl) new ConnectionFactoryConfigurationImpl().setName("tst").setConnectorNames(transportConfigurations); @@ -111,7 +111,7 @@ public class StoreConfigTest extends JMSTestBase { server.getConfiguration().getConnectorConfigurations().put("np", new TransportConfiguration(INVM_CONNECTOR_FACTORY)); - List<String> transportConfigurations = new ArrayList<String>(); + List<String> transportConfigurations = new ArrayList<>(); transportConfigurations.add("tst"); ConnectionFactoryConfigurationImpl factCFG = (ConnectionFactoryConfigurationImpl) new ConnectionFactoryConfigurationImpl().setName("tst").setConnectorNames(transportConfigurations); @@ -213,7 +213,7 @@ public class StoreConfigTest extends JMSTestBase { // server.getConfiguration().getConnectorConfigurations().put("np", new TransportConfiguration(INVM_CONNECTOR_FACTORY)); - List<String> transportConfigurations = new ArrayList<String>(); + List<String> transportConfigurations = new ArrayList<>(); transportConfigurations.add("tst"); ConnectionFactoryConfigurationImpl factCFG = (ConnectionFactoryConfigurationImpl) new ConnectionFactoryConfigurationImpl().setName("tst").setConnectorNames(transportConfigurations); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java index d2139e9..dd64621 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java @@ -90,7 +90,7 @@ public class JMSFailoverListenerTest extends ActiveMQTestBase { protected ActiveMQServer backupServer; - protected Map<String, Object> backupParams = new HashMap<String, Object>(); + protected Map<String, Object> backupParams = new HashMap<>(); private TransportConfiguration backuptc; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java index 2c1edb6..e6f9808 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverTest.java @@ -98,7 +98,7 @@ public class JMSFailoverTest extends ActiveMQTestBase { protected ActiveMQServer backupServer; - protected Map<String, Object> backupParams = new HashMap<String, Object>(); + protected Map<String, Object> backupParams = new HashMap<>(); private TransportConfiguration backuptc; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java index 5cc0baa..b6ef8c8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseConnectionOnGCTest.java @@ -61,7 +61,7 @@ public class CloseConnectionOnGCTest extends JMSTestBase { Connection conn = cf.createConnection(); - WeakReference<Connection> wr = new WeakReference<Connection>(conn); + WeakReference<Connection> wr = new WeakReference<>(conn); Assert.assertEquals(1, server.getRemotingService().getConnections().size()); final CountDownLatch latch = new CountDownLatch(1); @@ -87,9 +87,9 @@ public class CloseConnectionOnGCTest extends JMSTestBase { Connection conn2 = cf.createConnection(); Connection conn3 = cf.createConnection(); - WeakReference<Connection> wr1 = new WeakReference<Connection>(conn1); - WeakReference<Connection> wr2 = new WeakReference<Connection>(conn2); - WeakReference<Connection> wr3 = new WeakReference<Connection>(conn3); + WeakReference<Connection> wr1 = new WeakReference<>(conn1); + WeakReference<Connection> wr2 = new WeakReference<>(conn2); + WeakReference<Connection> wr3 = new WeakReference<>(conn3); Assert.assertEquals(3, server.getRemotingService().getConnections().size()); @@ -122,9 +122,9 @@ public class CloseConnectionOnGCTest extends JMSTestBase { Connection conn2 = cf.createConnection(); Connection conn3 = cf.createConnection(); - WeakReference<Connection> wr1 = new WeakReference<Connection>(conn1); - WeakReference<Connection> wr2 = new WeakReference<Connection>(conn2); - WeakReference<Connection> wr3 = new WeakReference<Connection>(conn3); + WeakReference<Connection> wr1 = new WeakReference<>(conn1); + WeakReference<Connection> wr2 = new WeakReference<>(conn2); + WeakReference<Connection> wr3 = new WeakReference<>(conn3); Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE); Session sess2 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java index b800dd0..2098ee6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java @@ -153,7 +153,7 @@ public class ConnectionFactorySerializationTest extends JMSTestBase { private void createDiscoveryFactoryUDP() throws Exception { // Deploy a connection factory with discovery - List<String> bindings = new ArrayList<String>(); + List<String> bindings = new ArrayList<>(); bindings.add("MyConnectionFactory"); final String groupAddress = "1.2.3.4"; final int port = 1234; @@ -170,7 +170,7 @@ public class ConnectionFactorySerializationTest extends JMSTestBase { private void createDiscoveryFactoryJGroupsFile() throws Exception { // Deploy a connection factory with discovery - List<String> bindings = new ArrayList<String>(); + List<String> bindings = new ArrayList<>(); bindings.add("MyConnectionFactory"); JGroupsFileBroadcastEndpointFactory config = new JGroupsFileBroadcastEndpointFactory().setChannelName("myChannel").setFile("/META-INF/myfile.xml"); @@ -184,7 +184,7 @@ public class ConnectionFactorySerializationTest extends JMSTestBase { private void createDiscoveryFactoryJGroupsProperties() throws Exception { // Deploy a connection factory with discovery - List<String> bindings = new ArrayList<String>(); + List<String> bindings = new ArrayList<>(); bindings.add("MyConnectionFactory"); JGroupsPropertiesBroadcastEndpointFactory config = new JGroupsPropertiesBroadcastEndpointFactory().setChannelName("myChannel").setProperties("param=1,param2=2"); @@ -222,7 +222,7 @@ public class ConnectionFactorySerializationTest extends JMSTestBase { jmsServer.getActiveMQServer().getConfiguration().getConnectorConfigurations().put(main2.getName(), main2); - ArrayList<String> connectorNames = new ArrayList<String>(); + ArrayList<String> connectorNames = new ArrayList<>(); connectorNames.add(main.getName()); connectorNames.add(main2.getName()); ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl().setName("MyConnectionFactory").setHA(b).setConnectorNames(connectorNames).setClientID("clientID").setClientFailureCheckPeriod(-1).setConnectionTTL(-2).setFactoryType(JMSFactoryType.CF).setCallTimeout(-3).setCallFailoverTimeout(-4).setCacheLargeMessagesClient(b).setMinLargeMessageSize(-5).setConsumerWindowSize(-6).setConsumerMaxRate(-7).setConfirmationWindowSize(-8).setProducerWindowSize(-9).setProducerMaxRate(-10).setBlockOnAcknowledge(b).setBlockOnDurableSend(b).setBlockOnNonDurableSend(b).setAutoGroup(b).setPreAcknowledge(b).setLoadBalancingPolicyClassName("foobar").setTransactionBatchSize(-11).setDupsOKBatchSize(-12).setUseGlobalPools(b).setScheduledThreadPoolMaxSize(-13).setThreadPoolMaxSize(-14).setRetryInterval(-15).setRetryIntervalMultiplier(-16).setMaxRetryInterval(-17).setReconnectAttempts(-18).setFailoverOnInitialConnection(b).setGroupID("groupID"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java index 46c2d76..d1b4588 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/InvalidConnectorTest.java @@ -34,10 +34,10 @@ public class InvalidConnectorTest extends JMSTestBase { @Test public void testInvalidConnector() throws Exception { - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.HOST_PROP_NAME, "0.0.0.0"); - List<TransportConfiguration> connectorConfigs = new ArrayList<TransportConfiguration>(); + List<TransportConfiguration> connectorConfigs = new ArrayList<>(); connectorConfigs.add(new TransportConfiguration(NETTY_CONNECTOR_FACTORY, params)); int retryInterval = 1000; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java index 5d11e45..debcb03 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java @@ -113,7 +113,7 @@ public class JmsProducerCompletionListenerTest extends JMSTestBase { @Test public void testInvalidCallFromListener() throws InterruptedException { JMSConsumer consumer = context.createConsumer(queue); - List<InvalidCompletionListener> listeners = new ArrayList<InvalidCompletionListener>(); + List<InvalidCompletionListener> listeners = new ArrayList<>(); for (int i = 0; i < 3; i++) { InvalidCompletionListener cl = new InvalidCompletionListener(context, i); listeners.add(cl); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java index f8b3b80..c18b431 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java @@ -54,7 +54,7 @@ public class JMSServerStartStopTest extends ActiveMQTestBase { private Connection conn; private ActiveMQConnectionFactory jbcf; - private final Set<ActiveMQConnectionFactory> connectionFactories = new HashSet<ActiveMQConnectionFactory>(); + private final Set<ActiveMQConnectionFactory> connectionFactories = new HashSet<>(); @Override @Before http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java index bb659c6..03e64e6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/config/JMSConfigurationTest.java @@ -54,7 +54,7 @@ public class JMSConfigurationTest extends ActiveMQTestBase { JMSConfiguration jmsConfiguration = new JMSConfigurationImpl(); TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName()); - List<TransportConfiguration> transportConfigs = new ArrayList<TransportConfiguration>(); + List<TransportConfiguration> transportConfigs = new ArrayList<>(); transportConfigs.add(connectorConfig); ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName(RandomUtil.randomString()).setConnectorNames(registerConnectors(coreServer, transportConfigs)).setBindings("/cf/binding1", "/cf/binding2"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java index 4873c92..7436ce1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/ConnectionFactoryControlTest.java @@ -95,7 +95,7 @@ public class ConnectionFactoryControlTest extends ManagementTestBase { JMSUtil.JMXListener listener = new JMSUtil.JMXListener(); this.mbeanServer.addNotificationListener(ObjectNameBuilder.DEFAULT.getJMSServerObjectName(), listener, null, null); - List<String> connectors = new ArrayList<String>(); + List<String> connectors = new ArrayList<>(); connectors.add("invm"); this.jmsServerManager.createConnectionFactory("NewCF", false, JMSFactoryType.CF, connectors, "/NewConnectionFactory"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java index ac9b28e..6cad5d4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSQueueControlTest.java @@ -1374,7 +1374,7 @@ public class JMSQueueControlTest extends ManagementTestBase { JMSUtil.JMXListener listener = new JMSUtil.JMXListener(); this.mbeanServer.addNotificationListener(ObjectNameBuilder.DEFAULT.getJMSServerObjectName(), listener, null, null); - List<String> connectors = new ArrayList<String>(); + List<String> connectors = new ArrayList<>(); connectors.add("invm"); String testQueueName = "newQueue"; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java index bf06eb6..659d785 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/JMSServerControlTest.java @@ -1027,11 +1027,11 @@ public class JMSServerControlTest extends ManagementTestBase { class FakeJMSStorageManager implements JMSStorageManager { - Map<String, PersistedDestination> destinationMap = new HashMap<String, PersistedDestination>(); + Map<String, PersistedDestination> destinationMap = new HashMap<>(); - Map<String, PersistedConnectionFactory> connectionFactoryMap = new HashMap<String, PersistedConnectionFactory>(); + Map<String, PersistedConnectionFactory> connectionFactoryMap = new HashMap<>(); - ConcurrentHashMap<String, List<String>> persistedJNDIMap = new ConcurrentHashMap<String, List<String>>(); + ConcurrentHashMap<String, List<String>> persistedJNDIMap = new ConcurrentHashMap<>(); JMSStorageManager delegate; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java index f46578e..11d2b43 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/management/TopicControlTest.java @@ -516,7 +516,7 @@ public class TopicControlTest extends ManagementTestBase { JMSUtil.JMXListener listener = new JMSUtil.JMXListener(); this.mbeanServer.addNotificationListener(ObjectNameBuilder.DEFAULT.getJMSServerObjectName(), listener, null, null); - List<String> connectors = new ArrayList<String>(); + List<String> connectors = new ArrayList<>(); connectors.add("invm"); String testTopicName = "newTopic"; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java index 99679e0..b91b89f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOJournalCompactTest.java @@ -67,31 +67,31 @@ public class NIOJournalCompactTest extends JournalImplTestBase { @Test public void testControlFile() throws Exception { - ArrayList<JournalFile> dataFiles = new ArrayList<JournalFile>(); + ArrayList<JournalFile> dataFiles = new ArrayList<>(); for (int i = 0; i < 5; i++) { SequentialFile file = fileFactory.createSequentialFile("file-" + i + ".tst"); dataFiles.add(new JournalFileImpl(file, 0, JournalImpl.FORMAT_VERSION)); } - ArrayList<JournalFile> newFiles = new ArrayList<JournalFile>(); + ArrayList<JournalFile> newFiles = new ArrayList<>(); for (int i = 0; i < 3; i++) { SequentialFile file = fileFactory.createSequentialFile("file-" + i + ".tst.new"); newFiles.add(new JournalFileImpl(file, 0, JournalImpl.FORMAT_VERSION)); } - ArrayList<Pair<String, String>> renames = new ArrayList<Pair<String, String>>(); - renames.add(new Pair<String, String>("a", "b")); - renames.add(new Pair<String, String>("c", "d")); + ArrayList<Pair<String, String>> renames = new ArrayList<>(); + renames.add(new Pair<>("a", "b")); + renames.add(new Pair<>("c", "d")); AbstractJournalUpdateTask.writeControlFile(fileFactory, dataFiles, newFiles, renames); - ArrayList<String> strDataFiles = new ArrayList<String>(); + ArrayList<String> strDataFiles = new ArrayList<>(); - ArrayList<String> strNewFiles = new ArrayList<String>(); + ArrayList<String> strNewFiles = new ArrayList<>(); - ArrayList<Pair<String, String>> renamesRead = new ArrayList<Pair<String, String>>(); + ArrayList<Pair<String, String>> renamesRead = new ArrayList<>(); Assert.assertNotNull(JournalCompactor.readControlFile(fileFactory, strDataFiles, strNewFiles, renamesRead)); @@ -234,9 +234,9 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.stop(); - List<RecordInfo> records1 = new ArrayList<RecordInfo>(); + List<RecordInfo> records1 = new ArrayList<>(); - List<PreparedTransactionInfo> preparedRecords = new ArrayList<PreparedTransactionInfo>(); + List<PreparedTransactionInfo> preparedRecords = new ArrayList<>(); journal.start(); @@ -480,9 +480,9 @@ public class NIOJournalCompactTest extends JournalImplTestBase { setup(2, 60 * 1024, false); - ArrayList<Long> liveIDs = new ArrayList<Long>(); + ArrayList<Long> liveIDs = new ArrayList<>(); - ArrayList<Pair<Long, Long>> transactedRecords = new ArrayList<Pair<Long, Long>>(); + ArrayList<Pair<Long, Long>> transactedRecords = new ArrayList<>(); final CountDownLatch latchDone = new CountDownLatch(1); final CountDownLatch latchWait = new CountDownLatch(1); @@ -566,7 +566,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { if (preXA) { prepare(transactionID, new SimpleEncoding(10, (byte) 0)); } - transactedRecords.add(new Pair<Long, Long>(transactionID++, recordID)); + transactedRecords.add(new Pair<>(transactionID++, recordID)); } } @@ -1090,7 +1090,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { // add and remove some data to force reclaiming { - ArrayList<Long> ids = new ArrayList<Long>(); + ArrayList<Long> ids = new ArrayList<>(); for (int i = 0; i < NUMBER_OF_RECORDS; i++) { long id = idGenerator.generateID(); ids.add(id); @@ -1165,9 +1165,9 @@ public class NIOJournalCompactTest extends JournalImplTestBase { startJournal(); loadAndCheck(); - ArrayList<Long> listToDelete = new ArrayList<Long>(); + ArrayList<Long> listToDelete = new ArrayList<>(); - ArrayList<Integer> expectedSizes = new ArrayList<Integer>(); + ArrayList<Integer> expectedSizes = new ArrayList<>(); for (int i = 0; i < 10; i++) { long id = idGenerator.generateID(); @@ -1241,7 +1241,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); - ArrayList<Long> listToDelete = new ArrayList<Long>(); + ArrayList<Long> listToDelete = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (i == 5) { commit(tx); @@ -1287,7 +1287,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); - ArrayList<Long> listToDelete = new ArrayList<Long>(); + ArrayList<Long> listToDelete = new ArrayList<>(); for (int i = 0; i < 10; i++) { long id = idGenerator.generateID(); listToDelete.add(id); @@ -1330,7 +1330,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); - ArrayList<Long> listToDelete = new ArrayList<Long>(); + ArrayList<Long> listToDelete = new ArrayList<>(); for (int i = 0; i < 10; i++) { long id = idGenerator.generateID(); listToDelete.add(id); @@ -1380,7 +1380,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); - ArrayList<Long> listToDelete = new ArrayList<Long>(); + ArrayList<Long> listToDelete = new ArrayList<>(); for (int i = 0; i < 10; i++) { long id = idGenerator.generateID(); listToDelete.add(id); @@ -1436,7 +1436,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { journal.forceMoveNextFile(); - ArrayList<Long> listToDelete = new ArrayList<Long>(); + ArrayList<Long> listToDelete = new ArrayList<>(); for (int i = 0; i < 10; i++) { long id = idGenerator.generateID(); listToDelete.add(id); @@ -1545,9 +1545,9 @@ public class NIOJournalCompactTest extends JournalImplTestBase { startJournal(); loadAndCheck(); - ArrayList<Long> listToDelete = new ArrayList<Long>(); + ArrayList<Long> listToDelete = new ArrayList<>(); - ArrayList<Integer> expectedSizes = new ArrayList<Integer>(); + ArrayList<Integer> expectedSizes = new ArrayList<>(); for (int i = 0; i < 10; i++) { long tx = idGenerator.generateID(); @@ -1639,7 +1639,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase { storage.loadInternalOnly(); ((JournalImpl) storage.getMessageJournal()).setAutoReclaim(false); - final LinkedList<Long> survivingMsgs = new LinkedList<Long>(); + final LinkedList<Long> survivingMsgs = new LinkedList<>(); Runnable producerRunnable = new Runnable() { @Override