activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1443600 [2/4] - in /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq: perf/ security/ selector/ spring/ store/ store/jdbc/ store/kahadb/ store/kahadb/perf/ test/message/ test/retroactive/ transport/ transport/failover/ ...
Date Thu, 07 Feb 2013 16:43:17 GMT
Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java Thu Feb  7 16:43:15 2013
@@ -20,16 +20,10 @@ package org.apache.activemq.store.jdbc;
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.Properties;
 
-import javax.jms.DeliveryMode;
 import javax.jms.Destination;
-import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
 import javax.jms.XAConnection;
 import javax.jms.XASession;
 import javax.transaction.xa.XAException;
@@ -40,8 +34,6 @@ import org.apache.activemq.ActiveMQXACon
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import junit.framework.TestCase;
-
 // https://issues.apache.org/activemq/browse/AMQ-2880
 public class JDBCXACommitExceptionTest extends JDBCCommitExceptionTest {
     private static final Logger LOG = LoggerFactory.getLogger(JDBCXACommitExceptionTest.class);
@@ -49,7 +41,7 @@ public class JDBCXACommitExceptionTest e
     private long txGenerator = System.currentTimeMillis();
 
     protected ActiveMQXAConnectionFactory factory = new ActiveMQXAConnectionFactory(
-            "tcp://localhost:61616?jms.prefetchPolicy.all=0&jms.redeliveryPolicy.maximumRedeliveries="+messagesExpected); 
+            "tcp://localhost:61616?jms.prefetchPolicy.all=0&jms.redeliveryPolicy.maximumRedeliveries="+messagesExpected);
 
     boolean onePhase = true;
 
