http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java index 89294c1..9375b6d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java @@ -32,12 +32,15 @@ public class StubTransport extends TransportSupport { private Queue<Object> queue = new ConcurrentLinkedQueue<Object>(); private AtomicInteger receiveCounter; + @Override protected void doStop(ServiceStopper stopper) throws Exception { } + @Override protected void doStart() throws Exception { } + @Override public void oneway(Object command) throws IOException { receiveCounter.incrementAndGet(); queue.add(command); @@ -47,10 +50,12 @@ public class StubTransport extends TransportSupport { return queue; } + @Override public String getRemoteAddress() { return null; } + @Override public int getReceiveCounter() { return receiveCounter.get(); }
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java index a7b5858..c8aadbc 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java @@ -63,6 +63,7 @@ public class TopicClusterTest extends TestCase implements MessageListener { protected List<BrokerService> services = new ArrayList<BrokerService>(); protected String groupId; + @Override protected void setUp() throws Exception { groupId = "topic-cluster-test-" + System.currentTimeMillis(); connections = new Connection[NUMBER_IN_CLUSTER]; @@ -94,6 +95,7 @@ public class TopicClusterTest extends TestCase implements MessageListener { } } + @Override protected void tearDown() throws Exception { if (connections != null) { for (int i = 0; i < connections.length; i++) { @@ -147,6 +149,7 @@ public class TopicClusterTest extends TestCase implements MessageListener { /** * @param msg */ + @Override public void onMessage(Message msg) { // log.info("GOT: " + msg); receivedMessageCount.incrementAndGet(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java index a40e873..18e4cdc 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java @@ -32,10 +32,12 @@ public abstract class TransportBrokerTestSupport extends BrokerTest { protected TransportConnector connector; private ArrayList<StubConnection> connections = new ArrayList<StubConnection>(); + @Override protected void setUp() throws Exception { super.setUp(); } + @Override protected BrokerService createBroker() throws Exception { BrokerService service = super.createBroker(); connector = service.addConnector(getBindLocation()); @@ -44,6 +46,7 @@ public abstract class TransportBrokerTestSupport extends BrokerTest { protected abstract String getBindLocation(); + @Override protected void tearDown() throws Exception { for (Iterator<StubConnection> iter = connections.iterator(); iter.hasNext(); ) { StubConnection connection = iter.next(); @@ -60,6 +63,7 @@ public abstract class TransportBrokerTestSupport extends BrokerTest { return new URI(getBindLocation()); } + @Override protected StubConnection createConnection() throws Exception { URI bindURI = getBindURI(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java index d750243..e9bca3b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java @@ -45,6 +45,7 @@ public class DiscoveryTransportBrokerTest extends NetworkTestSupport { String groupName; + @Override public void setUp() throws Exception { super.setAutoFail(true); super.setUp(); @@ -117,14 +118,17 @@ public class DiscoveryTransportBrokerTest extends NetworkTestSupport { } + @Override protected String getLocalURI() { return "tcp://localhost:0?wireFormat.tcpNoDelayEnabled=true"; } + @Override protected String getRemoteURI() { return "tcp://localhost:0?wireFormat.tcpNoDelayEnabled=true"; } + @Override protected TransportConnector createConnector() throws Exception, IOException, URISyntaxException { TransportConnector x = super.createConnector(); x.setDiscoveryUri(new URI(getDiscoveryUri())); @@ -138,6 +142,7 @@ public class DiscoveryTransportBrokerTest extends NetworkTestSupport { return "multicast://default?group=" + groupName; } + @Override protected TransportConnector createRemoteConnector() throws Exception, IOException, URISyntaxException { TransportConnector x = super.createRemoteConnector(); x.setDiscoveryUri(new URI(getDiscoveryUri())); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/ZeroconfDiscoverTransportTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/ZeroconfDiscoverTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/ZeroconfDiscoverTransportTest.java index 0a3142f..8656d07 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/ZeroconfDiscoverTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/ZeroconfDiscoverTransportTest.java @@ -22,6 +22,7 @@ package org.apache.activemq.transport.discovery; */ public class ZeroconfDiscoverTransportTest extends DiscoveryTransportBrokerTest { + @Override protected String getDiscoveryUri() { return "zeroconf://cheese"; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/AMQ1925Test.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/AMQ1925Test.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/AMQ1925Test.java index e1f9762..4554a0b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/AMQ1925Test.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/AMQ1925Test.java @@ -74,6 +74,7 @@ public class AMQ1925Test extends TestCase implements ExceptionListener { final CountDownLatch starter = new CountDownLatch(1); final AtomicBoolean restarted = new AtomicBoolean(); new Thread(new Runnable() { + @Override public void run() { try { starter.await(); @@ -132,6 +133,7 @@ public class AMQ1925Test extends TestCase implements ExceptionListener { final CountDownLatch starter = new CountDownLatch(1); final AtomicBoolean restarted = new AtomicBoolean(); new Thread(new Runnable() { + @Override public void run() { try { starter.await(); @@ -347,6 +349,7 @@ public class AMQ1925Test extends TestCase implements ExceptionListener { assertQueueLength(MESSAGE_COUNT); } + @Override protected void setUp() throws Exception { exception = null; bs = new BrokerService(); @@ -362,10 +365,12 @@ public class AMQ1925Test extends TestCase implements ExceptionListener { sendMessagesToQueue(); } + @Override protected void tearDown() throws Exception { new ServiceStopper().stop(bs); } + @Override public void onException(JMSException exception) { this.exception = exception; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java index 54f3fe4..8cac09a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/BadConnectionTest.java @@ -51,25 +51,31 @@ public class BadConnectionTest extends TestCase { return TransportFactory.connect(new URI("failover://(tcp://doesNotExist:1234)?useExponentialBackOff=false&maxReconnectAttempts=3&initialReconnectDelay=100")); } + @Override protected void setUp() throws Exception { transport = createTransport(); transport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { } + @Override public void onException(IOException error) { } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); transport.start(); } + @Override protected void tearDown() throws Exception { if (transport != null) { transport.stop(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java index 5d2d0f9..ea09832 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java @@ -113,6 +113,7 @@ public class FailoverConsumerOutstandingCommitTest { // so commit will hang as if reply is lost context.setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker before commit..."); try { @@ -145,6 +146,7 @@ public class FailoverConsumerOutstandingCommitTest { final MessageConsumer testConsumer = consumerSession.createConsumer(destination); testConsumer.setMessageListener(new MessageListener() { + @Override public void onMessage(Message message) { LOG.info("consume one and commit"); @@ -164,6 +166,7 @@ public class FailoverConsumerOutstandingCommitTest { // may block if broker shutodwn happens quickly Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("producer started"); try { @@ -219,6 +222,7 @@ public class FailoverConsumerOutstandingCommitTest { // so commit will hang as if reply is lost context.setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker before commit..."); try { @@ -254,6 +258,7 @@ public class FailoverConsumerOutstandingCommitTest { final MessageConsumer testConsumer = consumerSession.createConsumer(destination); testConsumer.setMessageListener(new MessageListener() { + @Override public void onMessage(Message message) { LOG.info("consume one and commit: " + message); assertNotNull("got message", message); @@ -274,6 +279,7 @@ public class FailoverConsumerOutstandingCommitTest { // may block if broker shutdown happens quickly Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("producer started"); try { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java index b757b02..310e239 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java @@ -113,6 +113,7 @@ public class FailoverConsumerUnconsumedTest { if (++consumerCount == maxConsumers) { context.setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker on consumer: " + info.getConsumerId()); try { @@ -156,6 +157,7 @@ public class FailoverConsumerUnconsumedTest { produceMessage(consumerSession, destination, maxConsumers * prefetch); assertTrue("add messages are delivered", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { int totalDelivered = 0; for (TestConsumer testConsumer : testConsumers) { @@ -170,6 +172,7 @@ public class FailoverConsumerUnconsumedTest { final CountDownLatch shutdownConsumerAdded = new CountDownLatch(1); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { try { LOG.info("add last consumer..."); @@ -205,6 +208,7 @@ public class FailoverConsumerUnconsumedTest { // each should again get prefetch messages - all unacked deliveries should be rolledback assertTrue("after restart all messages are re dispatched", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { int totalDelivered = 0; for (TestConsumer testConsumer : testConsumers) { @@ -217,6 +221,7 @@ public class FailoverConsumerUnconsumedTest { })); assertTrue("after restart each got prefetch amount", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { for (TestConsumer testConsumer : testConsumers) { long delivered = testConsumer.deliveredSize(); @@ -247,6 +252,7 @@ public class FailoverConsumerUnconsumedTest { if (++consumerCount == maxConsumers + (watchTopicAdvisories ? 1 : 0)) { context.setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker on consumer: " + info.getConsumerId()); try { @@ -280,6 +286,7 @@ public class FailoverConsumerUnconsumedTest { produceMessage(consumerSession, destination, maxConsumers * prefetch); assertTrue("add messages are dispatched", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { int totalUnconsumed = 0; for (TestConsumer testConsumer : testConsumers) { @@ -294,6 +301,7 @@ public class FailoverConsumerUnconsumedTest { final CountDownLatch shutdownConsumerAdded = new CountDownLatch(1); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { try { LOG.info("add last consumer..."); @@ -312,6 +320,7 @@ public class FailoverConsumerUnconsumedTest { // verify interrupt assertTrue("add messages dispatched and unconsumed are cleaned up", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { int totalUnconsumed = 0; for (TestConsumer testConsumer : testConsumers) { @@ -330,6 +339,7 @@ public class FailoverConsumerUnconsumedTest { // each should again get prefetch messages - all unconsumed deliveries should be rolledback assertTrue("after start all messages are re dispatched", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { int totalUnconsumed = 0; for (TestConsumer testConsumer : testConsumers) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java index 365379b..e48a699 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java @@ -91,6 +91,7 @@ public class FailoverPrefetchZeroTest { context.setDontSendReponse(true); pullDone.countDown(); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker on pull: " + pull); try { @@ -121,6 +122,7 @@ public class FailoverPrefetchZeroTest { final CountDownLatch receiveDone = new CountDownLatch(1); final Vector<Message> received = new Vector<Message>(); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { try { LOG.info("receive one..."); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java index b4c25c2..54dd3e3 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverRandomTest.java @@ -27,11 +27,13 @@ public class FailoverRandomTest extends TestCase { BrokerService brokerA, brokerB; + @Override public void setUp() throws Exception { brokerA = createBroker("A"); brokerB = createBroker("B"); } + @Override public void tearDown() throws Exception { brokerA.stop(); brokerB.stop(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java index d50c77f..4ee219e 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java @@ -81,12 +81,14 @@ public class FailoverTransactionTest extends TestSupport { return suite(FailoverTransactionTest.class); } + @Override public void setUp() throws Exception { super.setMaxTestTime(2 * 60 * 1000); // some boxes can be real slow super.setAutoFail(true); super.setUp(); } + @Override public void tearDown() throws Exception { super.tearDown(); stopBroker(); @@ -181,6 +183,7 @@ public class FailoverTransactionTest extends TestSupport { // so commit will hang as if reply is lost context.setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker post commit..."); try { @@ -208,6 +211,7 @@ public class FailoverTransactionTest extends TestSupport { final CountDownLatch commitDoneLatch = new CountDownLatch(1); // broker will die on commit reply so this will hang till restart Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("doing async commit..."); try { @@ -279,6 +283,7 @@ public class FailoverTransactionTest extends TestSupport { // so commit will hang as if reply is lost context.setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker post commit..."); try { @@ -306,6 +311,7 @@ public class FailoverTransactionTest extends TestSupport { final CountDownLatch commitDoneLatch = new CountDownLatch(1); // broker will die on commit reply so this will hang till restart Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("doing async commit..."); try { @@ -390,6 +396,7 @@ public class FailoverTransactionTest extends TestSupport { super.send(producerExchange, messageSend); producerExchange.getConnectionContext().setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker post send..."); try { @@ -415,6 +422,7 @@ public class FailoverTransactionTest extends TestSupport { final CountDownLatch sendDoneLatch = new CountDownLatch(1); // broker will die on send reply so this will hang till restart Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("doing async send..."); try { @@ -512,6 +520,7 @@ public class FailoverTransactionTest extends TestSupport { producerExchange.getConnectionContext().setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping connection post send..."); try { @@ -541,6 +550,7 @@ public class FailoverTransactionTest extends TestSupport { final CountDownLatch sendDoneLatch = new CountDownLatch(1); // proxy connection will die on send reply so this will hang on failover reconnect till open Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("doing async send..."); try { @@ -667,12 +677,15 @@ public class FailoverTransactionTest extends TestSupport { final CountDownLatch connectionConsumerGotOne = new CountDownLatch(1); final Session poolSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); connection.createConnectionConsumer(destination, null, new ServerSessionPool() { + @Override public ServerSession getServerSession() throws JMSException { return new ServerSession() { + @Override public Session getSession() throws JMSException { return poolSession; } + @Override public void start() throws JMSException { connectionConsumerGotOne.countDown(); poolSession.run(); @@ -732,6 +745,7 @@ public class FailoverTransactionTest extends TestSupport { consumerExchange.getConnectionContext().setDontSendReponse(true); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker on ack: " + ack); try { @@ -775,6 +789,7 @@ public class FailoverTransactionTest extends TestSupport { final CountDownLatch commitDoneLatch = new CountDownLatch(1); final AtomicBoolean gotTransactionRolledBackException = new AtomicBoolean(false); Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("doing async commit after consume..."); try { @@ -893,6 +908,7 @@ public class FailoverTransactionTest extends TestSupport { public void removeConsumer(ConnectionContext context, final ConsumerInfo info) throws Exception { if (count++ == 1) { Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("Stopping broker on removeConsumer: " + info); try { @@ -957,6 +973,7 @@ public class FailoverTransactionTest extends TestSupport { for (int i = 0; i < consumerCount && !consumers.isEmpty(); i++) { executorService.execute(new Runnable() { + @Override public void run() { MessageConsumer localConsumer = null; try { @@ -1082,6 +1099,7 @@ public class FailoverTransactionTest extends TestSupport { final CountDownLatch commitDone = new CountDownLatch(1); // will block pending re-deliveries Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("doing async commit..."); try { @@ -1136,6 +1154,7 @@ public class FailoverTransactionTest extends TestSupport { // commit may fail if other consumer gets the message on restart Executors.newSingleThreadExecutor().execute(new Runnable() { + @Override public void run() { LOG.info("doing async commit..."); try { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportTest.java index 1cb5daa..9823063 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportTest.java @@ -62,15 +62,19 @@ public class FailoverTransportTest { transport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { } + @Override public void onException(IOException error) { } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); @@ -134,15 +138,19 @@ public class FailoverTransportTest { transport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { } + @Override public void onException(IOException error) { } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); @@ -157,15 +165,19 @@ public class FailoverTransportTest { Transport transport = TransportFactory.connect(new URI("failover://(tcp://localhost:1234?transport.connectTimeout=10000)")); transport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { } + @Override public void onException(IOException error) { } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java index 4f41360..4ba5516 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java @@ -72,18 +72,22 @@ public class ReconnectTest extends TestCase { ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(uri); connection = (ActiveMQConnection) factory.createConnection(); connection.addTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { } + @Override public void onException(IOException error) { setError(error); } + @Override public void transportInterupted() { LOG.info("Worker " + name + " was interrupted..."); interruptedCount.incrementAndGet(); } + @Override public void transportResumed() { LOG.info("Worker " + name + " was resummed..."); resumedCount.incrementAndGet(); @@ -117,6 +121,7 @@ public class ReconnectTest extends TestCase { } } + @Override public void run() { try { ActiveMQQueue queue = new ActiveMQQueue("FOO_" + name); @@ -188,6 +193,7 @@ public class ReconnectTest extends TestCase { } assertTrue("Timed out waiting for all connections to be interrupted.", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { LOG.debug("Test run waiting for connections to get interrupted.. at: " + interruptedCount.get()); return interruptedCount.get() == WORKER_COUNT; @@ -196,6 +202,7 @@ public class ReconnectTest extends TestCase { // Wait for the connections to re-establish... assertTrue("Timed out waiting for all connections to be resumed.", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { LOG.debug("Test run waiting for connections to get resumed.. at: " + resumedCount.get()); return resumedCount.get() >= WORKER_COUNT; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/SlowConnectionTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/SlowConnectionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/SlowConnectionTest.java index 10e3ce2..2826595 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/SlowConnectionTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/SlowConnectionTest.java @@ -46,6 +46,7 @@ public class SlowConnectionTest extends TestCase { final Connection connection = cf.createConnection(); new Thread(new Runnable() { + @Override public void run() { try { connection.start(); @@ -57,6 +58,7 @@ public class SlowConnectionTest extends TestCase { int count = 0; assertTrue("Transport count: " + count + ", expected <= 1", Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { int count = 0; for (Thread thread : Thread.getAllStackTraces().keySet()) { @@ -80,6 +82,7 @@ public class SlowConnectionTest extends TestCase { super("MockBroker"); } + @Override public void run() { List<Socket> inProgress = new ArrayList<Socket>(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java index c97c9f4..dc369be 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTest.java @@ -40,6 +40,7 @@ public class FanoutTest extends TestCase { Session producerSession; int messageCount = 100; + @Override public void setUp() throws Exception { broker1 = BrokerFactory.createBroker("broker:(tcp://localhost:61616)/brokerA?persistent=false&useJmx=false"); broker2 = BrokerFactory.createBroker("broker:(tcp://localhost:61617)/brokerB?persistent=false&useJmx=false"); @@ -55,6 +56,7 @@ public class FanoutTest extends TestCase { producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE); } + @Override public void tearDown() throws Exception { producerSession.close(); producerConnection.close(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java index bf770e3..a60325a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java @@ -152,6 +152,7 @@ public class FanoutTransportBrokerTest extends NetworkTestSupport { // Slip in a new transport filter after the MockTransport MockTransport mt = (MockTransport) connection3.getTransport().narrow(MockTransport.class); mt.install(new TransportFilter(mt.getNext()) { + @Override public void oneway(Object command) throws IOException { LOG.info("Dropping: " + command); // just eat it! to simulate a recent failure. @@ -160,6 +161,7 @@ public class FanoutTransportBrokerTest extends NetworkTestSupport { // Send a message (async) as this will block new Thread() { + @Override public void run() { // Send the message using the fail over publisher. try { @@ -186,10 +188,12 @@ public class FanoutTransportBrokerTest extends NetworkTestSupport { } + @Override protected String getLocalURI() { return "tcp://localhost:61616"; } + @Override protected String getRemoteURI() { return "tcp://localhost:61617"; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java index 0d897f9..e76542b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java @@ -36,6 +36,7 @@ public class MulticastTransportTest extends UdpTransportTest { private String multicastURI = "multicast://224.1.2.3:6255"; + @Override protected Transport createProducer() throws Exception { LOG.info("Producer using URI: " + multicastURI); @@ -50,6 +51,7 @@ public class MulticastTransportTest extends UdpTransportTest { return new CommandJoiner(transport, wireFormat); } + @Override protected Transport createConsumer() throws Exception { OpenWireFormat wireFormat = createWireFormat(); MulticastTransport transport = new MulticastTransport(wireFormat, new URI(multicastURI)); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java index aeca0de..24f69ea 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsDurableTopicSendReceiveTest.java @@ -24,6 +24,7 @@ public class NIOJmsDurableTopicSendReceiveTest extends JmsDurableTopicSendReceiv protected BrokerService broker; + @Override protected void setUp() throws Exception { if (broker == null) { broker = createBroker(); @@ -32,6 +33,7 @@ public class NIOJmsDurableTopicSendReceiveTest extends JmsDurableTopicSendReceiv super.setUp(); } + @Override protected void tearDown() throws Exception { super.tearDown(); if (broker != null) { @@ -39,6 +41,7 @@ public class NIOJmsDurableTopicSendReceiveTest extends JmsDurableTopicSendReceiv } } + @Override protected ActiveMQConnectionFactory createConnectionFactory() { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getBrokerURL()); return connectionFactory; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java index ea22933..1c81ab0 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java @@ -27,6 +27,7 @@ public class NIOJmsSendAndReceiveTest extends JmsTopicSendReceiveWithTwoConnecti protected BrokerService broker; + @Override protected void setUp() throws Exception { if (broker == null) { broker = createBroker(); @@ -35,6 +36,7 @@ public class NIOJmsSendAndReceiveTest extends JmsTopicSendReceiveWithTwoConnecti super.setUp(); } + @Override protected void tearDown() throws Exception { super.tearDown(); if (broker != null) { @@ -42,6 +44,7 @@ public class NIOJmsSendAndReceiveTest extends JmsTopicSendReceiveWithTwoConnecti } } + @Override protected ActiveMQConnectionFactory createConnectionFactory() { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getBrokerURL()); return connectionFactory; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java index cca6b6d..1cb6c39 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOPersistentSendAndReceiveTest.java @@ -24,12 +24,14 @@ public class NIOPersistentSendAndReceiveTest extends NIOJmsSendAndReceiveTest { protected BrokerService broker; + @Override protected void setUp() throws Exception { this.topic = false; this.deliveryMode = DeliveryMode.PERSISTENT; super.setUp(); } + @Override protected BrokerService createBroker() throws Exception { BrokerService answer = new BrokerService(); answer.setPersistent(true); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLLoadTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLLoadTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLLoadTest.java index a3ce6e2..05f26f0 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLLoadTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLLoadTest.java @@ -96,6 +96,7 @@ public class NIOSSLLoadTest extends TestCase { } Wait.waitFor(new Wait.Condition() { + @Override public boolean isSatisified() throws Exception { return getReceived() == PRODUCER_COUNT * MESSAGE_COUNT; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLTransportBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLTransportBrokerTest.java index 605dd06..34c7dbc 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLTransportBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOSSLTransportBrokerTest.java @@ -31,6 +31,7 @@ public class NIOSSLTransportBrokerTest extends TransportBrokerTestSupport { public static final String SERVER_KEYSTORE = "src/test/resources/server.keystore"; public static final String TRUST_KEYSTORE = "src/test/resources/client.keystore"; + @Override protected String getBindLocation() { return "nio+ssl://localhost:0?transport.soWriteTimeout=20000"; } @@ -40,6 +41,7 @@ public class NIOSSLTransportBrokerTest extends TransportBrokerTestSupport { return new URI("nio+ssl://localhost:0?soWriteTimeout=20000"); } + @Override protected void setUp() throws Exception { System.setProperty("javax.net.ssl.trustStore", TRUST_KEYSTORE); System.setProperty("javax.net.ssl.trustStorePassword", PASSWORD); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java index e49562a..a8422d3 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOTransportBrokerTest.java @@ -23,6 +23,7 @@ import org.apache.activemq.transport.TransportBrokerTestSupport; public class NIOTransportBrokerTest extends TransportBrokerTestSupport { + @Override protected String getBindLocation() { return "nio://localhost:61616"; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java index 1037bf5..44bcfbf 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java @@ -123,6 +123,7 @@ public class ReliableTransportTest extends TestCase { } } + @Override protected void setUp() throws Exception { if (replayStrategy == null) { replayStrategy = new ExceptionIfDroppedReplayStrategy(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java index 3bb69ed..c9e7cb0 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java @@ -51,6 +51,7 @@ public class UnreliableCommandDatagramChannel extends CommandDatagramChannel { this.dropCommandStrategy = strategy; } + @Override protected void sendWriteBuffer(int commandId, SocketAddress address, ByteBuffer writeBuffer, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java index 048facd..f315b0b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java @@ -47,6 +47,7 @@ public class UnreliableCommandDatagramSocket extends CommandDatagramSocket { this.dropCommandStrategy = strategy; } + @Override protected void sendWriteBuffer(int commandId, SocketAddress address, byte[] data, http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java index f0606a7..0148595 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java @@ -58,6 +58,7 @@ public class UnreliableUdpTransport extends UdpTransport { this.dropCommandStrategy = dropCommandStrategy; } + @Override protected CommandChannel createCommandDatagramChannel() { return new UnreliableCommandDatagramChannel(this, getWireFormat(), getDatagramSize(), getTargetAddress(), createDatagramHeaderMarshaller(), getReplayBuffer(), getChannel(), getBufferPool(), dropCommandStrategy); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java index 8ab802a..619190f 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java @@ -55,6 +55,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra private final AtomicBoolean ignoreClientError = new AtomicBoolean(false); private final AtomicBoolean ignoreServerError = new AtomicBoolean(false); + @Override protected void setUp() throws Exception { super.setUp(); startTransportServer(); @@ -67,6 +68,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra private void startClient() throws Exception, URISyntaxException { clientTransport = TransportFactory.connect(new URI("tcp://localhost:" + serverPort + "?trace=true&wireFormat.maxInactivityDuration=1000")); clientTransport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { clientReceiveCount.incrementAndGet(); if (clientRunOnCommand != null) { @@ -74,6 +76,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra } } + @Override public void onException(IOException error) { if (!ignoreClientError.get()) { LOG.info("Client transport error:"); @@ -82,9 +85,11 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra } } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); @@ -104,6 +109,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra serverPort = server.getSocketAddress().getPort(); } + @Override protected void tearDown() throws Exception { ignoreClientError.set(true); ignoreServerError.set(true); @@ -124,11 +130,13 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra super.tearDown(); } + @Override public void onAccept(Transport transport) { try { LOG.info("[" + getName() + "] Server Accepted a Connection"); serverTransport = transport; serverTransport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { serverReceiveCount.incrementAndGet(); if (serverRunOnCommand != null) { @@ -136,6 +144,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra } } + @Override public void onException(IOException error) { if (!ignoreClientError.get()) { LOG.info("Server transport error:", error); @@ -143,9 +152,11 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra } } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); @@ -156,6 +167,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra } } + @Override public void onAcceptError(Exception error) { LOG.trace(error.toString()); } @@ -168,6 +180,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra // this should simulate a client hang. clientTransport = new TcpTransport(new OpenWireFormat(), SocketFactory.getDefault(), new URI("tcp://localhost:" + serverPort), null); clientTransport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { clientReceiveCount.incrementAndGet(); if (clientRunOnCommand != null) { @@ -175,6 +188,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra } } + @Override public void onException(IOException error) { if (!ignoreClientError.get()) { LOG.info("Client transport error:"); @@ -183,9 +197,11 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra } } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); @@ -232,6 +248,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra addCombinationValues("clientInactivityLimit", new Object[]{Long.valueOf(1000)}); addCombinationValues("serverInactivityLimit", new Object[]{Long.valueOf(1000)}); addCombinationValues("serverRunOnCommand", new Object[]{new Runnable() { + @Override public void run() { try { LOG.info("Sleeping"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java index 291ebb1..af3dbb7 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java @@ -62,16 +62,19 @@ public class ServerSocketTstFactory extends ServerSocketFactory { this.rnd = new Random(); } + @Override public ServerSocket createServerSocket(int port) throws IOException { ServerSocketTst sSock = new ServerSocketTst(port, this.rnd); return sSock.getSocket(); } + @Override public ServerSocket createServerSocket(int port, int backlog) throws IOException { ServerSocketTst sSock = new ServerSocketTst(port, backlog, this.rnd); return sSock.getSocket(); } + @Override public ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException { ServerSocketTst sSock = new ServerSocketTst(port, backlog, ifAddress, this.rnd); return sSock.getSocket(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslBrokerServiceTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslBrokerServiceTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslBrokerServiceTest.java index dc59997..3a1c9a4 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslBrokerServiceTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslBrokerServiceTest.java @@ -53,6 +53,7 @@ public class SslBrokerServiceTest extends TransportBrokerTestSupport { TransportConnector needClientAuthConnector; TransportConnector limitedCipherSuites; + @Override protected String getBindLocation() { return "ssl://localhost:0"; } @@ -181,6 +182,7 @@ public class SslBrokerServiceTest extends TransportBrokerTestSupport { return out.toByteArray(); } + @Override protected void setUp() throws Exception { maxWait = 10000; super.setUp(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java index dae1249..d1f15ec 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportBrokerTest.java @@ -31,6 +31,7 @@ public class SslTransportBrokerTest extends TransportBrokerTestSupport { public static final String SERVER_KEYSTORE = "src/test/resources/server.keystore"; public static final String TRUST_KEYSTORE = "src/test/resources/client.keystore"; + @Override protected String getBindLocation() { return "ssl://localhost:0?transport.soWriteTimeout=20000"; } @@ -40,6 +41,7 @@ public class SslTransportBrokerTest extends TransportBrokerTestSupport { return new URI("ssl://localhost:0?soWriteTimeout=20000"); } + @Override protected void setUp() throws Exception { System.setProperty("javax.net.ssl.trustStore", TRUST_KEYSTORE); System.setProperty("javax.net.ssl.trustStorePassword", PASSWORD); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java index b69c468..32e26a3 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java @@ -35,10 +35,12 @@ public class SslTransportFactoryTest extends TestCase { private SslTransportFactory factory; private boolean verbose; + @Override protected void setUp() throws Exception { factory = new SslTransportFactory(); } + @Override protected void tearDown() throws Exception { super.tearDown(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java index 9ee0129..31acb07 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java @@ -27,9 +27,11 @@ public class SslTransportServerTest extends TestCase { private SslTransportServer sslTransportServer; private StubSSLServerSocket sslServerSocket; + @Override protected void setUp() throws Exception { } + @Override protected void tearDown() throws Exception { super.tearDown(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java index 2c7a344..0afb981 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportTest.java @@ -41,12 +41,14 @@ public class SslTransportTest extends TestCase { String password; String certDistinguishedName; + @Override protected void setUp() throws Exception { certDistinguishedName = "ThisNameIsDistinguished"; username = "SomeUserName"; password = "SomePassword"; } + @Override protected void tearDown() throws Exception { super.tearDown(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java index 668a7eb..1a5145c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java @@ -42,57 +42,71 @@ public class StubSSLServerSocket extends SSLServerSocket { return needClientAuthStatus; } + @Override public void setWantClientAuth(boolean want) { wantClientAuthStatus = want ? TRUE : FALSE; } + @Override public void setNeedClientAuth(boolean need) { needClientAuthStatus = need ? TRUE : FALSE; } // --- Stubbed methods --- + @Override public boolean getEnableSessionCreation() { return false; } + @Override public String[] getEnabledCipherSuites() { return null; } + @Override public String[] getEnabledProtocols() { return null; } + @Override public boolean getNeedClientAuth() { return false; } + @Override public String[] getSupportedCipherSuites() { return null; } + @Override public String[] getSupportedProtocols() { return null; } + @Override public boolean getUseClientMode() { return false; } + @Override public boolean getWantClientAuth() { return false; } + @Override public void setEnableSessionCreation(boolean flag) { } + @Override public void setEnabledCipherSuites(String[] suites) { } + @Override public void setEnabledProtocols(String[] protocols) { } + @Override public void setUseClientMode(boolean mode) { } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSession.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSession.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSession.java index 76a5d07..df3a0b9 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSession.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSession.java @@ -45,6 +45,7 @@ class StubSSLSession implements SSLSession { this.isVerified = verified; } + @Override public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException { if (this.isVerified) { return new X509Certificate[]{this.cert}; @@ -56,79 +57,99 @@ class StubSSLSession implements SSLSession { // --- Stubbed methods --- + @Override public byte[] getId() { return null; } + @Override public SSLSessionContext getSessionContext() { return null; } + @Override public long getCreationTime() { return 0; } + @Override public long getLastAccessedTime() { return 0; } + @Override public void invalidate() { } + @Override public boolean isValid() { return false; } + @Override public void putValue(String arg0, Object arg1) { } + @Override public Object getValue(String arg0) { return null; } + @Override public void removeValue(String arg0) { } + @Override public String[] getValueNames() { return null; } + @Override public Certificate[] getLocalCertificates() { return null; } + @Override public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { return null; } + @Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { return null; } + @Override public Principal getLocalPrincipal() { return null; } + @Override public String getCipherSuite() { return null; } + @Override public String getProtocol() { return null; } + @Override public String getPeerHost() { return null; } + @Override public int getPeerPort() { return 0; } + @Override public int getPacketBufferSize() { return 0; } + @Override public int getApplicationBufferSize() { return 0; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java index 988a859..c50a0c2 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java @@ -38,10 +38,12 @@ public class StubSSLSocket extends SSLSocket { this.session = ses; } + @Override public void setWantClientAuth(boolean arg0) { this.wantClientAuthStatus = arg0 ? TRUE : FALSE; } + @Override public void setNeedClientAuth(boolean arg0) { this.needClientAuthStatus = arg0 ? TRUE : FALSE; if (session != null) { @@ -49,18 +51,22 @@ public class StubSSLSocket extends SSLSocket { } } + @Override public void setUseClientMode(boolean arg0) { useClientModeStatus = arg0 ? TRUE : FALSE; } + @Override public boolean getWantClientAuth() { return wantClientAuthStatus == TRUE; } + @Override public boolean getNeedClientAuth() { return needClientAuthStatus == TRUE; } + @Override public boolean getUseClientMode() { return useClientModeStatus == TRUE; } @@ -77,46 +83,58 @@ public class StubSSLSocket extends SSLSocket { return useClientModeStatus; } + @Override public SSLSession getSession() { return this.session; } // --- Stubbed methods --- + @Override public String[] getSupportedCipherSuites() { return null; } + @Override public String[] getEnabledCipherSuites() { return null; } + @Override public void setEnabledCipherSuites(String[] arg0) { } + @Override public String[] getSupportedProtocols() { return null; } + @Override public String[] getEnabledProtocols() { return null; } + @Override public void setEnabledProtocols(String[] arg0) { } + @Override public void addHandshakeCompletedListener(HandshakeCompletedListener arg0) { } + @Override public void removeHandshakeCompletedListener(HandshakeCompletedListener arg0) { } + @Override public void startHandshake() throws IOException { } + @Override public void setEnableSessionCreation(boolean arg0) { } + @Override public boolean getEnableSessionCreation() { return false; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocketFactory.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocketFactory.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocketFactory.java index 54e04b5..8e7b461 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocketFactory.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocketFactory.java @@ -31,24 +31,29 @@ public class StubSSLSocketFactory extends SSLServerSocketFactory { retServerSocket = returnServerSocket; } + @Override public ServerSocket createServerSocket(int arg0) throws IOException { return retServerSocket; } + @Override public ServerSocket createServerSocket(int arg0, int arg1) throws IOException { return retServerSocket; } + @Override public ServerSocket createServerSocket(int arg0, int arg1, InetAddress arg2) throws IOException { return retServerSocket; } // --- Stubbed Methods --- + @Override public String[] getDefaultCipherSuites() { return null; } + @Override public String[] getSupportedCipherSuites() { return null; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java index 462f6c7..dc75cc3 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java @@ -32,105 +32,131 @@ public class StubX509Certificate extends X509Certificate { this.id = id; } + @Override public Principal getSubjectDN() { return this.id; } // --- Stubbed Methods --- + @Override public void checkValidity() { } + @Override public void checkValidity(Date arg0) { } + @Override public int getVersion() { return 0; } + @Override public BigInteger getSerialNumber() { return null; } + @Override public Principal getIssuerDN() { return null; } + @Override public Date getNotBefore() { return null; } + @Override public Date getNotAfter() { return null; } + @Override public byte[] getTBSCertificate() { return null; } + @Override public byte[] getSignature() { return null; } + @Override public String getSigAlgName() { return null; } + @Override public String getSigAlgOID() { return null; } + @Override public byte[] getSigAlgParams() { return null; } + @Override public boolean[] getIssuerUniqueID() { return null; } + @Override public boolean[] getSubjectUniqueID() { return null; } + @Override public boolean[] getKeyUsage() { return null; } + @Override public int getBasicConstraints() { return 0; } + @Override public byte[] getEncoded() { return null; } + @Override public void verify(PublicKey arg0) { } + @Override public void verify(PublicKey arg0, String arg1) { } + @Override public String toString() { return null; } + @Override public PublicKey getPublicKey() { return null; } + @Override public boolean hasUnsupportedCriticalExtension() { return false; } + @Override @SuppressWarnings({"unchecked", "rawtypes"}) public Set getCriticalExtensionOIDs() { return null; } + @Override @SuppressWarnings({"unchecked", "rawtypes"}) public Set getNonCriticalExtensionOIDs() { return null; } + @Override public byte[] getExtensionValue(String arg0) { return null; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java index bb6f834..0f0e649 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java @@ -44,6 +44,7 @@ public class TcpFaultyTransport extends TcpTransport implements Transport, Servi /** * @return pretty print of 'this' */ + @Override public String toString() { return "tcpfaulty://" + socket.getInetAddress() + ":" + socket.getPort(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportFactory.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportFactory.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportFactory.java index 77e7b6a..9640169 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportFactory.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportFactory.java @@ -49,6 +49,7 @@ public class TcpFaultyTransportFactory extends TcpTransportFactory { return new TcpFaultyTransport(wf, socketFactory, location, localLocation); } + @Override protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException { URI localLocation = null; String path = location.getPath(); @@ -73,6 +74,7 @@ public class TcpFaultyTransportFactory extends TcpTransportFactory { return new TcpFaultyTransportServer(this, location, serverSocketFactory); } + @Override public TransportServer doBind(final URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); @@ -92,10 +94,12 @@ public class TcpFaultyTransportFactory extends TcpTransportFactory { } } + @Override protected SocketFactory createSocketFactory() throws IOException { return SocketTstFactory.getDefault(); } + @Override protected ServerSocketFactory createServerSocketFactory() throws IOException { return ServerSocketTstFactory.getDefault(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java index f0061d2..029fffd 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java @@ -41,6 +41,7 @@ public class TcpFaultyTransportServer extends TcpTransportServer implements Serv /** * @return pretty print of this */ + @Override public String toString() { return "" + getBindLocation(); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java index 49c4839..1a1be93 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBrokerTest.java @@ -22,10 +22,12 @@ import org.apache.activemq.transport.TransportBrokerTestSupport; public class TcpTransportBrokerTest extends TransportBrokerTestSupport { + @Override protected String getBindLocation() { return "tcp://localhost:0"; } + @Override protected void setUp() throws Exception { maxWait = 2000; super.setUp(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java index 3537794..fb9c7ba 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java @@ -50,6 +50,7 @@ public class WireformatNegociationTest extends CombinationTestSupport { private final CountDownLatch negotiationCounter = new CountDownLatch(2); + @Override protected void setUp() throws Exception { super.setUp(); } @@ -61,6 +62,7 @@ public class WireformatNegociationTest extends CombinationTestSupport { private void startClient(String uri) throws Exception, URISyntaxException { clientTransport = TransportFactory.connect(new URI(uri)); clientTransport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { if (command instanceof WireFormatInfo) { clientWF.set((WireFormatInfo) command); @@ -68,6 +70,7 @@ public class WireformatNegociationTest extends CombinationTestSupport { } } + @Override public void onException(IOException error) { if (!ignoreAsycError.get()) { LOG.info("Client transport error: ", error); @@ -76,9 +79,11 @@ public class WireformatNegociationTest extends CombinationTestSupport { } } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); @@ -93,11 +98,13 @@ public class WireformatNegociationTest extends CombinationTestSupport { private void startServer(String uri) throws IOException, URISyntaxException, Exception { server = TransportFactory.bind(new URI(uri)); server.setAcceptListener(new TransportAcceptListener() { + @Override public void onAccept(Transport transport) { try { LOG.info("[" + getName() + "] Server Accepted a Connection"); serverTransport = transport; serverTransport.setTransportListener(new TransportListener() { + @Override public void onCommand(Object command) { if (command instanceof WireFormatInfo) { serverWF.set((WireFormatInfo) command); @@ -105,6 +112,7 @@ public class WireformatNegociationTest extends CombinationTestSupport { } } + @Override public void onException(IOException error) { if (!ignoreAsycError.get()) { LOG.info("Server transport error: ", error); @@ -113,9 +121,11 @@ public class WireformatNegociationTest extends CombinationTestSupport { } } + @Override public void transportInterupted() { } + @Override public void transportResumed() { } }); @@ -126,6 +136,7 @@ public class WireformatNegociationTest extends CombinationTestSupport { } } + @Override public void onAcceptError(Exception error) { error.printStackTrace(); } @@ -133,6 +144,7 @@ public class WireformatNegociationTest extends CombinationTestSupport { server.start(); } + @Override protected void tearDown() throws Exception { ignoreAsycError.set(true); try { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java index 6c39af1..c476652 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java @@ -22,6 +22,7 @@ package org.apache.activemq.transport.udp; */ public class UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest extends UdpSendReceiveWithTwoConnectionsTest { + @Override protected void setUp() throws Exception { largeMessages = true; messageCount = 2; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/25ae4724/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java ---------------------------------------------------------------------- diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java index 4b65872..d3a342c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java @@ -28,6 +28,7 @@ public class UdpSendReceiveWithTwoConnectionsTest extends JmsTopicSendReceiveWit protected String brokerURI = "udp://localhost:8891"; protected BrokerService broker; + @Override protected void setUp() throws Exception { broker = createBroker(); broker.start(); @@ -35,6 +36,7 @@ public class UdpSendReceiveWithTwoConnectionsTest extends JmsTopicSendReceiveWit super.setUp(); } + @Override protected void tearDown() throws Exception { super.tearDown(); if (broker != null) { @@ -50,6 +52,7 @@ public class UdpSendReceiveWithTwoConnectionsTest extends JmsTopicSendReceiveWit return answer; } + @Override protected ActiveMQConnectionFactory createConnectionFactory() throws Exception { return new ActiveMQConnectionFactory(brokerURI); }