http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java ---------------------------------------------------------------------- diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java index befef1c..a9116a9 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/MultipleConsumersPageStressTest.java @@ -71,11 +71,11 @@ public class MultipleConsumersPageStressTest extends ActiveMQTestBase { private volatile boolean runningConsumer = true; - ArrayList<TestProducer> producers = new ArrayList<TestProducer>(); + ArrayList<TestProducer> producers = new ArrayList<>(); - ArrayList<TestConsumer> consumers = new ArrayList<TestConsumer>(); + ArrayList<TestConsumer> consumers = new ArrayList<>(); - ArrayList<Throwable> exceptions = new ArrayList<Throwable>(); + ArrayList<Throwable> exceptions = new ArrayList<>(); @Test public void testOpenConsumerEveryTimeDefaultFlowControl0() throws Throwable { @@ -96,7 +96,7 @@ public class MultipleConsumersPageStressTest extends ActiveMQTestBase { public void setUp() throws Exception { super.setUp(); - HashMap<String, AddressSettings> settings = new HashMap<String, AddressSettings>(); + HashMap<String, AddressSettings> settings = new HashMap<>(); server = createServer(true, createDefaultInVMConfig(), 10024, 200024, settings); server.start();
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java ---------------------------------------------------------------------- diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java index d0e127a..febcb45 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java @@ -780,7 +780,7 @@ public class PageCursorStressTest extends ActiveMQTestBase { public void setUp() throws Exception { super.setUp(); OperationContextImpl.clearContext(); - queueList = new ArrayList<Queue>(); + queueList = new ArrayList<>(); createServer(); lock = new ReentrantReadWriteLock().readLock(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageStressTest.java ---------------------------------------------------------------------- diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageStressTest.java index de3d545..a439587 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageStressTest.java @@ -48,7 +48,7 @@ public class PageStressTest extends ActiveMQTestBase { public void testStopDuringDepage() throws Exception { Configuration config = createDefaultInVMConfig().setJournalSyncNonTransactional(false).setJournalSyncTransactional(false); - HashMap<String, AddressSettings> settings = new HashMap<String, AddressSettings>(); + HashMap<String, AddressSettings> settings = new HashMap<>(); AddressSettings setting = new AddressSettings().setMaxSizeBytes(20 * 1024 * 1024); settings.put("page-adr", setting); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java ---------------------------------------------------------------------- diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java index 1a7b764..71485ed 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/stomp/StompStressTest.java @@ -103,7 +103,7 @@ public class StompStressTest extends ActiveMQTestBase { } private ActiveMQServer createServer() throws Exception { - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.PROTOCOLS_PROP_NAME, StompProtocolManagerFactory.STOMP_PROTOCOL_NAME); params.put(TransportConstants.PORT_PROP_NAME, TransportConstants.DEFAULT_STOMP_PORT); TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java ---------------------------------------------------------------------- diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java index deb32b5..adf97fc 100644 --- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java +++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueConcurrentTest.java @@ -119,7 +119,7 @@ public class QueueConcurrentTest extends ActiveMQTestBase { return e; } - private final List<MessageReference> refs = new ArrayList<MessageReference>(); + private final List<MessageReference> refs = new ArrayList<>(); public List<MessageReference> getReferences() { return refs; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java ---------------------------------------------------------------------- diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java index a2120e8..8fb9b9b 100644 --- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java +++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/core/server/impl/QueueImplTest.java @@ -106,7 +106,7 @@ public class QueueImplTest extends ActiveMQTestBase { ref8.setScheduledDeliveryTime(now + 6000); queue.addTail(ref8); - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); // Scheduled refs are added back to *FRONT* of queue - otherwise if there were many messages in the queue // They may get stranded behind a big backlog @@ -179,7 +179,7 @@ public class QueueImplTest extends ActiveMQTestBase { queue.deliverNow(); - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); refs.add(ref2); refs.add(ref3); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java ---------------------------------------------------------------------- diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java index 896fda8..4054c64 100644 --- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java +++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java @@ -319,7 +319,7 @@ public class JMSBridgeImplTest extends ActiveMQTestBase { Connection targetConn = JMSBridgeImplTest.createConnectionFactory().createConnection(); Session targetSess = targetConn.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageConsumer consumer = targetSess.createConsumer(targetDF.createDestination()); - final List<Message> messages = new LinkedList<Message>(); + final List<Message> messages = new LinkedList<>(); MessageListener listener = new MessageListener() { @Override @@ -378,7 +378,7 @@ public class JMSBridgeImplTest extends ActiveMQTestBase { Connection targetConn = JMSBridgeImplTest.createConnectionFactory().createConnection(); Session targetSess = targetConn.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageConsumer consumer = targetSess.createConsumer(targetDF.createDestination()); - final List<Message> messages = new LinkedList<Message>(); + final List<Message> messages = new LinkedList<>(); final CountDownLatch latch = new CountDownLatch(numMessages); MessageListener listener = new MessageListener() { @Override @@ -480,7 +480,7 @@ public class JMSBridgeImplTest extends ActiveMQTestBase { @Test public void testExceptionOnSourceAndRetrySucceeds() throws Exception { - final AtomicReference<Connection> sourceConn = new AtomicReference<Connection>(); + final AtomicReference<Connection> sourceConn = new AtomicReference<>(); ActiveMQJMSConnectionFactory failingSourceCF = new ActiveMQJMSConnectionFactory(false, new TransportConfiguration(InVMConnectorFactory.class.getName())) { private static final long serialVersionUID = -8866390811966688830L; @@ -530,7 +530,7 @@ public class JMSBridgeImplTest extends ActiveMQTestBase { @Test public void testExceptionOnSourceAndRetryFails() throws Exception { - final AtomicReference<Connection> sourceConn = new AtomicReference<Connection>(); + final AtomicReference<Connection> sourceConn = new AtomicReference<>(); ActiveMQJMSConnectionFactory failingSourceCF = new ActiveMQJMSConnectionFactory(false, new TransportConfiguration(INVM_CONNECTOR_FACTORY)) { private static final long serialVersionUID = 8216804886099984645L; boolean firstTime = true; @@ -587,7 +587,7 @@ public class JMSBridgeImplTest extends ActiveMQTestBase { public void testStartWithSpecificTCCL() throws Exception { MockContextClassLoader mockTccl = setMockTCCL(); try { - final AtomicReference<Connection> sourceConn = new AtomicReference<Connection>(); + final AtomicReference<Connection> sourceConn = new AtomicReference<>(); ActiveMQJMSConnectionFactory failingSourceCF = new ActiveMQJMSConnectionFactory(false, new TransportConfiguration(InVMConnectorFactory.class.getName())) { private static final long serialVersionUID = -8866390811966688830L; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java index 469d2a2..4806bf9 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java @@ -109,7 +109,7 @@ public class MultiThreadAsynchronousFileTest extends AIOTestBase { CountDownLatch latchStart = new CountDownLatch(MultiThreadAsynchronousFileTest.NUMBER_OF_THREADS + 1); - ArrayList<ThreadProducer> list = new ArrayList<ThreadProducer>(MultiThreadAsynchronousFileTest.NUMBER_OF_THREADS); + ArrayList<ThreadProducer> list = new ArrayList<>(MultiThreadAsynchronousFileTest.NUMBER_OF_THREADS); for (int i = 0; i < MultiThreadAsynchronousFileTest.NUMBER_OF_THREADS; i++) { ThreadProducer producer = new ThreadProducer("Thread " + i, latchStart, file, sync); list.add(producer); @@ -197,7 +197,7 @@ public class MultiThreadAsynchronousFileTest extends AIOTestBase { latchFinishThread = new CountDownLatch(MultiThreadAsynchronousFileTest.NUMBER_OF_LINES); } - LinkedList<CountDownCallback> list = new LinkedList<CountDownCallback>(); + LinkedList<CountDownCallback> list = new LinkedList<>(); for (int i = 0; i < MultiThreadAsynchronousFileTest.NUMBER_OF_LINES; i++) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java index 110a621..300f978 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java @@ -77,7 +77,7 @@ public class ConnectorsServiceTest extends ActiveMQTestBase { public void testConnectorsServiceUsesConfiguredConnectorServices() throws Exception { ConnectorServiceConfiguration connectorServiceConfiguration = new ConnectorServiceConfiguration().setFactoryClassName(FakeConnectorServiceFactory.class.getCanonicalName()).setParams(new HashMap<String, Object>()).setName("myfact"); - List<ConnectorServiceConfiguration> connectorServiceConfigurations = new ArrayList<ConnectorServiceConfiguration>(); + List<ConnectorServiceConfiguration> connectorServiceConfigurations = new ArrayList<>(); connectorServiceConfigurations.add(connectorServiceConfiguration); configuration.setConnectorServiceConfigurations(connectorServiceConfigurations); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/fakes/FakeConnectorServiceFactory.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/fakes/FakeConnectorServiceFactory.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/fakes/FakeConnectorServiceFactory.java index af7b94d..16bdc7c 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/fakes/FakeConnectorServiceFactory.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/fakes/FakeConnectorServiceFactory.java @@ -48,12 +48,12 @@ public class FakeConnectorServiceFactory implements ConnectorServiceFactory { @Override public Set<String> getAllowableProperties() { - return new HashSet<String>(); + return new HashSet<>(); } @Override public Set<String> getRequiredProperties() { - return new HashSet<String>(); + return new HashSet<>(); } public ConnectorService getConnectorService() { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java index 97cd4fe..e01263b 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java @@ -1128,7 +1128,7 @@ public class AlignedJournalImplTest extends ActiveMQTestBase { final CountDownLatch latchReady = new CountDownLatch(2); final CountDownLatch latchStart = new CountDownLatch(1); final AtomicInteger finishedOK = new AtomicInteger(0); - final BlockingQueue<Integer> queueDelete = new LinkedBlockingQueue<Integer>(); + final BlockingQueue<Integer> queueDelete = new LinkedBlockingQueue<>(); final int NUMBER_OF_ELEMENTS = 500; @@ -1234,8 +1234,8 @@ public class AlignedJournalImplTest extends ActiveMQTestBase { addActiveMQComponent(journalImpl); journalImpl.start(); - ArrayList<RecordInfo> info = new ArrayList<RecordInfo>(); - ArrayList<PreparedTransactionInfo> trans = new ArrayList<PreparedTransactionInfo>(); + ArrayList<RecordInfo> info = new ArrayList<>(); + ArrayList<PreparedTransactionInfo> trans = new ArrayList<>(); journalImpl.load(info, trans, null); @@ -1253,11 +1253,11 @@ public class AlignedJournalImplTest extends ActiveMQTestBase { public void setUp() throws Exception { super.setUp(); - records = new ArrayList<RecordInfo>(); + records = new ArrayList<>(); - transactions = new ArrayList<PreparedTransactionInfo>(); + transactions = new ArrayList<>(); - incompleteTransactions = new ArrayList<Long>(); + incompleteTransactions = new ArrayList<>(); factory = null; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java index 22395e8..f8a907a 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalAsyncTest.java @@ -173,9 +173,9 @@ public class JournalAsyncTest extends ActiveMQTestBase { public void setUp() throws Exception { super.setUp(); - records = new ArrayList<RecordInfo>(); + records = new ArrayList<>(); - transactions = new ArrayList<PreparedTransactionInfo>(); + transactions = new ArrayList<>(); factory = null; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java index 4c6c4e7..e502ff7 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java @@ -42,13 +42,13 @@ import org.junit.Before; public abstract class JournalImplTestBase extends ActiveMQTestBase { - protected List<RecordInfo> records = new LinkedList<RecordInfo>(); + protected List<RecordInfo> records = new LinkedList<>(); protected TestableJournal journal; protected int recordLength = 1024; - protected Map<Long, TransactionHolder> transactions = new LinkedHashMap<Long, TransactionHolder>(); + protected Map<Long, TransactionHolder> transactions = new LinkedHashMap<>(); protected int maxAIO; @@ -233,9 +233,9 @@ public abstract class JournalImplTestBase extends ActiveMQTestBase { } protected void loadAndCheck(final boolean printDebugJournal) throws Exception { - List<RecordInfo> committedRecords = new ArrayList<RecordInfo>(); + List<RecordInfo> committedRecords = new ArrayList<>(); - List<PreparedTransactionInfo> preparedTransactions = new ArrayList<PreparedTransactionInfo>(); + List<PreparedTransactionInfo> preparedTransactions = new ArrayList<>(); journal.load(committedRecords, preparedTransactions, null); @@ -247,7 +247,7 @@ public abstract class JournalImplTestBase extends ActiveMQTestBase { // check prepared transactions - List<PreparedTransactionInfo> prepared = new ArrayList<PreparedTransactionInfo>(); + List<PreparedTransactionInfo> prepared = new ArrayList<>(); for (Map.Entry<Long, TransactionHolder> entry : transactions.entrySet()) { if (entry.getValue().prepared) { @@ -537,9 +537,9 @@ public abstract class JournalImplTestBase extends ActiveMQTestBase { static final class TransactionHolder { - List<RecordInfo> records = new ArrayList<RecordInfo>(); + List<RecordInfo> records = new ArrayList<>(); - List<RecordInfo> deletes = new ArrayList<RecordInfo>(); + List<RecordInfo> deletes = new ArrayList<>(); boolean prepared; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java index 53849c7..39132a5 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/ReclaimerTest.java @@ -722,13 +722,13 @@ public class ReclaimerTest extends ActiveMQTestBase { static final class MockJournalFile implements JournalFile { - private final Set<Long> transactionIDs = new HashSet<Long>(); + private final Set<Long> transactionIDs = new HashSet<>(); - private final Set<Long> transactionTerminationIDs = new HashSet<Long>(); + private final Set<Long> transactionTerminationIDs = new HashSet<>(); - private final Set<Long> transactionPrepareIDs = new HashSet<Long>(); + private final Set<Long> transactionPrepareIDs = new HashSet<>(); - private final Map<JournalFile, Integer> negCounts = new HashMap<JournalFile, Integer>(); + private final Map<JournalFile, Integer> negCounts = new HashMap<>(); private int posCount; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java index 18b8a9c..5ec0d07 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/SequentialFileFactoryTestBase.java @@ -73,7 +73,7 @@ public abstract class SequentialFileFactoryTestBase extends ActiveMQTestBase { @Test public void testCreateAndListFiles() throws Exception { - List<String> expectedFiles = new ArrayList<String>(); + List<String> expectedFiles = new ArrayList<>(); final int numFiles = 10; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java index 537cabf..780c4ed 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/TimedBufferTest.java @@ -59,7 +59,7 @@ public class TimedBufferTest extends ActiveMQTestBase { @Test public void testFillBuffer() { - final ArrayList<ByteBuffer> buffers = new ArrayList<ByteBuffer>(); + final ArrayList<ByteBuffer> buffers = new ArrayList<>(); final AtomicInteger flushTimes = new AtomicInteger(0); class TestObserver implements TimedBufferObserver { @@ -128,7 +128,7 @@ public class TimedBufferTest extends ActiveMQTestBase { @Test public void testTimingAndFlush() throws Exception { - final ArrayList<ByteBuffer> buffers = new ArrayList<ByteBuffer>(); + final ArrayList<ByteBuffer> buffers = new ArrayList<>(); final AtomicInteger flushTimes = new AtomicInteger(0); class TestObserver implements TimedBufferObserver { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java index 7ab0abf..fd44f2b 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java @@ -35,7 +35,7 @@ import org.apache.activemq.artemis.core.io.buffer.TimedBuffer; public class FakeSequentialFileFactory implements SequentialFileFactory { - private final Map<String, FakeSequentialFile> fileMap = new ConcurrentHashMap<String, FakeSequentialFile>(); + private final Map<String, FakeSequentialFile> fileMap = new ConcurrentHashMap<>(); private final int alignment; @@ -52,7 +52,7 @@ public class FakeSequentialFileFactory implements SequentialFileFactory { public FakeSequentialFileFactory(final int alignment, final boolean supportsCallback) { this.alignment = alignment; this.supportsCallback = supportsCallback; - callbacksInHold = new ArrayList<CallbackRunnable>(); + callbacksInHold = new ArrayList<>(); } public FakeSequentialFileFactory() { @@ -98,7 +98,7 @@ public class FakeSequentialFileFactory implements SequentialFileFactory { @Override public List<String> listFiles(final String extension) { - List<String> files = new ArrayList<String>(); + List<String> files = new ArrayList<>(); for (String s : fileMap.keySet()) { if (s.endsWith("." + extension)) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java index 18f37e6..0178f63 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/message/impl/MessageImplTest.java @@ -302,7 +302,7 @@ public class MessageImplTest extends ActiveMQTestBase { } } - ArrayList<Thread> threads = new ArrayList<Thread>(); + ArrayList<Thread> threads = new ArrayList<>(); for (int i = 0; i < T1_number; i++) { T1 t = new T1(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java index aa06ea0..d6e0f72 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java @@ -193,7 +193,7 @@ public class PageTest extends ActiveMQTestBase { protected ArrayList<ActiveMQBuffer> addPageElements(final SimpleString simpleDestination, final Page page, final int numberOfElements) throws Exception { - ArrayList<ActiveMQBuffer> buffers = new ArrayList<ActiveMQBuffer>(); + ArrayList<ActiveMQBuffer> buffers = new ArrayList<>(); int initialNumberOfMessages = page.getNumberOfMessages(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java index 5f21753..868bdfa 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java @@ -50,7 +50,7 @@ public class PagingManagerImplTest extends ActiveMQTestBase { @Test public void testPagingManager() throws Exception { - HierarchicalRepository<AddressSettings> addressSettings = new HierarchicalObjectRepository<AddressSettings>(); + HierarchicalRepository<AddressSettings> addressSettings = new HierarchicalObjectRepository<>(); addressSettings.setDefault(new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE)); final StorageManager storageManager = new NullStorageManager(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java index 13908b0..d361ffa 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java @@ -141,7 +141,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase { Assert.assertEquals(1, storeImpl.getNumberOfPages()); - List<ActiveMQBuffer> buffers = new ArrayList<ActiveMQBuffer>(); + List<ActiveMQBuffer> buffers = new ArrayList<>(); ActiveMQBuffer buffer = createRandomBuffer(0, 10); @@ -183,7 +183,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase { storeImpl.startPaging(); - List<ActiveMQBuffer> buffers = new ArrayList<ActiveMQBuffer>(); + List<ActiveMQBuffer> buffers = new ArrayList<>(); int numMessages = 10; @@ -247,7 +247,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase { Assert.assertEquals(1, store.getNumberOfPages()); - List<ActiveMQBuffer> buffers = new ArrayList<ActiveMQBuffer>(); + List<ActiveMQBuffer> buffers = new ArrayList<>(); for (int i = 0; i < 10; i++) { @@ -370,9 +370,9 @@ public class PagingStoreImplTest extends ActiveMQTestBase { final CountDownLatch latchStart = new CountDownLatch(numberOfThreads); - final ConcurrentHashMap<Long, ServerMessage> buffers = new ConcurrentHashMap<Long, ServerMessage>(); + final ConcurrentHashMap<Long, ServerMessage> buffers = new ConcurrentHashMap<>(); - final ArrayList<Page> readPages = new ArrayList<Page>(); + final ArrayList<Page> readPages = new ArrayList<>(); AddressSettings settings = new AddressSettings().setPageSizeBytes(MAX_SIZE).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE); @@ -477,7 +477,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase { throw consumer.e; } - final ConcurrentMap<Long, ServerMessage> buffers2 = new ConcurrentHashMap<Long, ServerMessage>(); + final ConcurrentMap<Long, ServerMessage> buffers2 = new ConcurrentHashMap<>(); for (Page page : readPages) { page.open(); @@ -627,7 +627,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase { final long NUMBER_OF_MESSAGES = 100000; - final List<Throwable> errors = new ArrayList<Throwable>(); + final List<Throwable> errors = new ArrayList<>(); class WriterThread extends Thread { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java index 30d7f2a..554a5e3 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/persistence/impl/BatchIDGeneratorUnitTest.java @@ -114,8 +114,8 @@ public class BatchIDGeneratorUnitTest extends ActiveMQTestBase { } protected void loadIDs(final Journal journal, final BatchingIDGenerator batch) throws Exception { - ArrayList<RecordInfo> records = new ArrayList<RecordInfo>(); - ArrayList<PreparedTransactionInfo> tx = new ArrayList<PreparedTransactionInfo>(); + ArrayList<RecordInfo> records = new ArrayList<>(); + ArrayList<PreparedTransactionInfo> tx = new ArrayList<>(); journal.start(); journal.load(records, tx, null); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java index af6fc72..e89510e 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java @@ -96,7 +96,7 @@ public class DuplicateDetectionUnitTest extends ActiveMQTestBase { journal.start(); journal.loadBindingJournal(new ArrayList<QueueBindingInfo>(), new ArrayList<GroupingInfo>()); - HashMap<SimpleString, List<Pair<byte[], Long>>> mapDups = new HashMap<SimpleString, List<Pair<byte[], Long>>>(); + HashMap<SimpleString, List<Pair<byte[], Long>>> mapDups = new HashMap<>(); FakePagingManager pagingManager = new FakePagingManager(); journal.loadMessageJournal(postOffice, pagingManager, new ResourceManagerImpl(0, 0, scheduledThreadPool), null, mapDups, null, null, new PostOfficeJournalLoader(postOffice, pagingManager, null, null, null, null, null, null)); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java index 6f17770..23b1c65 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/WildcardAddressManagerUnitTest.java @@ -179,7 +179,7 @@ public class WildcardAddressManagerUnitTest extends ActiveMQTestBase { class BindignsFake implements Bindings { - ArrayList<Binding> bindings = new ArrayList<Binding>(); + ArrayList<Binding> bindings = new ArrayList<>(); @Override public Collection<Binding> getBindings() { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/invm/InVMConnectorFactoryTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/invm/InVMConnectorFactoryTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/invm/InVMConnectorFactoryTest.java index 3fe6af1..0e4e181 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/invm/InVMConnectorFactoryTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/invm/InVMConnectorFactoryTest.java @@ -43,7 +43,7 @@ public class InVMConnectorFactoryTest { assertTrue(tc.getParams().equals(InVMConnector.DEFAULT_CONFIG)); // Test defaults are not set when TransportConfig params are not empty - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put("Foo", "Bar"); tc = new TransportConfiguration(InVMConnectorFactory.class.getName(), params); assertTrue(tc.getParams().size() == 1); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java index a8fdfab..ac2ff3c 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java @@ -40,7 +40,7 @@ public class NettyAcceptorFactoryTest extends ActiveMQTestBase { public void testCreateAcceptor() throws Exception { NettyAcceptorFactory factory = new NettyAcceptorFactory(); - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); BufferHandler handler = new BufferHandler() { @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java index 55aae43..f0ea5db 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java @@ -71,7 +71,7 @@ public class NettyAcceptorTest extends ActiveMQTestBase { } }; - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); ConnectionLifeCycleListener listener = new ConnectionLifeCycleListener() { @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorFactoryTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorFactoryTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorFactoryTest.java index b391b2c..e4c7cd7 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorFactoryTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorFactoryTest.java @@ -43,7 +43,7 @@ public class NettyConnectorFactoryTest { assertTrue(tc.getParams().equals(NettyConnector.DEFAULT_CONFIG)); // Test defaults are not set when TransportConfig params are not empty - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put("Foo", "Bar"); tc = new TransportConfiguration(NettyConnectorFactory.class.getName(), params); assertTrue(tc.getParams().size() == 1); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java index fb6a5d8..1888fb4 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java @@ -43,7 +43,7 @@ public class NettyConnectorTest extends ActiveMQTestBase { public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) { } }; - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); ConnectionLifeCycleListener listener = new ConnectionLifeCycleListener() { @Override public void connectionException(final Object connectionID, final ActiveMQException me) { @@ -79,7 +79,7 @@ public class NettyConnectorTest extends ActiveMQTestBase { public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) { } }; - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); ConnectionLifeCycleListener listener = new ConnectionLifeCycleListener() { @Override public void connectionException(final Object connectionID, final ActiveMQException me) { @@ -126,7 +126,7 @@ public class NettyConnectorTest extends ActiveMQTestBase { public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) { } }; - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); params.put(TransportConstants.KEYSTORE_PATH_PROP_NAME, "bad path"); params.put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, "bad password"); @@ -172,7 +172,7 @@ public class NettyConnectorTest extends ActiveMQTestBase { public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) { } }; - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); params.put(TransportConstants.KEYSTORE_PATH_PROP_NAME, "bad path"); params.put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, "bad password"); @@ -223,7 +223,7 @@ public class NettyConnectorTest extends ActiveMQTestBase { public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) { } }; - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); params.put(TransportConstants.ENABLED_CIPHER_SUITES_PROP_NAME, "myBadCipherSuite"); ConnectionLifeCycleListener listener = new ConnectionLifeCycleListener() { @@ -262,7 +262,7 @@ public class NettyConnectorTest extends ActiveMQTestBase { public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) { } }; - Map<String, Object> params = new HashMap<String, Object>(); + Map<String, Object> params = new HashMap<>(); params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); params.put(TransportConstants.ENABLED_PROTOCOLS_PROP_NAME, "myBadProtocol"); ConnectionLifeCycleListener listener = new ConnectionLifeCycleListener() { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java index ea8ca0c..fdd32c0 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java @@ -61,22 +61,22 @@ public class ActiveMQSecurityManagerImplTest extends ActiveMQTestBase { Assert.assertTrue(securityManager.validateUser(null, null)); Assert.assertTrue(securityManager.validateUser("guest", "password")); Assert.assertFalse(securityManager.validateUser(null, "wrongpass")); - HashSet<Role> roles = new HashSet<Role>(); + HashSet<Role> roles = new HashSet<>(); roles.add(new Role("guest", true, true, true, true, true, true, true)); Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE)); Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND)); Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("guest", true, true, false, true, true, true, true)); Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE)); Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND)); Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("guest", true, false, false, true, true, true, true)); Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE)); Assert.assertTrue(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND)); Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CONSUME)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("guest", false, false, false, true, true, true, true)); Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.CREATE_DURABLE_QUEUE)); Assert.assertFalse(securityManager.validateUserAndRole(null, null, roles, CheckType.SEND)); @@ -128,19 +128,19 @@ public class ActiveMQSecurityManagerImplTest extends ActiveMQTestBase { securityManager.getConfiguration().addRole("newuser1", "role2"); securityManager.getConfiguration().addRole("newuser1", "role3"); securityManager.getConfiguration().addRole("newuser1", "role4"); - HashSet<Role> roles = new HashSet<Role>(); + HashSet<Role> roles = new HashSet<>(); roles.add(new Role("role1", true, true, true, true, true, true, true)); Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("role2", true, true, true, true, true, true, true)); Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("role3", true, true, true, true, true, true, true)); Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("role4", true, true, true, true, true, true, true)); Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("role5", true, true, true, true, true, true, true)); Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); } @@ -154,19 +154,19 @@ public class ActiveMQSecurityManagerImplTest extends ActiveMQTestBase { securityManager.getConfiguration().addRole("newuser1", "role4"); securityManager.getConfiguration().removeRole("newuser1", "role2"); securityManager.getConfiguration().removeRole("newuser1", "role4"); - HashSet<Role> roles = new HashSet<Role>(); + HashSet<Role> roles = new HashSet<>(); roles.add(new Role("role1", true, true, true, true, true, true, true)); Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("role2", true, true, true, true, true, true, true)); Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("role3", true, true, true, true, true, true, true)); Assert.assertTrue(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("role4", true, true, true, true, true, true, true)); Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); - roles = new HashSet<Role>(); + roles = new HashSet<>(); roles.add(new Role("role5", true, true, true, true, true, true, true)); Assert.assertFalse(securityManager.validateUserAndRole("newuser1", "newpassword1", roles, CheckType.SEND)); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java index 8b4e265..f7ad00d 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/QueueImplTest.java @@ -215,7 +215,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -258,7 +258,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -301,7 +301,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -359,7 +359,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs1 = new ArrayList<MessageReference>(); + List<MessageReference> refs1 = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -369,7 +369,7 @@ public class QueueImplTest extends ActiveMQTestBase { queue.addTail(ref); } - LinkedList<MessageReference> refs2 = new LinkedList<MessageReference>(); + LinkedList<MessageReference> refs2 = new LinkedList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i + numMessages); @@ -379,7 +379,7 @@ public class QueueImplTest extends ActiveMQTestBase { queue.addHead(ref); } - List<MessageReference> refs3 = new ArrayList<MessageReference>(); + List<MessageReference> refs3 = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i + 2 * numMessages); @@ -395,7 +395,7 @@ public class QueueImplTest extends ActiveMQTestBase { queue.deliverNow(); - List<MessageReference> allRefs = new ArrayList<MessageReference>(); + List<MessageReference> allRefs = new ArrayList<>(); allRefs.addAll(refs2); allRefs.addAll(refs1); @@ -410,7 +410,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -563,7 +563,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); queue.pause(); @@ -616,7 +616,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -673,7 +673,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 20; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -686,7 +686,7 @@ public class QueueImplTest extends ActiveMQTestBase { Assert.assertEquals(numMessages, getMessageCount(queue)); Iterator<MessageReference> iterator = queue.iterator(); - List<MessageReference> list = new ArrayList<MessageReference>(); + List<MessageReference> list = new ArrayList<>(); while (iterator.hasNext()) { list.add(iterator.next()); } @@ -712,7 +712,7 @@ public class QueueImplTest extends ActiveMQTestBase { queue.addConsumer(consumer); - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); MessageReference ref1 = generateReference(queue, 1); @@ -787,7 +787,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -826,7 +826,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -889,7 +889,7 @@ public class QueueImplTest extends ActiveMQTestBase { QueueImpl queue = getTemporaryQueue(); final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -956,7 +956,7 @@ public class QueueImplTest extends ActiveMQTestBase { queue.addConsumer(consumer); } - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); MessageReference ref1 = generateReference(queue, 1); @@ -1105,7 +1105,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); @@ -1166,7 +1166,7 @@ public class QueueImplTest extends ActiveMQTestBase { final int numMessages = 10; - List<MessageReference> refs = new ArrayList<MessageReference>(); + List<MessageReference> refs = new ArrayList<>(); for (int i = 0; i < numMessages; i++) { MessageReference ref = generateReference(queue, i); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeConsumer.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeConsumer.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeConsumer.java index 7355674..a7be2fa 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeConsumer.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/server/impl/fakes/FakeConsumer.java @@ -33,7 +33,7 @@ public class FakeConsumer implements Consumer { private int delayCountdown = 0; - private final LinkedList<MessageReference> references = new LinkedList<MessageReference>(); + private final LinkedList<MessageReference> references = new LinkedList<>(); private final Filter filter; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java index 080b837..bfdeaa2 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ActiveMQResourceAdapterConfigTest.java @@ -397,7 +397,7 @@ public class ActiveMQResourceAdapterConfigTest extends ActiveMQTestBase { @Test public void testConfiguration() throws Exception { Method[] methods = ActiveMQResourceAdapter.class.getMethods(); - Map<String, Method> methodList = new HashMap<String, Method>(); + Map<String, Method> methodList = new HashMap<>(); for (Method method : methods) { if (method.getName().startsWith("set")) { methodList.put(method.getName(), method); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java index 7927206..4e617ae 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java @@ -39,12 +39,12 @@ public class ConnectionFactoryPropertiesTest extends ActiveMQTestBase { private static final SortedSet<String> UNSUPPORTED_RA_PROPERTIES; static { - UNSUPPORTED_CF_PROPERTIES = new TreeSet<String>(); + UNSUPPORTED_CF_PROPERTIES = new TreeSet<>(); UNSUPPORTED_CF_PROPERTIES.add("discoveryGroupName"); UNSUPPORTED_CF_PROPERTIES.add("incomingInterceptorList"); UNSUPPORTED_CF_PROPERTIES.add("outgoingInterceptorList"); - UNSUPPORTED_RA_PROPERTIES = new TreeSet<String>(); + UNSUPPORTED_RA_PROPERTIES = new TreeSet<>(); UNSUPPORTED_RA_PROPERTIES.add("HA"); UNSUPPORTED_RA_PROPERTIES.add("jgroupsChannelName"); UNSUPPORTED_RA_PROPERTIES.add("jgroupsFile"); @@ -83,10 +83,10 @@ public class ConnectionFactoryPropertiesTest extends ActiveMQTestBase { } private static void compare(String name1, SortedSet<String> set1, String name2, SortedSet<String> set2) { - Set<String> onlyInSet1 = new TreeSet<String>(set1); + Set<String> onlyInSet1 = new TreeSet<>(set1); onlyInSet1.removeAll(set2); - Set<String> onlyInSet2 = new TreeSet<String>(set2); + Set<String> onlyInSet2 = new TreeSet<>(set2); onlyInSet2.removeAll(set1); if (!onlyInSet1.isEmpty() || !onlyInSet2.isEmpty()) { @@ -97,7 +97,7 @@ public class ConnectionFactoryPropertiesTest extends ActiveMQTestBase { } private SortedSet<String> findAllPropertyNames(Class<?> clazz) throws Exception { - SortedSet<String> names = new TreeSet<String>(); + SortedSet<String> names = new TreeSet<>(); for (PropertyDescriptor propDesc : getBeanInfo(clazz).getPropertyDescriptors()) { if (propDesc == null || propDesc.getWriteMethod() == null) { continue; @@ -110,22 +110,22 @@ public class ConnectionFactoryPropertiesTest extends ActiveMQTestBase { @Test public void testEquality() throws Exception { ConnectionFactoryProperties cfp1 = new ConnectionFactoryProperties(); - List<String> connectorClassNames1 = new ArrayList<String>(); + List<String> connectorClassNames1 = new ArrayList<>(); connectorClassNames1.add("myConnector"); cfp1.setParsedConnectorClassNames(connectorClassNames1); - List<Map<String, Object>> connectionParameters1 = new ArrayList<Map<String, Object>>(); - Map<String, Object> params1 = new HashMap<String, Object>(); + List<Map<String, Object>> connectionParameters1 = new ArrayList<>(); + Map<String, Object> params1 = new HashMap<>(); params1.put("port", "0"); connectionParameters1.add(params1); cfp1.setParsedConnectionParameters(connectionParameters1); cfp1.setAutoGroup(true); ConnectionFactoryProperties cfp2 = new ConnectionFactoryProperties(); - List<String> connectorClassNames2 = new ArrayList<String>(); + List<String> connectorClassNames2 = new ArrayList<>(); connectorClassNames2.add("myConnector"); cfp2.setParsedConnectorClassNames(connectorClassNames2); - List<Map<String, Object>> connectionParameters2 = new ArrayList<Map<String, Object>>(); - Map<String, Object> params2 = new HashMap<String, Object>(); + List<Map<String, Object>> connectionParameters2 = new ArrayList<>(); + Map<String, Object> params2 = new HashMap<>(); params2.put("port", "0"); connectionParameters2.add(params2); cfp2.setParsedConnectionParameters(connectionParameters2); @@ -137,22 +137,22 @@ public class ConnectionFactoryPropertiesTest extends ActiveMQTestBase { @Test public void testInequality() throws Exception { ConnectionFactoryProperties cfp1 = new ConnectionFactoryProperties(); - List<String> connectorClassNames1 = new ArrayList<String>(); + List<String> connectorClassNames1 = new ArrayList<>(); connectorClassNames1.add("myConnector"); cfp1.setParsedConnectorClassNames(connectorClassNames1); - List<Map<String, Object>> connectionParameters1 = new ArrayList<Map<String, Object>>(); - Map<String, Object> params1 = new HashMap<String, Object>(); + List<Map<String, Object>> connectionParameters1 = new ArrayList<>(); + Map<String, Object> params1 = new HashMap<>(); params1.put("port", "0"); connectionParameters1.add(params1); cfp1.setParsedConnectionParameters(connectionParameters1); cfp1.setAutoGroup(true); ConnectionFactoryProperties cfp2 = new ConnectionFactoryProperties(); - List<String> connectorClassNames2 = new ArrayList<String>(); + List<String> connectorClassNames2 = new ArrayList<>(); connectorClassNames2.add("myConnector"); cfp2.setParsedConnectorClassNames(connectorClassNames2); - List<Map<String, Object>> connectionParameters2 = new ArrayList<Map<String, Object>>(); - Map<String, Object> params2 = new HashMap<String, Object>(); + List<Map<String, Object>> connectionParameters2 = new ArrayList<>(); + Map<String, Object> params2 = new HashMap<>(); params2.put("port", "1"); connectionParameters2.add(params2); cfp2.setParsedConnectionParameters(connectionParameters2); @@ -164,22 +164,22 @@ public class ConnectionFactoryPropertiesTest extends ActiveMQTestBase { @Test public void testInequality2() throws Exception { ConnectionFactoryProperties cfp1 = new ConnectionFactoryProperties(); - List<String> connectorClassNames1 = new ArrayList<String>(); + List<String> connectorClassNames1 = new ArrayList<>(); connectorClassNames1.add("myConnector"); cfp1.setParsedConnectorClassNames(connectorClassNames1); - List<Map<String, Object>> connectionParameters1 = new ArrayList<Map<String, Object>>(); - Map<String, Object> params1 = new HashMap<String, Object>(); + List<Map<String, Object>> connectionParameters1 = new ArrayList<>(); + Map<String, Object> params1 = new HashMap<>(); params1.put("port", "0"); connectionParameters1.add(params1); cfp1.setParsedConnectionParameters(connectionParameters1); cfp1.setAutoGroup(true); ConnectionFactoryProperties cfp2 = new ConnectionFactoryProperties(); - List<String> connectorClassNames2 = new ArrayList<String>(); + List<String> connectorClassNames2 = new ArrayList<>(); connectorClassNames2.add("myConnector2"); cfp2.setParsedConnectorClassNames(connectorClassNames2); - List<Map<String, Object>> connectionParameters2 = new ArrayList<Map<String, Object>>(); - Map<String, Object> params2 = new HashMap<String, Object>(); + List<Map<String, Object>> connectionParameters2 = new ArrayList<>(); + Map<String, Object> params2 = new HashMap<>(); params2.put("port", "0"); connectionParameters2.add(params2); cfp2.setParsedConnectionParameters(connectionParameters2); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ResourceAdapterTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ResourceAdapterTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ResourceAdapterTest.java index b476340..8261249 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ResourceAdapterTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ResourceAdapterTest.java @@ -242,7 +242,7 @@ public class ResourceAdapterTest extends ActiveMQTestBase { ActiveMQResourceAdapter ra = new ActiveMQResourceAdapter(); ra.setConnectorClassName(InVMConnectorFactory.class.getName()); ConnectionFactoryProperties connectionFactoryProperties = new ConnectionFactoryProperties(); - ArrayList<String> value = new ArrayList<String>(); + ArrayList<String> value = new ArrayList<>(); value.add(NettyConnectorFactory.class.getName()); connectionFactoryProperties.setParsedConnectorClassNames(value); ActiveMQConnectionFactory factory = ra.createActiveMQConnectionFactory(connectionFactoryProperties); @@ -311,7 +311,7 @@ public class ResourceAdapterTest extends ActiveMQTestBase { ActiveMQResourceAdapter ra = new ActiveMQResourceAdapter(); ra.setConnectorClassName(NETTY_CONNECTOR_FACTORY + "," + INVM_CONNECTOR_FACTORY + "," + NETTY_CONNECTOR_FACTORY); ConnectionFactoryProperties overrideProperties = new ConnectionFactoryProperties(); - ArrayList<String> value = new ArrayList<String>(); + ArrayList<String> value = new ArrayList<>(); value.add(INVM_CONNECTOR_FACTORY); value.add(NETTY_CONNECTOR_FACTORY); value.add(INVM_CONNECTOR_FACTORY); @@ -334,20 +334,20 @@ public class ResourceAdapterTest extends ActiveMQTestBase { ra.setConnectorClassName(NETTY_CONNECTOR_FACTORY + "," + INVM_CONNECTOR_FACTORY + "," + NETTY_CONNECTOR_FACTORY); ra.setConnectionParameters("host=host1;port=61616, serverid=0, host=host2;port=61617"); ConnectionFactoryProperties overrideProperties = new ConnectionFactoryProperties(); - ArrayList<String> value = new ArrayList<String>(); + ArrayList<String> value = new ArrayList<>(); value.add(INVM_CONNECTOR_FACTORY); value.add(NETTY_CONNECTOR_FACTORY); value.add(INVM_CONNECTOR_FACTORY); overrideProperties.setParsedConnectorClassNames(value); - ArrayList<Map<String, Object>> connectionParameters = new ArrayList<Map<String, Object>>(); - Map<String, Object> map1 = new HashMap<String, Object>(); + ArrayList<Map<String, Object>> connectionParameters = new ArrayList<>(); + Map<String, Object> map1 = new HashMap<>(); map1.put("serverid", "0"); connectionParameters.add(map1); - Map<String, Object> map2 = new HashMap<String, Object>(); + Map<String, Object> map2 = new HashMap<>(); map2.put("host", "myhost"); map2.put("port", "61616"); connectionParameters.add(map2); - Map<String, Object> map3 = new HashMap<String, Object>(); + Map<String, Object> map3 = new HashMap<>(); map3.put("serverid", "1"); connectionParameters.add(map3); overrideProperties.setParsedConnectionParameters(connectionParameters); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java index 6d398f1..fddff5d 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMContext.java @@ -177,13 +177,13 @@ public class InVMContext implements Context, Serializable { } } - List<Binding> l = new ArrayList<Binding>(); + List<Binding> l = new ArrayList<>(); for (Object element : map.keySet()) { String name = (String) element; Object object = map.get(name); l.add(new Binding(name, object)); } - return new NamingEnumerationImpl<Binding>(l.iterator()); + return new NamingEnumerationImpl<>(l.iterator()); } @Override @@ -254,7 +254,7 @@ public class InVMContext implements Context, Serializable { @Override public Hashtable<String, String> getEnvironment() throws NamingException { - Hashtable<String, String> env = new Hashtable<String, String>(); + Hashtable<String, String> env = new Hashtable<>(); env.put("java.naming.factory.initial", "org.apache.activemq.artemis.jms.tests.tools.container.InVMInitialContextFactory"); return env; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java index b323902..10000dc 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/InVMNamingContext.java @@ -177,13 +177,13 @@ public class InVMNamingContext implements Context, Serializable { } } - List<Binding> l = new ArrayList<Binding>(); + List<Binding> l = new ArrayList<>(); for (Object element : map.keySet()) { String name = (String) element; Object object = map.get(name); l.add(new Binding(name, object)); } - return new NamingEnumerationImpl<Binding>(l.iterator()); + return new NamingEnumerationImpl<>(l.iterator()); } @Override @@ -254,7 +254,7 @@ public class InVMNamingContext implements Context, Serializable { @Override public Hashtable<String, String> getEnvironment() throws NamingException { - Hashtable<String, String> env = new Hashtable<String, String>(); + Hashtable<String, String> env = new Hashtable<>(); env.put("java.naming.factory.initial", "org.apache.activemq.artemis.jms.tests.tools.container.InVMInitialContextFactory"); return env; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java index 504d499..d035b01a 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java @@ -37,7 +37,7 @@ public class LinkedListTest extends ActiveMQTestBase { public void setUp() throws Exception { super.setUp(); - list = new LinkedListImpl<Integer>(); + list = new LinkedListImpl<>(); } @Test @@ -58,7 +58,7 @@ public class LinkedListTest extends ActiveMQTestBase { } } - LinkedListImpl<MyObject> objs = new LinkedListImpl<MyObject>(); + LinkedListImpl<MyObject> objs = new LinkedListImpl<>(); // Initial add for (int i = 0; i < 100; i++) { @@ -117,7 +117,7 @@ public class LinkedListTest extends ActiveMQTestBase { } } - LinkedListImpl<MyObject> objs = new LinkedListImpl<MyObject>(); + LinkedListImpl<MyObject> objs = new LinkedListImpl<>(); // Initial add for (int i = 1000; i >= 0; i--) { @@ -169,10 +169,10 @@ public class LinkedListTest extends ActiveMQTestBase { while (timeout > System.currentTimeMillis() && count.get() != expected) { seqCount++; if (seqCount > 5) { - LinkedList<String> toOME = new LinkedList<String>(); + LinkedList<String> toOME = new LinkedList<>(); int someCount = 0; try { - WeakReference<Object> ref = new WeakReference<Object>(new Object()); + WeakReference<Object> ref = new WeakReference<>(new Object()); while (ref.get() != null) { toOME.add("sdlfkjshadlfkjhas dlfkjhas dlfkjhads lkjfhads lfkjhads flkjashdf " + someCount++); } @@ -1103,7 +1103,7 @@ public class LinkedListTest extends ActiveMQTestBase { public void testResizing() { int numIters = 1000; - List<LinkedListIterator<Integer>> iters = new java.util.LinkedList<LinkedListIterator<Integer>>(); + List<LinkedListIterator<Integer>> iters = new java.util.LinkedList<>(); int num = 10; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java index 8e45f5d..19d5586 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/ObjectInputStreamWithClassLoaderTest.java @@ -57,7 +57,7 @@ public class ObjectInputStreamWithClassLoaderTest extends ActiveMQTestBase { pathIgnore = classLocation.toString(); } - List<URL> urls = new ArrayList<URL>(); + List<URL> urls = new ArrayList<>(); while (tokenString.hasMoreElements()) { String value = tokenString.nextToken(); URL itemLocation = new File(value).toURI().toURL(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java index 8c0d042..02013a6 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/SoftValueMapTest.java @@ -40,7 +40,7 @@ public class SoftValueMapTest extends ActiveMQTestBase { // each buffer will be 1/10th of the maxMemory int bufferSize = (int) (maxMemory / 100); - SoftValueHashMap<Long, Value> softCache = new SoftValueHashMap<Long, Value>(100); + SoftValueHashMap<Long, Value> softCache = new SoftValueHashMap<>(100); final int MAX_ELEMENTS = 1000; @@ -59,7 +59,7 @@ public class SoftValueMapTest extends ActiveMQTestBase { public void testEvictionsLeastUsed() { forceGC(); - SoftValueHashMap<Long, Value> softCache = new SoftValueHashMap<Long, Value>(200); + SoftValueHashMap<Long, Value> softCache = new SoftValueHashMap<>(200); for (long i = 0; i < 100; i++) { Value v = new Value(new byte[1]); @@ -99,7 +99,7 @@ public class SoftValueMapTest extends ActiveMQTestBase { Value two = new Value(new byte[100]); Value three = new Value(new byte[100]); - SoftValueHashMap<Integer, Value> softCache = new SoftValueHashMap<Integer, Value>(2); + SoftValueHashMap<Integer, Value> softCache = new SoftValueHashMap<>(2); softCache.put(3, three); softCache.put(2, two); softCache.put(1, one); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f8a1c5ba/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java ---------------------------------------------------------------------- diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java index 62cb3a0..a7f5cd0 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/UUIDTest.java @@ -33,7 +33,7 @@ public class UUIDTest extends ActiveMQTestBase { @Test public void testManyUUIDs() throws Exception { - Set<String> uuidsSet = new HashSet<String>(); + Set<String> uuidsSet = new HashSet<>(); UUIDGenerator gen = UUIDGenerator.getInstance(); for (int i = 0; i < getTimes(); i++) {