@@ -130,7 +122,7 @@ public class JDBCXACommitExceptionTest e
     }
 
     public Xid createXid() throws IOException {
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         DataOutputStream os = new DataOutputStream(baos);
         os.writeLong(++txGenerator);
@@ -138,14 +130,17 @@ public class JDBCXACommitExceptionTest e
         final byte[] bs = baos.toByteArray();
 
         return new Xid() {
+            @Override
             public int getFormatId() {
                 return 86;
             }
 
+            @Override
             public byte[] getGlobalTransactionId() {
                 return bs;
             }
 
+            @Override
             public byte[] getBranchQualifier() {
                 return bs;
             }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/LeaseDatabaseLockerTest.java Thu Feb  7 16:43:15 2013
@@ -16,6 +16,10 @@
  */
 package org.apache.activemq.store.jdbc;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.util.HashSet;
@@ -24,6 +28,7 @@ import java.util.concurrent.ExecutorServ
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.apache.activemq.broker.AbstractLocker;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter;
@@ -33,10 +38,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
-import static junit.framework.Assert.*;
-
-
 public class LeaseDatabaseLockerTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(LeaseDatabaseLockerTest.class);
@@ -190,6 +191,6 @@ public class LeaseDatabaseLockerTest {
     }
 
     private void printLockTable(Connection connection) throws Exception {
-        ((DefaultJDBCAdapter)jdbc.getAdapter()).printQuery(connection, "SELECT * from ACTIVEMQ_LOCK", System.err);
+        DefaultJDBCAdapter.printQuery(connection, "SELECT * from ACTIVEMQ_LOCK", System.err);
     }
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBFastEnqueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBFastEnqueueTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBFastEnqueueTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBFastEnqueueTest.java Thu Feb  7 16:43:15 2013
@@ -16,11 +16,17 @@
  */
 package org.apache.activemq.store.kahadb;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Vector;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
+
 import javax.jms.BytesMessage;
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
@@ -28,6 +34,7 @@ import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
+
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
@@ -41,19 +48,16 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
-import static junit.framework.Assert.*;
-
 public class KahaDBFastEnqueueTest {
     private static final Logger LOG = LoggerFactory.getLogger(KahaDBFastEnqueueTest.class);
     private BrokerService broker;
     private ActiveMQConnectionFactory connectionFactory;
     KahaDBPersistenceAdapter kahaDBPersistenceAdapter;
-    private Destination destination = new ActiveMQQueue("Test");
-    private String payloadString = new String(new byte[6*1024]);
-    private boolean useBytesMessage= true;
+    private final Destination destination = new ActiveMQQueue("Test");
+    private final String payloadString = new String(new byte[6*1024]);
+    private final boolean useBytesMessage= true;
     private final int parallelProducer = 20;
-    private Vector<Exception> exceptions = new Vector<Exception>();
+    private final Vector<Exception> exceptions = new Vector<Exception>();
     long toSend = 10000;
 
     // use with:

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBStoreRecoveryBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBStoreRecoveryBrokerTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBStoreRecoveryBrokerTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBStoreRecoveryBrokerTest.java Thu Feb  7 16:43:15 2013
@@ -16,27 +16,36 @@
  */
 package org.apache.activemq.store.kahadb;
 
+import java.io.File;
+import java.io.RandomAccessFile;
+import java.util.ArrayList;
+
 import junit.framework.Test;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.RecoveryBrokerTest;
 import org.apache.activemq.broker.StubConnection;
-import org.apache.activemq.command.*;
-
-import java.io.File;
-import java.io.RandomAccessFile;
-import java.util.ArrayList;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ConnectionInfo;
+import org.apache.activemq.command.ConsumerInfo;
+import org.apache.activemq.command.Message;
+import org.apache.activemq.command.MessageAck;
+import org.apache.activemq.command.ProducerInfo;
+import org.apache.activemq.command.SessionInfo;
 
 
 /**
- * Used to verify that recovery works correctly against 
- * 
- * 
+ * Used to verify that recovery works correctly against
+ *
+ *
  */
 public class KahaDBStoreRecoveryBrokerTest extends RecoveryBrokerTest {
 
     enum CorruptionType { None, FailToLoad, LoadInvalid, LoadCorrupt };
     public CorruptionType  failTest = CorruptionType.None;
 
+    @Override
     protected BrokerService createBroker() throws Exception {
         BrokerService broker = new BrokerService();
         KahaDBStore kaha = new KahaDBStore();
@@ -45,7 +54,9 @@ public class KahaDBStoreRecoveryBrokerTe
         broker.setPersistenceAdapter(kaha);
         return broker;
     }
-    
+
+    @Override
+    @SuppressWarnings("resource")
     protected BrokerService createRestartedBroker() throws Exception {
 
         // corrupting index
@@ -82,11 +93,11 @@ public class KahaDBStoreRecoveryBrokerTe
         broker.setPersistenceAdapter(kaha);
         return broker;
     }
-    
+
     public static Test suite() {
         return suite(KahaDBStoreRecoveryBrokerTest.class);
     }
-    
+
     public static void main(String[] args) {
         junit.textui.TestRunner.run(suite());
     }
@@ -107,9 +118,9 @@ public class KahaDBStoreRecoveryBrokerTe
         connection.send(connectionInfo);
         connection.send(sessionInfo);
         connection.send(producerInfo);
-        
+
         ArrayList<String> expected = new ArrayList<String>();
-        
+
         int MESSAGE_COUNT = 10000;
         for(int i=0; i < MESSAGE_COUNT; i++) {
             Message message = createMessage(producerInfo, destination);
@@ -140,9 +151,9 @@ public class KahaDBStoreRecoveryBrokerTe
             MessageAck ack = createAck(consumerInfo, m, 1, MessageAck.STANDARD_ACK_TYPE);
             connection.send(ack);
         }
-        
+
         connection.request(closeConnectionInfo(connectionInfo));
-        
+
         // restart the broker.
         restartBroker();
 
@@ -161,10 +172,10 @@ public class KahaDBStoreRecoveryBrokerTe
             assertEquals(expected.get(i), m.getMessageId().toString());
             MessageAck ack = createAck(consumerInfo, m, 1, MessageAck.STANDARD_ACK_TYPE);
             connection.send(ack);
-            
-            
+
+
         }
-        
+
         connection.request(closeConnectionInfo(connectionInfo));
     }
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBStoreRecoveryExpiryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBStoreRecoveryExpiryTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBStoreRecoveryExpiryTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBStoreRecoveryExpiryTest.java Thu Feb  7 16:43:15 2013
@@ -16,13 +16,18 @@
  */
 package org.apache.activemq.store.kahadb;
 
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 import java.util.concurrent.TimeUnit;
+
 import javax.jms.ConnectionFactory;
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
+
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
@@ -35,15 +40,11 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-
 public class KahaDBStoreRecoveryExpiryTest {
 
     private BrokerService broker;
     private ActiveMQConnection connection;
-    private Destination destination = new ActiveMQQueue("Test");
+    private final Destination destination = new ActiveMQQueue("Test");
     private Session session;
 
     @Test

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/KahaDBTest.java Thu Feb  7 16:43:15 2013
@@ -16,16 +16,21 @@
  */
 package org.apache.activemq.store.kahadb;
 
-import junit.framework.TestCase;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.command.ActiveMQQueue;
-
-import javax.jms.*;
 import java.io.File;
 import java.io.IOException;
 import java.io.RandomAccessFile;
-import java.io.FileNotFoundException;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
+import junit.framework.TestCase;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.command.ActiveMQQueue;
 
 /**
  * @author chirino
@@ -39,7 +44,6 @@ public class KahaDBTest extends TestCase
         broker.setPersistenceAdapter(kaha);
         broker.start();
         return broker;
-
     }
 
     private KahaDBStore createStore(boolean delete) throws IOException {
@@ -95,7 +99,7 @@ public class KahaDBTest extends TestCase
 
         // We know we won't get all the messages but we should get most of them.
         int count = receiveMessages();
-        assertTrue( count > 800 ); 
+        assertTrue( count > 800 );
         assertTrue( count < 1000 );
 
         broker.stop();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/PBMesssagesTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/PBMesssagesTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/PBMesssagesTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/PBMesssagesTest.java Thu Feb  7 16:43:15 2013
@@ -23,33 +23,34 @@ import junit.framework.TestCase;
 import org.apache.activemq.protobuf.Buffer;
 import org.apache.activemq.store.kahadb.data.KahaAddMessageCommand;
 import org.apache.activemq.store.kahadb.data.KahaDestination;
-import org.apache.activemq.store.kahadb.data.KahaEntryType;
 import org.apache.activemq.store.kahadb.data.KahaDestination.DestinationType;
+import org.apache.activemq.store.kahadb.data.KahaEntryType;
 import org.apache.activemq.util.ByteSequence;
 import org.apache.activemq.util.DataByteArrayInputStream;
 import org.apache.activemq.util.DataByteArrayOutputStream;
 
 public class PBMesssagesTest extends TestCase {
 
+    @SuppressWarnings("rawtypes")
     public void testKahaAddMessageCommand() throws IOException {
 
        KahaAddMessageCommand expected = new KahaAddMessageCommand();
        expected.setDestination(new KahaDestination().setName("Foo").setType(DestinationType.QUEUE));
        expected.setMessage(new Buffer(new byte[] {1,2,3,4,5,6} ));
        expected.setMessageId("Hello World");
-       
+
        int size = expected.serializedSizeFramed();
        DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1);
        os.writeByte(expected.type().getNumber());
        expected.writeFramed(os);
        ByteSequence seq = os.toByteSequence();
-       
+
        DataByteArrayInputStream is = new DataByteArrayInputStream(seq);
        KahaEntryType type = KahaEntryType.valueOf(is.readByte());
        JournalCommand message = (JournalCommand)type.createMessage();
        message.mergeFramed(is);
-       
+
        assertEquals(expected, message);
     }
-    
+
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/perf/KahaBulkLoadingTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/perf/KahaBulkLoadingTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/perf/KahaBulkLoadingTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/store/kahadb/perf/KahaBulkLoadingTest.java Thu Feb  7 16:43:15 2013
@@ -20,12 +20,10 @@ import java.io.File;
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.jms.BytesMessage;
 import javax.jms.ConnectionFactory;
 import javax.jms.DeliveryMode;
-import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
@@ -35,18 +33,16 @@ import junit.framework.Test;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.JmsTestSupport;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.ProgressPrinter;
-import org.apache.activemq.broker.TransportConnector;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.store.kahadb.KahaDBStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.activemq.store.kahadb.KahaDBStore;
 
 /**
  * This tests bulk loading and unloading of messages to a Queue.s
- * 
- * 
+ *
+ *
  */
 public class KahaBulkLoadingTest extends JmsTestSupport {
 
@@ -54,6 +50,7 @@ public class KahaBulkLoadingTest extends
 
     protected int messageSize = 1024 * 4;
 
+    @Override
     protected BrokerService createBroker() throws Exception {
         BrokerService broker = new BrokerService();
         KahaDBStore kaha = new KahaDBStore();
@@ -64,8 +61,9 @@ public class KahaBulkLoadingTest extends
         return broker;
     }
 
+    @Override
     protected ConnectionFactory createConnectionFactory() throws URISyntaxException, IOException {
-        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(((TransportConnector)broker.getTransportConnectors().get(0)).getServer().getConnectURI());
+        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(broker.getTransportConnectors().get(0).getServer().getConnectURI());
         factory.setUseAsyncSend(true);
         return factory;
     }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java Thu Feb  7 16:43:15 2013
@@ -30,13 +30,14 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Tests that a Message can have nested Map and List properties attached.
- * 
- * 
+ *
  */
 public class NestedMapAndListPropertyTest extends JmsTopicSendReceiveWithTwoConnectionsAndEmbeddedBrokerTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(NestedMapAndListPropertyTest.class);
 
+    @Override
+    @SuppressWarnings("rawtypes")
     protected void assertMessageValid(int index, Message message) throws JMSException {
         Object value = message.getObjectProperty("textField");
         assertEquals("textField", data[index], value);
@@ -69,6 +70,7 @@ public class NestedMapAndListPropertyTes
         assertEquals("JohnDoe", message.getStringProperty("JMSXUserID"));
     }
 
+    @Override
     protected Message createMessage(int index) throws JMSException {
         Message answer = session.createMessage();
 
@@ -90,5 +92,4 @@ public class NestedMapAndListPropertyTes
 
         return answer;
     }
-
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java Thu Feb  7 16:43:15 2013
@@ -30,12 +30,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 
+ *
  */
 public class NestedMapMessageTest extends JmsTopicSendReceiveWithTwoConnectionsAndEmbeddedBrokerTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(NestedMapMessageTest.class);
 
+    @Override
+    @SuppressWarnings("rawtypes")
     protected void assertMessageValid(int index, Message message) throws JMSException {
         assertTrue("Should be a MapMessage: " + message, message instanceof MapMessage);
 
@@ -71,6 +73,7 @@ public class NestedMapMessageTest extend
         assertEquals("listField[2]", "c", list.get(2));
     }
 
+    @Override
     protected Message createMessage(int index) throws JMSException {
         MapMessage answer = session.createMapMessage();
 

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java Thu Feb  7 16:43:15 2013
@@ -31,13 +31,12 @@ import org.apache.activemq.ActiveMQConne
 import org.apache.activemq.EmbeddedBrokerTestSupport;
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.test.TemporaryDestinationToFromNameTest;
 import org.apache.activemq.util.MessageIdList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 
+ *
  */
 public class RetroactiveConsumerTestWithSimpleMessageListTest extends EmbeddedBrokerTestSupport {
     private static final Logger LOG = LoggerFactory.getLogger(RetroactiveConsumerTestWithSimpleMessageListTest.class);
@@ -72,12 +71,14 @@ public class RetroactiveConsumerTestWith
 
     }
 
+    @Override
     protected void setUp() throws Exception {
         useTopic = true;
         bindAddress = "vm://localhost";
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         if (session != null) {
             session.close();
@@ -89,18 +90,21 @@ public class RetroactiveConsumerTestWith
         super.tearDown();
     }
 
+    @Override
     protected ConnectionFactory createConnectionFactory() throws Exception {
         ActiveMQConnectionFactory answer = new ActiveMQConnectionFactory(bindAddress);
         answer.setUseRetroactiveConsumer(true);
         return answer;
     }
 
+    @Override
     protected BrokerService createBroker() throws Exception {
         String uri = getBrokerXml();
         LOG.info("Loading broker configuration from the classpath with URI: " + uri);
         return BrokerFactory.createBroker(new URI("xbean:" + uri));
     }
 
+    @Override
     protected void startBroker() throws Exception {
         // broker already started by XBean
     }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java Thu Feb  7 16:43:15 2013
@@ -30,17 +30,16 @@ import org.apache.activemq.ActiveMQConne
 import org.apache.activemq.EmbeddedBrokerTestSupport;
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.usecases.CreateLotsOfTemporaryQueuesTest;
 import org.apache.activemq.util.MessageIdList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 
+ *
  */
 public class RetroactiveConsumerWithMessageQueryTest extends EmbeddedBrokerTestSupport {
     private static final Logger LOG = LoggerFactory.getLogger(RetroactiveConsumerWithMessageQueryTest.class);
-    
+
     protected int messageCount = 20;
     protected Connection connection;
     protected Session session;
@@ -69,12 +68,14 @@ public class RetroactiveConsumerWithMess
         listener.assertMessagesReceived(messageCount);
     }
 
+    @Override
     protected void setUp() throws Exception {
         useTopic = true;
         bindAddress = "vm://localhost";
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         if (session != null) {
             session.close();
@@ -86,6 +87,7 @@ public class RetroactiveConsumerWithMess
         super.tearDown();
     }
 
+    @Override
     protected ConnectionFactory createConnectionFactory() throws Exception {
         ActiveMQConnectionFactory answer = new ActiveMQConnectionFactory(bindAddress);
         // answer.setUseRetroactiveConsumer(true);
@@ -93,12 +95,14 @@ public class RetroactiveConsumerWithMess
         return answer;
     }
 
+    @Override
     protected BrokerService createBroker() throws Exception {
         String uri = getBrokerXml();
         LOG.info("Loading broker configuration from the classpath with URI: " + uri);
         return BrokerFactory.createBroker(new URI("xbean:" + uri));
     }
 
+    @Override
     protected void startBroker() throws Exception {
         // broker already started by XBean
     }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/StubTransportListener.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/StubTransportListener.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/StubTransportListener.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/StubTransportListener.java Thu Feb  7 16:43:15 2013
@@ -21,33 +21,37 @@ import java.util.Queue;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
 /**
- * 
- * 
+ *
+ *
  */
 public class StubTransportListener implements TransportListener {
 
-    private Queue commands = new ConcurrentLinkedQueue();
-    private Queue exceptions = new ConcurrentLinkedQueue();
+    private final Queue<Object> commands = new ConcurrentLinkedQueue<Object>();
+    private final Queue<Object> exceptions = new ConcurrentLinkedQueue<Object>();
 
-    public Queue getCommands() {
+    public Queue<Object> getCommands() {
         return commands;
     }
 
-    public Queue getExceptions() {
+    public Queue<Object> getExceptions() {
         return exceptions;
     }
 
+    @Override
     public void onCommand(Object command) {
         commands.add(command);
     }
 
+    @Override
     public void onException(IOException error) {
         exceptions.add(error);
     }
 
+    @Override
     public void transportInterupted() {
     }
 
+    @Override
     public void transportResumed() {
     }
 

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java Thu Feb  7 16:43:15 2013
@@ -21,6 +21,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
+
 import javax.jms.Connection;
 import javax.jms.JMSException;
 import javax.jms.Message;
@@ -30,6 +31,7 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.TestSupport;
 import org.apache.activemq.broker.BrokerPlugin;
@@ -49,7 +51,7 @@ public class FailoverDuplicateTest exten
     private String url;
     BrokerService broker;
 
-
+    @Override
     public void tearDown() throws Exception {
         stopBroker();
     }
@@ -60,10 +62,6 @@ public class FailoverDuplicateTest exten
         }
     }
 
-    private void startCleanBroker() throws Exception {
-        startBroker(true);
-    }
-
     public void startBroker(boolean deleteAllMessagesOnStartup) throws Exception {
         broker = createBroker(deleteAllMessagesOnStartup);
         broker.start();
@@ -115,6 +113,7 @@ public class FailoverDuplicateTest exten
                         if (first.compareAndSet(false, true)) {
                             producerExchange.getConnectionContext().setDontSendReponse(true);
                             Executors.newSingleThreadExecutor().execute(new Runnable() {
+                                @Override
                                 public void run() {
                                     try {
                                         LOG.info("Waiting for recepit");
@@ -160,6 +159,7 @@ public class FailoverDuplicateTest exten
         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 {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBackupsTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBackupsTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBackupsTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBackupsTest.java Thu Feb  7 16:43:15 2013
@@ -40,8 +40,6 @@ public class FailoverTransportBackupsTes
 
     protected Transport transport;
     protected FailoverTransport failoverTransport;
-    private int commandsReceived;
-    private int exceptionReceived;
     private int transportInterruptions;
     private int transportResumptions;
 
@@ -64,8 +62,6 @@ public class FailoverTransportBackupsTes
         broker3.waitUntilStarted();
 
         // Reset stats
-        commandsReceived = 0;
-        exceptionReceived = 0;
         transportInterruptions = 0;
         transportResumptions = 0;
     }
@@ -92,6 +88,7 @@ public class FailoverTransportBackupsTes
         assertEquals(2, failoverTransport.getBackupPoolSize());
 
         assertTrue("Timed out waiting for Backups to connect.", Wait.waitFor(new Wait.Condition(){
+            @Override
             public boolean isSatisified() throws Exception {
                 LOG.debug("Current Backup Count = " + failoverTransport.getCurrentBackups());
                 return failoverTransport.getCurrentBackups() == 2;
@@ -107,6 +104,7 @@ public class FailoverTransportBackupsTes
         assertEquals(2, failoverTransport.getBackupPoolSize());
 
         assertTrue("Timed out waiting for Backups to connect.", Wait.waitFor(new Wait.Condition(){
+            @Override
             public boolean isSatisified() throws Exception {
                 LOG.debug("Current Backup Count = " + failoverTransport.getCurrentBackups());
                 return failoverTransport.getCurrentBackups() == 2;
@@ -116,6 +114,7 @@ public class FailoverTransportBackupsTes
         broker1.stop();
 
         assertTrue("Timed out waiting for Backups to connect.", Wait.waitFor(new Wait.Condition(){
+            @Override
             public boolean isSatisified() throws Exception {
                 LOG.debug("Current Backup Count = " + failoverTransport.getCurrentBackups());
                 return failoverTransport.getCurrentBackups() == 1;
@@ -128,6 +127,7 @@ public class FailoverTransportBackupsTes
         broker2.stop();
 
         assertTrue("Timed out waiting for Backups to connect.", Wait.waitFor(new Wait.Condition(){
+            @Override
             public boolean isSatisified() throws Exception {
                 LOG.debug("Current Backup Count = " + failoverTransport.getCurrentBackups());
                 return failoverTransport.getCurrentBackups() == 0;
@@ -146,6 +146,7 @@ public class FailoverTransportBackupsTes
         assertEquals(1, failoverTransport.getBackupPoolSize());
 
         assertTrue("Timed out waiting for Backups to connect.", Wait.waitFor(new Wait.Condition(){
+            @Override
             public boolean isSatisified() throws Exception {
                 LOG.debug("Current Backup Count = " + failoverTransport.getCurrentBackups());
                 return failoverTransport.getCurrentBackups() == 1;
@@ -155,6 +156,7 @@ public class FailoverTransportBackupsTes
         broker1.stop();
 
         assertTrue("Timed out waiting for Backups to connect.", Wait.waitFor(new Wait.Condition(){
+            @Override
             public boolean isSatisified() throws Exception {
                 LOG.debug("Current Backup Count = " + failoverTransport.getCurrentBackups());
                 return failoverTransport.getCurrentBackups() == 1;
@@ -164,6 +166,7 @@ public class FailoverTransportBackupsTes
         broker2.stop();
 
         assertTrue("Timed out waiting for Backups to connect.", Wait.waitFor(new Wait.Condition(){
+            @Override
             public boolean isSatisified() throws Exception {
                 LOG.debug("Current Backup Count = " + failoverTransport.getCurrentBackups());
                 return failoverTransport.getCurrentBackups() == 0;
@@ -193,21 +196,23 @@ public class FailoverTransportBackupsTes
         Transport transport = TransportFactory.connect(new URI(connectionUri));
         transport.setTransportListener(new TransportListener() {
 
+            @Override
             public void onCommand(Object command) {
                 LOG.debug("Test Transport Listener received Command: " + command);
-                commandsReceived++;
             }
 
+            @Override
             public void onException(IOException error) {
                 LOG.debug("Test Transport Listener received Exception: " + error);
-                exceptionReceived++;
             }
 
+            @Override
             public void transportInterupted() {
                 transportInterruptions++;
                 LOG.debug("Test Transport Listener records transport Interrupted: " + transportInterruptions);
             }
 
+            @Override
             public void transportResumed() {
                 transportResumptions++;
                 LOG.debug("Test Transport Listener records transport Resumed: " + transportResumptions);

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java Thu Feb  7 16:43:15 2013
@@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit;
 import javax.jms.DeliveryMode;
 
 import junit.framework.Test;
+
 import org.apache.activemq.broker.StubConnection;
 import org.apache.activemq.broker.TransportConnector;
 import org.apache.activemq.command.ActiveMQDestination;
@@ -152,15 +153,16 @@ public class FailoverTransportBrokerTest
         assertNull("no peer brokers present", info[0].getPeerBrokerInfos());
     }
 
+    @Override
     protected String getLocalURI() {
         return "tcp://localhost:0?wireFormat.tcpNoDelayEnabled=true";
     }
 
+    @Override
     protected String getRemoteURI() {
         return "tcp://localhost:0?wireFormat.tcpNoDelayEnabled=true";
     }
 
-    @SuppressWarnings("unchecked")
     protected StubConnection createFailoverConnection(TransportListener listener) throws Exception {
         URI failoverURI = new URI("failover://" + connector.getServer().getConnectURI() + "," + remoteConnector.getServer().getConnectURI() + "");
         Transport transport = TransportFactory.connect(failoverURI);

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java Thu Feb  7 16:43:15 2013
@@ -27,6 +27,7 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 
 import junit.framework.TestCase;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.advisory.AdvisorySupport;
 import org.apache.activemq.command.ActiveMQDestination;
@@ -40,13 +41,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 
+ *
  */
 public class PeerTransportTest extends TestCase {
     protected static final int MESSAGE_COUNT = 50;
     protected static final int NUMBER_IN_CLUSTER = 3;
     private static final Logger LOG = LoggerFactory.getLogger(PeerTransportTest.class);
-    
+
     protected ActiveMQDestination destination;
     protected boolean topic = true;
     protected int deliveryMode = DeliveryMode.NON_PERSISTENT;
@@ -54,6 +55,7 @@ public class PeerTransportTest extends T
     protected Connection[] connections;
     protected MessageIdList messageIdList[];
 
+    @Override
     protected void setUp() throws Exception {
 
         connections = new Connection[NUMBER_IN_CLUSTER];
@@ -61,8 +63,6 @@ public class PeerTransportTest extends T
         messageIdList = new MessageIdList[NUMBER_IN_CLUSTER];
         ActiveMQDestination destination = createDestination();
 
-        String root = System.getProperty("activemq.store.dir");
-
         for (int i = 0; i < NUMBER_IN_CLUSTER; i++) {
             connections[i] = createConnection(i);
             connections[i].setClientID("ClusterTest" + i);
@@ -102,6 +102,7 @@ public class PeerTransportTest extends T
         LOG.info("Cluster is online.");
     }
 
+    @Override
     protected void tearDown() throws Exception {
         if (connections != null) {
             for (int i = 0; i < connections.length; i++) {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java Thu Feb  7 16:43:15 2013
@@ -20,7 +20,6 @@ import java.net.SocketAddress;
 import java.net.URI;
 
 import org.apache.activemq.openwire.OpenWireFormat;
-import org.apache.activemq.test.JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest;
 import org.apache.activemq.transport.CommandJoiner;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.udp.ResponseRedirectInterceptor;
@@ -30,14 +29,15 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 
- * 
+ *
+ *
  */
 public class UnreliableUdpTransportTest extends UdpTransportTest {
     private static final Logger LOG = LoggerFactory.getLogger(UnreliableUdpTransportTest.class);
 
     protected DropCommandStrategy dropStrategy = new DropCommandStrategy() {
-        
+
+        @Override
         public boolean shouldDropCommand(int commandId, SocketAddress address, boolean redelivery) {
             if (redelivery) {
                 return false;
@@ -46,6 +46,7 @@ public class UnreliableUdpTransportTest 
         }
     };
 
+    @Override
     protected Transport createProducer() throws Exception {
         LOG.info("Producer using URI: " + producerURI);
 
@@ -60,6 +61,7 @@ public class UnreliableUdpTransportTest 
         return new CommandJoiner(reliableTransport, wireFormat);
     }
 
+    @Override
     protected Transport createConsumer() throws Exception {
         LOG.info("Consumer on port: " + consumerPort);
         OpenWireFormat wireFormat = createWireFormat();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/QualityOfServiceUtilsTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/QualityOfServiceUtilsTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/QualityOfServiceUtilsTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/QualityOfServiceUtilsTest.java Thu Feb  7 16:43:15 2013
@@ -19,6 +19,7 @@ package org.apache.activemq.transport.tc
 import java.net.Socket;
 import java.util.HashMap;
 import java.util.Map;
+
 import junit.framework.TestCase;
 
 public class QualityOfServiceUtilsTest extends TestCase {
@@ -33,6 +34,7 @@ public class QualityOfServiceUtilsTest e
     protected void setUp() throws Exception {
         Socket socket = new Socket();
         ECN = socket.getTrafficClass() & Integer.parseInt("00000011", 2);
+        socket.close();
     }
 
     @Override
@@ -104,13 +106,13 @@ public class QualityOfServiceUtilsTest e
 
     private void testInvalidDiffServName(String name) {
         try {
-            int dscp = QualityOfServiceUtils.getDSCP(name);
+            QualityOfServiceUtils.getDSCP(name);
             fail("No IllegalArgumentException thrown for invalid Differentiated"
                  + " Services value: " + name + ".");
         } catch (IllegalArgumentException e) {
         }
     }
-    
+
     private void testValidDiffServIntegerValue(int val) {
         try {
             int dscp = QualityOfServiceUtils.getDSCP(Integer.toString(val));
@@ -125,7 +127,7 @@ public class QualityOfServiceUtilsTest e
 
     private void testInvalidDiffServIntegerValue(int val) {
         try {
-            int dscp = QualityOfServiceUtils.getDSCP(Integer.toString(val));
+            QualityOfServiceUtils.getDSCP(Integer.toString(val));
             fail("No IllegalArgumentException thrown for invalid "
                 + "Differentiated Services value " + val + ".");
         } catch (IllegalArgumentException expected) {
@@ -159,7 +161,7 @@ public class QualityOfServiceUtilsTest e
 
     private void testInvalidTypeOfServiceValue(int val) {
         try {
-            int typeOfService = QualityOfServiceUtils.getToS(val);
+            QualityOfServiceUtils.getToS(val);
             fail("No IllegalArgumentException thrown for invalid "
                 + "Type of Service value " + val + ".");
         } catch (IllegalArgumentException expected) {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SocketTstFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SocketTstFactory.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SocketTstFactory.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SocketTstFactory.java Thu Feb  7 16:43:15 2013
@@ -22,152 +22,157 @@ import java.net.Socket;
 import java.net.UnknownHostException;
 import java.util.Random;
 import java.util.concurrent.ConcurrentHashMap;
+
 import javax.net.SocketFactory;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 
+ *
  *
  * Automatically generated socket.close() calls to simulate network faults
  */
 public class SocketTstFactory extends SocketFactory {
     private static final Logger LOG = LoggerFactory.getLogger(SocketTstFactory.class);
 
-    private static final ConcurrentHashMap<InetAddress, Integer>	closeIter = new ConcurrentHashMap<InetAddress, Integer>();
+    private static final ConcurrentHashMap<InetAddress, Integer> closeIter = new ConcurrentHashMap<InetAddress, Integer>();
 
     private class SocketTst {
 
-	private class Bagot implements Runnable {
-		private Thread			processus;
-		private Random	rnd;
-		private Socket			socket;
-		private final InetAddress	address;
-
-		public Bagot(Random rnd, Socket socket, InetAddress address) {
-			this.processus  = new Thread(this, "Network Faults maker : undefined");
-			this.rnd	= rnd;
-			this.socket	= socket;
-			this.address	= address;
-		}
-
-		public void start() {
-			this.processus.setName("Network Faults maker : " + this.socket.toString());
-			this.processus.start();
-		}
-
-		public void run () {
-			int 	lastDelayVal;
-			Integer lastDelay;
-			while (!this.processus.isInterrupted()) {
-				if (!this.socket.isClosed()) {
-					try {
-						lastDelay = closeIter.get(this.address);
-						if (lastDelay == null) { 
-							lastDelayVal = 0;
-						}
-						else {
-							lastDelayVal = lastDelay.intValue();
-							if (lastDelayVal > 10)
-								lastDelayVal += 20;
-							else	lastDelayVal += 1;	
-						}
-
-						lastDelay = new Integer(lastDelayVal);
-
-						LOG.info("Trying to close client socket " + socket.toString() +  " in " + lastDelayVal + " milliseconds");
-
-						try {
-							Thread.sleep(lastDelayVal);
-						} catch (InterruptedException e) {
-							this.processus.interrupt();
-							Thread.currentThread().interrupt();
-						} catch (IllegalArgumentException e) {
-						}
-							
-						this.socket.close();
-						closeIter.put(this.address, lastDelay);
-						LOG.info("Client socket " + this.socket.toString() + " is closed.");
-					} catch (IOException e) {
-					}
-				}
-
-				this.processus.interrupt();
-			}
-		}
-	}
-
-	private	final Bagot		bagot;
-	private final Socket		socket;
-
-	public SocketTst(InetAddress address, int port, Random rnd) throws IOException {
-		this.socket = new Socket(address, port);
-		bagot = new Bagot(rnd, this.socket, address);
-	}
-
-	public SocketTst(InetAddress address, int port, InetAddress localAddr, int localPort, Random rnd) throws IOException {
-		this.socket = new Socket(address, port, localAddr, localPort);
-		bagot = new Bagot(rnd, this.socket, address);
-	}
-
-	public SocketTst(String address, int port, Random rnd) throws UnknownHostException, IOException {
-		this.socket = new Socket(address, port);
-		bagot = new Bagot(rnd, this.socket, InetAddress.getByName(address));
-	}
-
-	public SocketTst(String address, int port, InetAddress localAddr, int localPort, Random rnd) throws IOException {
-		this.socket = new Socket(address, port, localAddr, localPort);
-		bagot = new Bagot(rnd, this.socket, InetAddress.getByName(address));
-	}
-
-	public Socket getSocket() {
-		return this.socket;
-	}
-
-	public void startBagot() {
-		bagot.start();
-	}
+        private class Bagot implements Runnable {
+            private final Thread processus;
+            private final Socket socket;
+            private final InetAddress address;
+
+            public Bagot(Random rnd, Socket socket, InetAddress address) {
+                this.processus = new Thread(this, "Network Faults maker : undefined");
+                this.socket = socket;
+                this.address = address;
+            }
+
+            public void start() {
+                this.processus.setName("Network Faults maker : " + this.socket.toString());
+                this.processus.start();
+            }
+
+            @Override
+            public void run() {
+                int lastDelayVal;
+                Integer lastDelay;
+                while (!this.processus.isInterrupted()) {
+                    if (!this.socket.isClosed()) {
+                        try {
+                            lastDelay = closeIter.get(this.address);
+                            if (lastDelay == null) {
+                                lastDelayVal = 0;
+                            } else {
+                                lastDelayVal = lastDelay.intValue();
+                                if (lastDelayVal > 10)
+                                    lastDelayVal += 20;
+                                else
+                                    lastDelayVal += 1;
+                            }
+
+                            lastDelay = new Integer(lastDelayVal);
+
+                            LOG.info("Trying to close client socket " + socket.toString() + " in " + lastDelayVal + " milliseconds");
+
+                            try {
+                                Thread.sleep(lastDelayVal);
+                            } catch (InterruptedException e) {
+                                this.processus.interrupt();
+                                Thread.currentThread().interrupt();
+                            } catch (IllegalArgumentException e) {
+                            }
+
+                            this.socket.close();
+                            closeIter.put(this.address, lastDelay);
+                            LOG.info("Client socket " + this.socket.toString() + " is closed.");
+                        } catch (IOException e) {
+                        }
+                    }
+
+                    this.processus.interrupt();
+                }
+            }
+        }
+
+        private final Bagot bagot;
+        private final Socket socket;
+
+        public SocketTst(InetAddress address, int port, Random rnd) throws IOException {
+            this.socket = new Socket(address, port);
+            bagot = new Bagot(rnd, this.socket, address);
+        }
+
+        public SocketTst(InetAddress address, int port, InetAddress localAddr, int localPort, Random rnd) throws IOException {
+            this.socket = new Socket(address, port, localAddr, localPort);
+            bagot = new Bagot(rnd, this.socket, address);
+        }
+
+        public SocketTst(String address, int port, Random rnd) throws UnknownHostException, IOException {
+            this.socket = new Socket(address, port);
+            bagot = new Bagot(rnd, this.socket, InetAddress.getByName(address));
+        }
+
+        public SocketTst(String address, int port, InetAddress localAddr, int localPort, Random rnd) throws IOException {
+            this.socket = new Socket(address, port, localAddr, localPort);
+            bagot = new Bagot(rnd, this.socket, InetAddress.getByName(address));
+        }
+
+        public Socket getSocket() {
+            return this.socket;
+        }
+
+        public void startBagot() {
+            bagot.start();
+        }
     };
 
-    private final Random		rnd;
+    private final Random rnd;
 
     public SocketTstFactory() {
-	super();
-	LOG.info("Creating a new SocketTstFactory");
-	this.rnd	= new Random();
+        super();
+        LOG.info("Creating a new SocketTstFactory");
+        this.rnd = new Random();
     }
 
+    @Override
     public Socket createSocket(InetAddress host, int port) throws IOException {
-	SocketTst sockTst;
-	sockTst = new SocketTst(host, port, this.rnd);
-	sockTst.startBagot();
-	return sockTst.getSocket();
+        SocketTst sockTst;
+        sockTst = new SocketTst(host, port, this.rnd);
+        sockTst.startBagot();
+        return sockTst.getSocket();
     }
 
+    @Override
     public Socket createSocket(InetAddress host, int port, InetAddress localAddress, int localPort) throws IOException {
-	SocketTst	sockTst;
-	sockTst = new SocketTst(host, port, localAddress, localPort, this.rnd);
-	sockTst.startBagot();
-	return sockTst.getSocket();
+        SocketTst sockTst;
+        sockTst = new SocketTst(host, port, localAddress, localPort, this.rnd);
+        sockTst.startBagot();
+        return sockTst.getSocket();
     }
 
+    @Override
     public Socket createSocket(String host, int port) throws IOException {
-	SocketTst	sockTst;
-	sockTst = new SocketTst(host, port, this.rnd);
-	sockTst.startBagot();
-	return sockTst.getSocket();
+        SocketTst sockTst;
+        sockTst = new SocketTst(host, port, this.rnd);
+        sockTst.startBagot();
+        return sockTst.getSocket();
     }
 
+    @Override
     public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) throws IOException {
-	SocketTst	sockTst;
-	sockTst = new SocketTst(host, port, localAddress, localPort, this.rnd);
-	sockTst.startBagot();
-	return sockTst.getSocket();
+        SocketTst sockTst;
+        sockTst = new SocketTst(host, port, localAddress, localPort, this.rnd);
+        sockTst.startBagot();
+        return sockTst.getSocket();
     }
 
     private final static SocketTstFactory client = new SocketTstFactory();
 
     public static SocketFactory getDefault() {
-	return client;
+        return client;
     }
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextBrokerServiceTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextBrokerServiceTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextBrokerServiceTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextBrokerServiceTest.java Thu Feb  7 16:43:15 2013
@@ -20,46 +20,43 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Map;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.textui.TestRunner;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
-import org.apache.activemq.transport.TransportBrokerTestSupport;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
- * 
+ *
  */
 public class SslContextBrokerServiceTest extends TestCase {
 
-    
     private ClassPathXmlApplicationContext context;
     private BrokerService broker;
     private TransportConnector connector;
 
-
     public void testConfiguration() throws URISyntaxException {
 
         assertNotNull(broker);
         assertNotNull(connector);
-        
+
         assertEquals(new URI("ssl://localhost:61616"), connector.getUri());
-        
+
         assertNotNull(broker.getSslContext());
         assertFalse(broker.getSslContext().getKeyManagers().isEmpty());
         assertFalse(broker.getSslContext().getTrustManagers().isEmpty());
-        
+
     }
 
+    @Override
     protected void setUp() throws Exception {
         Thread.currentThread().setContextClassLoader(SslContextBrokerServiceTest.class.getClassLoader());
         context = new ClassPathXmlApplicationContext("org/apache/activemq/transport/tcp/activemq-ssl.xml");
-        Map beansOfType = context.getBeansOfType(BrokerService.class);
-        broker = (BrokerService)beansOfType.values().iterator().next();
-        connector = broker.getTransportConnectors().get(0); 
+        Map<String, BrokerService> beansOfType = context.getBeansOfType(BrokerService.class);
+        broker = beansOfType.values().iterator().next();
+        connector = broker.getTransportConnectors().get(0);
     }
-    
+
     @Override
     protected void tearDown() throws Exception {
 

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextNBrokerServiceTest.java Thu Feb  7 16:43:15 2013
@@ -36,19 +36,18 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
-
 public class SslContextNBrokerServiceTest extends TestCase {
     private static final transient Logger LOG = LoggerFactory.getLogger(SslContextNBrokerServiceTest.class);
-    
+
     private ClassPathXmlApplicationContext context;
-    Map beansOfType;
-    
+    Map<String, BrokerService> beansOfType;
+
     public void testConfigurationIsolation() throws Exception {
-        
+
         assertTrue("dummy bean has dummy cert", verifyCredentials("dummy"));
         assertTrue("good bean has amq cert", verifyCredentials("activemq.org"));
     }
-    
+
     private boolean verifyCredentials(String name) throws Exception {
         boolean result = false;
         BrokerService broker = getBroker(name);
@@ -66,18 +65,17 @@ public class SslContextNBrokerServiceTes
         TransportConnector connector = broker.getTransportConnectors().get(0);
         URI brokerUri = connector.getConnectUri();
 
-        SSLContext context = SSLContext.getInstance("TLS");        
-        CertChainCatcher catcher = new CertChainCatcher(); 
-        context.init(null, new TrustManager[] {catcher}, null);
-        
+        SSLContext context = SSLContext.getInstance("TLS");
+        CertChainCatcher catcher = new CertChainCatcher();
+        context.init(null, new TrustManager[] { catcher }, null);
+
         SSLSocketFactory factory = context.getSocketFactory();
-        LOG.info("Connecting to broker: " + broker.getBrokerName()
-                + " on: " + brokerUri.getHost() + ":" + brokerUri.getPort());
-        SSLSocket socket = (SSLSocket)factory.createSocket(brokerUri.getHost(), brokerUri.getPort());
+        LOG.info("Connecting to broker: " + broker.getBrokerName() + " on: " + brokerUri.getHost() + ":" + brokerUri.getPort());
+        SSLSocket socket = (SSLSocket) factory.createSocket(brokerUri.getHost(), brokerUri.getPort());
         socket.setSoTimeout(5000);
         socket.startHandshake();
         socket.close();
-        
+
         boolean matches = false;
         if (catcher.serverCerts != null) {
             for (int i = 0; i < catcher.serverCerts.length; i++) {
@@ -91,15 +89,14 @@ public class SslContextNBrokerServiceTes
                 }
             }
         }
-        return matches; 
+        return matches;
     }
 
-
     private BrokerService getBroker(String name) {
         BrokerService result = null;
-        Iterator iterator = beansOfType.values().iterator();
-        while(iterator.hasNext()) {
-            BrokerService candidate = (BrokerService)iterator.next();
+        Iterator<BrokerService> iterator = beansOfType.values().iterator();
+        while (iterator.hasNext()) {
+            BrokerService candidate = iterator.next();
             if (candidate.getBrokerName().equals(name)) {
                 result = candidate;
                 break;
@@ -108,29 +105,32 @@ public class SslContextNBrokerServiceTes
         return result;
     }
 
-
-    protected void setUp() throws Exception {     
-        //System.setProperty("javax.net.debug", "ssl");
+    @Override
+    protected void setUp() throws Exception {
+        // System.setProperty("javax.net.debug", "ssl");
         Thread.currentThread().setContextClassLoader(SslContextNBrokerServiceTest.class.getClassLoader());
         context = new ClassPathXmlApplicationContext("org/apache/activemq/transport/tcp/n-brokers-ssl.xml");
         beansOfType = context.getBeansOfType(BrokerService.class);
-        
     }
-    
+
     @Override
     protected void tearDown() throws Exception {
         context.destroy();
     }
 
-
-    class CertChainCatcher implements  X509TrustManager {  
+    class CertChainCatcher implements X509TrustManager {
         X509Certificate[] serverCerts;
-        
+
+        @Override
         public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
         }
+
+        @Override
         public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
             serverCerts = arg0;
         }
+
+        @Override
         public X509Certificate[] getAcceptedIssuers() {
             return null;
         }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AMQStackOverFlowTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AMQStackOverFlowTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AMQStackOverFlowTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AMQStackOverFlowTest.java Thu Feb  7 16:43:15 2013
@@ -26,8 +26,8 @@ import javax.jms.Message;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
@@ -66,6 +66,7 @@ public class AMQStackOverFlowTest extend
 
             template1.send("test.q", new MessageCreator() {
 
+                @Override
                 public Message createMessage(Session session) throws JMSException {
                     return session.createTextMessage("test");
                 }
@@ -80,14 +81,14 @@ public class AMQStackOverFlowTest extend
 
             final TextMessage tm = (TextMessage)m;
 
-            Assert.assertEquals("test", tm.getText());
+            assertEquals("test", tm.getText());
 
             template2.send("test2.q", new MessageCreator() {
 
+                @Override
                 public Message createMessage(Session session) throws JMSException {
                     return session.createTextMessage("test2");
                 }
-
             });
 
             final Message m2 = template1.receive("test2.q");
@@ -96,17 +97,14 @@ public class AMQStackOverFlowTest extend
 
             final TextMessage tm2 = (TextMessage)m2;
 
-            Assert.assertEquals("test2", tm2.getText());
+            assertEquals("test2", tm2.getText());
 
         } finally {
-
             brokerService1.stop();
             brokerService1 = null;
             brokerService2.stop();
             brokerService2 = null;
-
         }
-
     }
 
     private BrokerService createBrokerService(final String brokerName, final String uri1, final String uri2)
@@ -146,6 +144,5 @@ public class AMQStackOverFlowTest extend
         }
 
         return brokerService;
-
     }
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AbstractTwoBrokerNetworkConnectorWildcardIncludedDestinationTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AbstractTwoBrokerNetworkConnectorWildcardIncludedDestinationTestSupport.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AbstractTwoBrokerNetworkConnectorWildcardIncludedDestinationTestSupport.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AbstractTwoBrokerNetworkConnectorWildcardIncludedDestinationTestSupport.java Thu Feb  7 16:43:15 2013
@@ -28,32 +28,31 @@ import org.apache.activemq.broker.region
 import org.apache.activemq.broker.region.virtual.VirtualDestination;
 import org.apache.activemq.broker.region.virtual.VirtualDestinationInterceptor;
 import org.apache.activemq.broker.region.virtual.VirtualTopic;
-import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.network.NetworkConnector;
 import org.apache.activemq.store.kahadb.KahaDBStore;
 import org.apache.activemq.util.MessageIdList;
 
 public abstract class AbstractTwoBrokerNetworkConnectorWildcardIncludedDestinationTestSupport extends JmsMultipleBrokersTestSupport {
-	
+
     protected static final int MESSAGE_COUNT = 1;
     boolean dynamicOnly = true;
     int networkTTL = 1;
     boolean conduit = true;
     boolean suppressDuplicateQueueSubscriptions = true;
     boolean decreaseNetworkConsumerPriority = true;
-    
+
     /**
      * simple nwob
      */
     public void testSimpleNWOB() throws Exception {
-       
+
         sendReceive("BrokerA", "local.test",  false, "BrokerB", "local.test",  false, 1, 0);
         sendReceive("BrokerA", "local.test",  true,  "BrokerB", "local.test",  true,  1, 0);
         sendReceive("BrokerA", "global.test", false, "BrokerB", "global.test", false, 1, 1);
         sendReceive("BrokerA", "global.test", true,  "BrokerB", "global.test", true,  1, 1);
-        
+
     }
-    
+
     /**
      * nwob with wild-card subscriptions
      */
@@ -65,27 +64,27 @@ public abstract class AbstractTwoBrokerN
         sendReceive("BrokerA", "global.test.2", true, "BrokerB", "global.test.>", true, 1, 1);
 
     }
-    
+
     /**
      * nwob with virtual destinations
      */
     public void testSimpleNWOBWithVirtualDestinations() throws Exception {
-        
+
         sendReceive("BrokerA", "local.test",  true, "BrokerB", "Consumer.a.local.test",  false, 1, 0);
         sendReceive("BrokerA", "global.test", true, "BrokerB", "Consumer.a.global.test", false, 1, 1);
-        
+
     }
-    
+
     /**
      * nwob with virtual destinations and wild-card subscriptions
      */
     public void testSimpleNWOBWithVirtualDestinationsAndWildcardSubscriptions() throws Exception {
-        
+
         sendReceive("BrokerA", "local.test.1",  true, "BrokerB", "Consumer.a.local.test.>",  false, 1, 0);
         sendReceive("BrokerA", "global.test.1", true, "BrokerB", "Consumer.a.global.test.>", false, 1, 1);
-        
+
     }
-    
+
     public void sendReceive(String broker1, String dest1, boolean topic1, String broker2, String dest2, boolean topic2, int send, int expected) throws Exception{
         MessageConsumer client = createConsumer(broker2, createDestination(dest2, topic2));
         Thread.sleep(1000);
@@ -100,35 +99,36 @@ public abstract class AbstractTwoBrokerN
 
     protected abstract void addIncludedDestination(NetworkConnector networkConnector);
 
+    @Override
     public void setUp() throws Exception {
         super.setAutoFail(true);
         super.setUp();
-        String options = new String("?useJmx=false&deleteAllMessagesOnStartup=true"); 
+        String options = new String("?useJmx=false&deleteAllMessagesOnStartup=true");
         createAndConfigureBroker(new URI("broker:(tcp://localhost:61616)/BrokerA" + options));
         createAndConfigureBroker(new URI("broker:(tcp://localhost:61617)/BrokerB" + options));
-        
+
         // Setup broker networks
         NetworkConnector nc = bridgeBrokers("BrokerA", "BrokerB", dynamicOnly, networkTTL, conduit);
         nc.setDecreaseNetworkConsumerPriority(decreaseNetworkConsumerPriority);
         nc.setSuppressDuplicateQueueSubscriptions(suppressDuplicateQueueSubscriptions);
-        
+
         addIncludedDestination(nc);
-        
+
         nc = bridgeBrokers("BrokerB", "BrokerA", dynamicOnly, networkTTL, conduit);
         nc.setDecreaseNetworkConsumerPriority(decreaseNetworkConsumerPriority);
         nc.setSuppressDuplicateQueueSubscriptions(suppressDuplicateQueueSubscriptions);
-        
+
         addIncludedDestination(nc);
-        
+
         startAllBrokers();
-        
+
     }
-    
+
     private BrokerService createAndConfigureBroker(URI uri) throws Exception {
         BrokerService broker = createBroker(uri);
-        
+
         configurePersistenceAdapter(broker);
-        
+
         // make all topics virtual and consumers use the default prefix
         VirtualDestinationInterceptor virtualDestinationInterceptor = new VirtualDestinationInterceptor();
         virtualDestinationInterceptor.setVirtualDestinations(new VirtualDestination[]{new VirtualTopic()});
@@ -136,12 +136,12 @@ public abstract class AbstractTwoBrokerN
         broker.setDestinationInterceptors(destinationInterceptors);
         return broker;
     }
-    
+
     protected void configurePersistenceAdapter(BrokerService broker) throws IOException {
         File dataFileDir = new File("target/test-amq-data/kahadb/" + broker.getBrokerName());
         KahaDBStore kaha = new KahaDBStore();
         kaha.setDirectory(dataFileDir);
         broker.setPersistenceAdapter(kaha);
     }
-    
+
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AdvisoryTopicDeletionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AdvisoryTopicDeletionTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AdvisoryTopicDeletionTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/AdvisoryTopicDeletionTest.java Thu Feb  7 16:43:15 2013
@@ -23,12 +23,11 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 
-import org.apache.activemq.TestSupport;
 import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.TestSupport;
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.command.ActiveMQDestination;
-import org.apache.activemq.command.ActiveMQQueue;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -38,16 +37,19 @@ public class AdvisoryTopicDeletionTest e
     private BrokerService broker;
     private Connection connection;
 
+    @Override
     protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
         return new ActiveMQConnectionFactory("vm://" + getName());
     }
 
+    @Override
     protected void setUp() throws Exception {
         createBroker();
         topic = false;
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
         destroyBroker();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/BrokerQueueNetworkWithDisconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/BrokerQueueNetworkWithDisconnectTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/BrokerQueueNetworkWithDisconnectTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/BrokerQueueNetworkWithDisconnectTest.java Thu Feb  7 16:43:15 2013
@@ -19,6 +19,7 @@ package org.apache.activemq.usecases;
 import java.net.URI;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+
 import javax.jms.Destination;
 import javax.jms.MessageConsumer;
 import javax.jms.TextMessage;
@@ -55,12 +56,11 @@ public class BrokerQueueNetworkWithDisco
     private long inactiveDuration = 1000;
     private boolean useSocketProxy = true;
 
-   
     public void initCombosForTestSendOnAReceiveOnBWithTransportDisconnect() {
         addCombinationValues( "useDuplexNetworkBridge", new Object[]{ Boolean.TRUE, Boolean.FALSE} );
         addCombinationValues( "simulateStalledNetwork", new Object[]{ Boolean.TRUE } );
     }
-    
+
     public void testSendOnAReceiveOnBWithTransportDisconnect() throws Exception {
         bridgeBrokers(SPOKE, HUB);
 
@@ -68,24 +68,25 @@ public class BrokerQueueNetworkWithDisco
 
         // Setup destination
         Destination dest = createDestination("TEST.FOO", false);
-        
+
         // Setup consumers
         MessageConsumer client = createConsumer(HUB, dest);
-        
+
         // allow subscription information to flow back to Spoke
         sleep(600);
-        
+
         // Send messages
         sendMessages(SPOKE, dest, MESSAGE_COUNT);
 
         MessageIdList msgs = getConsumerMessages(HUB, client);
         msgs.waitForMessagesToArrive(MESSAGE_COUNT);
 
-        assertTrue("At least message " + MESSAGE_COUNT + 
+        assertTrue("At least message " + MESSAGE_COUNT +
                 " must be recieved, duplicates are expected, count=" + msgs.getMessageCount(),
                 MESSAGE_COUNT <= msgs.getMessageCount());
     }
 
+    @SuppressWarnings("unchecked")
     public void testNoStuckConnectionsWithTransportDisconnect() throws Exception {
         inactiveDuration=60000l;
         useDuplexNetworkBridge = true;
@@ -120,9 +121,10 @@ public class BrokerQueueNetworkWithDisco
             socketProxy.halfClose();
             sleep(10000);
         }
-        // wait for full reformation of bridge       
+        // wait for full reformation of bridge
         // verify no extra connections
-        boolean allGood = Wait.waitFor(new Wait.Condition(){ 
+        boolean allGood = Wait.waitFor(new Wait.Condition(){
+                    @Override
                     public boolean isSatisified() throws Exception {
                         long numConnections = hub.broker.getTransportConnectors().get(0).getConnections().size();
                         LOG.info("Num connetions:" + numConnections);
@@ -134,6 +136,7 @@ public class BrokerQueueNetworkWithDisco
         assertTrue("should be only one transport connection for the single duplex network connector", allGood);
 
         allGood = Wait.waitFor(new Wait.Condition(){
+                    @Override
                     public boolean isSatisified() throws Exception {
                         long numVmConnections = VMTransportFactory.SERVERS.get(HUB).getConnectionCount();
                         LOG.info("Num VM connetions:" + numVmConnections);
@@ -144,7 +147,7 @@ public class BrokerQueueNetworkWithDisco
         }
         assertTrue("should be only 2 vm connections for the single network duplex network connector", allGood);
     }
-    
+
     public void testTwoDuplexNCsAreAllowed() throws Exception {
         useDuplexNetworkBridge = true;
         useSocketProxy = false;
@@ -154,13 +157,13 @@ public class BrokerQueueNetworkWithDisco
         connector = bridgeBrokers(SPOKE, HUB);
         connector.setName("SecondDuplex");
 
-        startAllBrokers(); 
+        startAllBrokers();
         waitForBridgeFormation();
 
         BrokerItem hub = brokers.get(HUB);
         assertEquals("Has two transport Connectors", 2, hub.broker.getTransportConnectors().get(0).getConnections().size());
     }
-    
+
     @Override
     protected void startAllBrokers() throws Exception {
         // Ensure HUB is started first so bridge will be active from the get go
@@ -171,6 +174,7 @@ public class BrokerQueueNetworkWithDisco
         sleep(600);
     }
 
+    @Override
     public void setUp() throws Exception {
         networkDownTimeStart = 0;
         inactiveDuration = 1000;
@@ -181,18 +185,19 @@ public class BrokerQueueNetworkWithDisco
         createBroker(new URI("broker:(tcp://localhost:61617)/" + HUB + options));
         createBroker(new URI("broker:(tcp://localhost:61616)/" + SPOKE + options));
     }
-    
+
+    @Override
     public void tearDown() throws Exception {
         super.tearDown();
         if (socketProxy != null) {
             socketProxy.close();
         }
     }
-    
+
     public static Test suite() {
         return suite(BrokerQueueNetworkWithDisconnectTest.class);
     }
-       
+
     @Override
     protected void onSend(int i, TextMessage msg) {
         sleep(50);
@@ -224,7 +229,7 @@ public class BrokerQueueNetworkWithDisco
         try {
             Thread.sleep(milliSecondTime);
         } catch (InterruptedException igonred) {
-        }    
+        }
     }
 
     @Override
@@ -232,12 +237,12 @@ public class BrokerQueueNetworkWithDisco
         List<TransportConnector> transportConnectors = remoteBroker.getTransportConnectors();
         URI remoteURI;
         if (!transportConnectors.isEmpty()) {
-            remoteURI = ((TransportConnector)transportConnectors.get(0)).getConnectUri();
+            remoteURI = transportConnectors.get(0).getConnectUri();
             if (useSocketProxy) {
                 socketProxy = new SocketProxy(remoteURI);
                 remoteURI = socketProxy.getUrl();
             }
-            DiscoveryNetworkConnector connector = new DiscoveryNetworkConnector(new URI("static:(" + remoteURI 
+            DiscoveryNetworkConnector connector = new DiscoveryNetworkConnector(new URI("static:(" + remoteURI
                     + "?wireFormat.maxInactivityDuration=" + inactiveDuration + "&wireFormat.maxInactivityDurationInitalDelay=" + inactiveDuration + ")?useExponentialBackOff=false"));
             connector.setDynamicOnly(dynamicOnly);
             connector.setNetworkTTL(networkTTL);

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/BrowseOverNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/BrowseOverNetworkTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/BrowseOverNetworkTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/BrowseOverNetworkTest.java Thu Feb  7 16:43:15 2013
@@ -110,6 +110,7 @@ public class BrowseOverNetworkTest exten
             this.expect = expect;
         }
 
+        @Override
         public void run() {
             int retries = 0;
             while (retries++ < 20 && totalCount != expect) {
@@ -122,8 +123,8 @@ public class BrowseOverNetworkTest exten
                             totalCount += count;
                             for (int i = 0; i < count; i++) {
                                 ActiveMQTextMessage message = (ActiveMQTextMessage)consumer.receive(1000);
-                                LOG.info(broker + " consumer: " + message.getText() + " " + message.getDestination() +  " " + message.getMessageId() + " " + Arrays.toString(message.getBrokerPath()));
                                 if (message == null) break;
+                                LOG.info(broker + " consumer: " + message.getText() + " " + message.getDestination() +  " " + message.getMessageId() + " " + Arrays.toString(message.getBrokerPath()));
                             }
                         }
                     } else {
@@ -216,13 +217,13 @@ public class BrowseOverNetworkTest exten
 
         LOG.info("broker-3A browsed " + browser1.getTotalCount());
         LOG.info("broker-3B browsed " + browser2.getTotalCount());
-        
+
         assertEquals(MESSAGE_COUNT * 2, browser1.getTotalCount() + browser2.getTotalCount() );
 
-    }    
+    }
 
     protected int browseMessages(QueueBrowser browser, String name) throws Exception {
-        Enumeration msgs = browser.getEnumeration();
+        Enumeration<?> msgs = browser.getEnumeration();
         int browsedMessage = 0;
         while (msgs.hasMoreElements()) {
             browsedMessage++;
@@ -240,6 +241,7 @@ public class BrowseOverNetworkTest exten
         return browsedMessage;
     }
 
+    @Override
     public void setUp() throws Exception {
         super.setAutoFail(true);
         super.setUp();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java Thu Feb  7 16:43:15 2013
@@ -18,6 +18,7 @@
 package org.apache.activemq.usecases;
 
 import java.util.HashMap;
+
 import javax.jms.Connection;
 import javax.jms.Destination;
 import javax.jms.MessageConsumer;
@@ -28,7 +29,7 @@ import javax.jms.Session;
 import org.apache.activemq.test.TestSupport;
 
 /**
- * 
+ *
  */
 public class ChangeSentMessageTest extends TestSupport {
     private static final int COUNT = 200;
@@ -36,9 +37,10 @@ public class ChangeSentMessageTest exten
 
     /**
      * test Object messages can be changed after sending with no side-affects
-     * 
+     *
      * @throws Exception
      */
+    @SuppressWarnings("rawtypes")
     public void testDoChangeSentMessage() throws Exception {
         Destination destination = createDestination("test-" + ChangeSentMessageTest.class.getName());
         Connection connection = createConnection();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSessionDeliveryModeTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSessionDeliveryModeTest.java?rev=1443600&r1=1443599&r2=1443600&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSessionDeliveryModeTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSessionDeliveryModeTest.java Thu Feb  7 16:43:15 2013
@@ -29,7 +29,7 @@ import javax.jms.Session;
 import org.apache.activemq.test.TestSupport;
 
 /**
- * 
+ *
  */
 public class ChangeSessionDeliveryModeTest extends TestSupport implements MessageListener {
 
@@ -37,7 +37,7 @@ public class ChangeSessionDeliveryModeTe
      * test following condition- which are defined by JMS Spec 1.1:
      * MessageConsumers cannot use a MessageListener and receive() from the same
      * session
-     * 
+     *
      * @throws Exception
      */
     public void testDoChangeSessionDeliveryMode() throws Exception {
@@ -47,7 +47,6 @@ public class ChangeSessionDeliveryModeTe
         Session consumerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageConsumer consumer1 = consumerSession.createConsumer(destination);
         consumer1.setMessageListener(this);
-        JMSException jmsEx = null;
         MessageConsumer consumer2 = consumerSession.createConsumer(destination);
 
         try {
@@ -58,6 +57,7 @@ public class ChangeSessionDeliveryModeTe
         }
     }
 
+    @Override
     public void onMessage(Message msg) {
     }
 }



Mime
View raw message