activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1443267 [1/4] - in /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq: ./ advisory/ blob/ broker/jmx/ broker/policy/ broker/store/ bugs/amq1095/ config/ console/command/ filter/ jndi/ load/ memory/ network/ network/jms/ ...
Date Wed, 06 Feb 2013 22:56:13 GMT
Author: tabish
Date: Wed Feb  6 22:56:12 2013
New Revision: 1443267

URL: http://svn.apache.org/viewvc?rev=1443267&view=rev
Log:
Fix a bunch of warnings covering deprecated asserts and such. 

Modified:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQSslConnectionFactoryTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ClientTestSupport.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerStartupDestinationTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/LargeStreamletTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/SpringTestSupport.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/TestSupport.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTempDestinationTests.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/AdvisoryTests.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/advisory/ProducerListenerTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/blob/FTPBlobDownloadStrategyTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/blob/FTPBlobTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/blob/FTPBlobUploadStrategyTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/blob/FilesystemBlobTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/TransportConnectorMBeanTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/IndividualDeadLetterTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/NoRetryDeadLetterTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/PerDurableConsumerDeadLetterTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/PriorityNetworkDispatchPolicyTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/SimpleDispatchPolicyTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/store/LoadTester.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/amq1095/ActiveMQTestCase.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/amq1095/MessageSelectorTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/config/BrokerXmlConfigFromJNDITest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/config/ConfigUsingDestinationOptions.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/console/command/TestPurgeCommand.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTempDestinationTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicy.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/CustomConnectionFactoryNameTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/DestinationNameWithSlashTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/JNDITestSupport.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/load/LoadController.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/memory/MemoryPropertyTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DuplexNetworkTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/DynamicallyIncludedDestinationsDuplexNetworkTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkConnectionsCleanedupTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkFailoverTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkRemovesSubscriptionsTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SSHTunnelNetworkReconnectTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueBridgeStandaloneReconnectTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/QueueOutboundBridgeReconnectTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicBridgeStandaloneReconnectTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/network/jms/TopicOutboundBridgeReconnectTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGeneratorTestSupport.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java Wed Feb  6 22:56:12 2013
@@ -22,7 +22,6 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.Map;
 
 import javax.jms.ExceptionListener;
 import javax.jms.JMSException;
@@ -83,7 +82,7 @@ public class ActiveMQConnectionFactoryTe
         assertTrue(cf.isUseAsyncSend());
         // the broker url have been adjusted.
         assertEquals("vm:(broker:()/localhost)", cf.getBrokerURL());
-        
+
         cf = new ActiveMQConnectionFactory("vm://localhost?jms.auditDepth=5000");
         assertEquals(5000, cf.getAuditDepth());
     }
@@ -142,7 +141,7 @@ public class ActiveMQConnectionFactoryTe
     public void testCreateTcpConnectionUsingKnownLocalPort() throws Exception {
         broker = new BrokerService();
         broker.setPersistent(false);
-        TransportConnector connector = broker.addConnector("tcp://localhost:61610?wireFormat.tcpNoDelayEnabled=true");
+        broker.addConnector("tcp://localhost:61610?wireFormat.tcpNoDelayEnabled=true");
         broker.start();
 
         // This should create the connection.
@@ -178,56 +177,58 @@ public class ActiveMQConnectionFactoryTe
         cf = (ActiveMQConnectionFactory)objectsIn.readObject();
         assertEquals(cf.getClientID(), clientID);
     }
-    
+
     public void testSetExceptionListener() throws Exception {
         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
         connection = (ActiveMQConnection)cf.createConnection();
         assertNull(connection.getExceptionListener());
-        
+
         ExceptionListener exListener = new ExceptionListener() {
-			public void onException(JMSException arg0) {
-			}
+            @Override
+            public void onException(JMSException arg0) {
+            }
         };
         cf.setExceptionListener(exListener);
         connection.close();
-        
+
         connection = (ActiveMQConnection)cf.createConnection();
         assertNotNull(connection.getExceptionListener());
         assertEquals(exListener, connection.getExceptionListener());
         connection.close();
-        
+
         connection = (ActiveMQConnection)cf.createConnection();
         assertEquals(exListener, connection.getExceptionListener());
-        
+
         assertEquals(exListener, cf.getExceptionListener());
         connection.close();
-        
+
     }
 
-    
+
     public void testSetClientInternalExceptionListener() throws Exception {
         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
         connection = (ActiveMQConnection)cf.createConnection();
         assertNull(connection.getClientInternalExceptionListener());
-        
+
         ClientInternalExceptionListener listener = new ClientInternalExceptionListener() {
+            @Override
             public void onException(Throwable exception) {
             }
         };
         connection.setClientInternalExceptionListener(listener);
         cf.setClientInternalExceptionListener(listener);
         connection.close();
-        
+
         connection = (ActiveMQConnection)cf.createConnection();
         assertNotNull(connection.getClientInternalExceptionListener());
         assertEquals(listener, connection.getClientInternalExceptionListener());
         connection.close();
-        
+
         connection = (ActiveMQConnection)cf.createConnection();
-        assertEquals(listener, connection.getClientInternalExceptionListener());   
+        assertEquals(listener, connection.getClientInternalExceptionListener());
         assertEquals(listener, cf.getClientInternalExceptionListener());
         connection.close();
-        
+
     }
 
     protected void assertCreateConnection(String uri) throws Exception {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQSslConnectionFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQSslConnectionFactoryTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQSslConnectionFactoryTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQSslConnectionFactoryTest.java Wed Feb  6 22:56:12 2013
@@ -20,25 +20,16 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.security.KeyStore;
 import java.security.SecureRandom;
 
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Session;
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 
-import org.apache.activemq.broker.BrokerRegistry;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.SslBrokerService;
-import org.apache.activemq.broker.TransportConnector;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -50,10 +41,10 @@ public class ActiveMQSslConnectionFactor
     public static final String SERVER_KEYSTORE = "src/test/resources/server.keystore";
     public static final String TRUST_KEYSTORE = "src/test/resources/client.keystore";
 
-    private TransportConnector connector;
     private ActiveMQConnection connection;
     private BrokerService broker;
 
+    @Override
     protected void tearDown() throws Exception {
         // Try our best to close any previously opend connection.
         try {
@@ -77,7 +68,7 @@ public class ActiveMQSslConnectionFactor
         assertNotNull(connection);
         connection.start();
         connection.stop();
-    	brokerStop();
+        brokerStop();
     }
 
     public void testCreateFailoverTcpConnectionUsingKnownPort() throws Exception {
@@ -90,12 +81,12 @@ public class ActiveMQSslConnectionFactor
         assertNotNull(connection);
         connection.start();
         connection.stop();
-    	brokerStop();
+        brokerStop();
     }
 
     public void testCreateSslConnection() throws Exception {
         // Create SSL/TLS connection with trusted cert from truststore.
-    	String sslUri = "ssl://localhost:61611";
+        String sslUri = "ssl://localhost:61611";
         broker = createSslBroker(sslUri);
         assertNotNull(broker);
 
@@ -113,7 +104,7 @@ public class ActiveMQSslConnectionFactor
 
     public void testFailoverSslConnection() throws Exception {
         // Create SSL/TLS connection with trusted cert from truststore.
-    	String sslUri = "ssl://localhost:61611";
+        String sslUri = "ssl://localhost:61611";
         broker = createSslBroker(sslUri);
         assertNotNull(broker);
 
@@ -148,7 +139,7 @@ public class ActiveMQSslConnectionFactor
 
     public void testNegativeCreateSslConnectionWithWrongPassword() throws Exception {
         // Create SSL/TLS connection with trusted cert from truststore.
-    	String sslUri = "ssl://localhost:61611";
+        String sslUri = "ssl://localhost:61611";
         broker = createSslBroker(sslUri);
         assertNotNull(broker);
 
@@ -160,8 +151,8 @@ public class ActiveMQSslConnectionFactor
             connection = (ActiveMQConnection)cf.createConnection();
         }
         catch (javax.jms.JMSException ignore) {
-        	// Expected exception
-        	LOG.info("Expected java.io.Exception [" + ignore + "]");
+            // Expected exception
+            LOG.info("Expected java.io.Exception [" + ignore + "]");
         }
         assertNull(connection);
 
@@ -170,7 +161,7 @@ public class ActiveMQSslConnectionFactor
 
     public void testNegativeCreateSslConnectionWithWrongCert() throws Exception {
         // Create SSL/TLS connection with trusted cert from truststore.
-    	String sslUri = "ssl://localhost:61611";
+        String sslUri = "ssl://localhost:61611";
         broker = createSslBroker(sslUri);
         assertNotNull(broker);
 
@@ -182,8 +173,8 @@ public class ActiveMQSslConnectionFactor
             connection = (ActiveMQConnection)cf.createConnection();
         }
         catch (javax.jms.JMSException ignore) {
-        	// Expected exception
-        	LOG.info("Expected SSLHandshakeException [" + ignore + "]");
+            // Expected exception
+            LOG.info("Expected SSLHandshakeException [" + ignore + "]");
         }
         assertNull(connection);
 
@@ -195,26 +186,26 @@ public class ActiveMQSslConnectionFactor
         BrokerService service = new BrokerService();
         service.setPersistent(false);
         service.setUseJmx(false);
-        connector = service.addConnector(uri);
+        service.addConnector(uri);
         service.start();
 
         return service;
     }
 
     protected BrokerService createSslBroker(String uri) throws Exception {
-        
+
         // http://java.sun.com/javase/javaseforbusiness/docs/TLSReadme.html
         // work around: javax.net.ssl.SSLHandshakeException: renegotiation is not allowed
         //System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
-        
+
         SslBrokerService service = new SslBrokerService();
         service.setPersistent(false);
-        
+
         KeyManager[] km = getKeyManager();
         TrustManager[] tm = getTrustManager();
-        connector = service.addSslConnector(uri, km, tm, null);
+        service.addSslConnector(uri, km, tm, null);
         service.start();
-        
+
         return service;
     }
 
@@ -225,32 +216,32 @@ public class ActiveMQSslConnectionFactor
     public static TrustManager[] getTrustManager() throws Exception {
         TrustManager[] trustStoreManagers = null;
         KeyStore trustedCertStore = KeyStore.getInstance(ActiveMQSslConnectionFactoryTest.KEYSTORE_TYPE);
-        
+
         trustedCertStore.load(new FileInputStream(ActiveMQSslConnectionFactoryTest.TRUST_KEYSTORE), null);
-        TrustManagerFactory tmf  = 
+        TrustManagerFactory tmf  =
             TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
-  
+
         tmf.init(trustedCertStore);
         trustStoreManagers = tmf.getTrustManagers();
-        return trustStoreManagers; 
+        return trustStoreManagers;
     }
 
     public static KeyManager[] getKeyManager() throws Exception {
-        KeyManagerFactory kmf = 
-            KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());  
+        KeyManagerFactory kmf =
+            KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
         KeyStore ks = KeyStore.getInstance(ActiveMQSslConnectionFactoryTest.KEYSTORE_TYPE);
         KeyManager[] keystoreManagers = null;
-        
+
         byte[] sslCert = loadClientCredential(ActiveMQSslConnectionFactoryTest.SERVER_KEYSTORE);
-        
-       
+
+
         if (sslCert != null && sslCert.length > 0) {
             ByteArrayInputStream bin = new ByteArrayInputStream(sslCert);
             ks.load(bin, ActiveMQSslConnectionFactoryTest.PASSWORD.toCharArray());
             kmf.init(ks, ActiveMQSslConnectionFactoryTest.PASSWORD.toCharArray());
             keystoreManagers = kmf.getKeyManagers();
         }
-        return keystoreManagers;          
+        return keystoreManagers;
     }
 
     private static byte[] loadClientCredential(String fileName) throws IOException {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ClientTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ClientTestSupport.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ClientTestSupport.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ClientTestSupport.java Wed Feb  6 22:56:12 2013
@@ -26,6 +26,7 @@ import java.util.concurrent.atomic.Atomi
 import javax.jms.JMSException;
 
 import junit.framework.TestCase;
+
 import org.apache.activemq.broker.Broker;
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
@@ -48,8 +49,9 @@ public class ClientTestSupport extends T
     protected long idGenerator;
 
     private ActiveMQConnectionFactory connFactory;
-    private String brokerURL = "vm://localhost?broker.persistent=false";
+    private final String brokerURL = "vm://localhost?broker.persistent=false";
 
+    @Override
     public void setUp() throws Exception {
         final AtomicBoolean connected = new AtomicBoolean(false);
         TransportConnector connector;
@@ -57,10 +59,11 @@ public class ClientTestSupport extends T
         // Start up a broker with a tcp connector.
         try {
             broker = BrokerFactory.createBroker(new URI(this.brokerURL));
-            String brokerId = broker.getBrokerName();
+            broker.getBrokerName();
             connector = new TransportConnector(TransportFactory.bind(new URI(this.brokerURL))) {
                 // Hook into the connector so we can assert that the server
                 // accepted a connection.
+                @Override
                 protected org.apache.activemq.broker.Connection createConnection(org.apache.activemq.transport.Transport transport) throws IOException {
                     connected.set(true);
                     return super.createConnection(transport);
@@ -82,6 +85,7 @@ public class ClientTestSupport extends T
         connFactory = new ActiveMQConnectionFactory(connectURI);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
         if (broker != null) {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java Wed Feb  6 22:56:12 2013
@@ -65,12 +65,12 @@ public abstract class CombinationTestSup
 
     private static final Logger LOG = LoggerFactory.getLogger(CombinationTestSupport.class);
 
-    private HashMap<String, ComboOption> comboOptions = new HashMap<String, ComboOption>();
+    private final HashMap<String, ComboOption> comboOptions = new HashMap<String, ComboOption>();
     private boolean combosEvaluated;
     private Map<String, Object> options;
     protected File basedir;
 
-    static protected File basedir(Class clazz) {
+    static protected File basedir(Class<?> clazz) {
         try {
             ProtectionDomain protectionDomain = clazz.getProtectionDomain();
             return new File(new File(protectionDomain.getCodeSource().getLocation().getPath()), "../..").getCanonicalFile();
@@ -101,6 +101,7 @@ public abstract class CombinationTestSup
         }
     }
 
+    @Override
     public void runBare() throws Throwable {
         if (combosEvaluated) {
             super.runBare();
@@ -253,6 +254,7 @@ public abstract class CombinationTestSup
         return parameters.length == 0 && name.startsWith("test") && returnType.equals(Void.TYPE);
     }
 
+    @Override
     public String getName() {
         return getName(false);
     }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerStartupDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerStartupDestinationTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerStartupDestinationTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerStartupDestinationTest.java Wed Feb  6 22:56:12 2013
@@ -23,7 +23,7 @@ import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
-import junit.framework.Assert;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.region.policy.PolicyEntry;
 import org.apache.activemq.broker.region.policy.PolicyMap;
@@ -33,6 +33,7 @@ public class ExclusiveConsumerStartupDes
 
     private static final String VM_BROKER_URL = "vm://localhost";
 
+    @Override
     protected BrokerService createBroker() throws Exception {
         BrokerService answer = new BrokerService();
         answer.setPersistent(false);
@@ -40,7 +41,7 @@ public class ExclusiveConsumerStartupDes
         PolicyEntry entry = new PolicyEntry();
         entry.setAllConsumersExclusiveByDefault(true);
         map.setDefaultEntry(entry);
-        answer.setDestinationPolicy(map);        
+        answer.setDestinationPolicy(map);
         return answer;
     }
 
@@ -87,15 +88,13 @@ public class ExclusiveConsumerStartupDes
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
-
+            assertNotNull(exclusiveConsumer.receive(100));
+            assertNull(fallbackConsumer.receive(100));
         } finally {
             fallbackSession.close();
             senderSession.close();
             conn.close();
         }
-
     }
 
     public void testFailoverToAnotherExclusiveConsumerCreatedFirst() throws JMSException,
@@ -132,9 +131,9 @@ public class ExclusiveConsumerStartupDes
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer1.receive(100));
-            Assert.assertNull(exclusiveConsumer2.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer1.receive(100));
+            assertNull(exclusiveConsumer2.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
             // Close the exclusive consumer to verify the non-exclusive consumer
             // takes over
@@ -143,8 +142,8 @@ public class ExclusiveConsumerStartupDes
             producer.send(msg);
             producer.send(msg);
 
-            Assert.assertNotNull("Should have received a message", exclusiveConsumer2.receive(100));
-            Assert.assertNull("Should not have received a message", fallbackConsumer.receive(100));
+            assertNotNull("Should have received a message", exclusiveConsumer2.receive(100));
+            assertNull("Should not have received a message", fallbackConsumer.receive(100));
 
         } finally {
             fallbackSession.close();
@@ -184,8 +183,8 @@ public class ExclusiveConsumerStartupDes
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
             // Close the exclusive consumer to verify the non-exclusive consumer
             // takes over
@@ -193,14 +192,12 @@ public class ExclusiveConsumerStartupDes
 
             producer.send(msg);
 
-            Assert.assertNotNull(fallbackConsumer.receive(100));
+            assertNotNull(fallbackConsumer.receive(100));
 
         } finally {
             fallbackSession.close();
             senderSession.close();
             conn.close();
         }
-
     }
-
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/ExclusiveConsumerTest.java Wed Feb  6 22:56:12 2013
@@ -24,8 +24,8 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
+
 import org.apache.activemq.command.ActiveMQQueue;
 
 public class ExclusiveConsumerTest extends TestCase {
@@ -36,10 +36,12 @@ public class ExclusiveConsumerTest exten
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -83,8 +85,8 @@ public class ExclusiveConsumerTest exten
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
         } finally {
             fallbackSession.close();
@@ -122,8 +124,8 @@ public class ExclusiveConsumerTest exten
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
         } finally {
             fallbackSession.close();
@@ -167,9 +169,9 @@ public class ExclusiveConsumerTest exten
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer1.receive(100));
-            Assert.assertNull(exclusiveConsumer2.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer1.receive(100));
+            assertNull(exclusiveConsumer2.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
             // Close the exclusive consumer to verify the non-exclusive consumer
             // takes over
@@ -178,8 +180,8 @@ public class ExclusiveConsumerTest exten
             producer.send(msg);
             producer.send(msg);
 
-            Assert.assertNotNull(exclusiveConsumer2.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer2.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
         } finally {
             fallbackSession.close();
@@ -224,9 +226,9 @@ public class ExclusiveConsumerTest exten
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer1.receive(100));
-            Assert.assertNull(exclusiveConsumer2.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer1.receive(100));
+            assertNull(exclusiveConsumer2.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
             // Close the exclusive consumer to verify the non-exclusive consumer
             // takes over
@@ -235,8 +237,8 @@ public class ExclusiveConsumerTest exten
             producer.send(msg);
             producer.send(msg);
 
-            Assert.assertNotNull(exclusiveConsumer2.receive(1000));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer2.receive(1000));
+            assertNull(fallbackConsumer.receive(100));
 
         } finally {
             fallbackSession.close();
@@ -276,8 +278,8 @@ public class ExclusiveConsumerTest exten
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
             // Close the exclusive consumer to verify the non-exclusive consumer
             // takes over
@@ -285,7 +287,7 @@ public class ExclusiveConsumerTest exten
 
             producer.send(msg);
 
-            Assert.assertNotNull(fallbackConsumer.receive(100));
+            assertNotNull(fallbackConsumer.receive(100));
 
         } finally {
             fallbackSession.close();
@@ -325,8 +327,8 @@ public class ExclusiveConsumerTest exten
             Thread.sleep(100);
 
             // Verify exclusive consumer receives the message.
-            Assert.assertNotNull(exclusiveConsumer.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
             // Close the exclusive consumer to verify the non-exclusive consumer
             // takes over
@@ -335,15 +337,15 @@ public class ExclusiveConsumerTest exten
             producer.send(msg);
 
             // Verify other non-exclusive consumer receices the message.
-            Assert.assertNotNull(fallbackConsumer.receive(100));
+            assertNotNull(fallbackConsumer.receive(100));
 
             // Create exclusive consumer to determine if it will start receiving
             // the messages.
             exclusiveConsumer = exclusiveSession.createConsumer(exclusiveQueue);
 
             producer.send(msg);
-            Assert.assertNotNull(exclusiveConsumer.receive(100));
-            Assert.assertNull(fallbackConsumer.receive(100));
+            assertNotNull(exclusiveConsumer.receive(100));
+            assertNull(fallbackConsumer.receive(100));
 
         } finally {
             fallbackSession.close();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java Wed Feb  6 22:56:12 2013
@@ -36,7 +36,9 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.management.ObjectName;
+
 import junit.framework.Test;
+
 import org.apache.activemq.broker.jmx.DestinationViewMBean;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQQueue;
@@ -45,8 +47,8 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Test cases used to test the JMS message consumer.
- * 
- * 
+ *
+ *
  */
 public class JMSConsumerTest extends JmsTestSupport {
 
@@ -85,6 +87,7 @@ public class JMSConsumerTest extends Jms
         destination = createDestination(session, destinationType);
         ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer)session.createConsumer(destination);
         consumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 counter.incrementAndGet();
                 if (counter.get() == 1) {
@@ -121,35 +124,37 @@ public class JMSConsumerTest extends Jms
 
         final AtomicInteger counter = new AtomicInteger(0);
         final CountDownLatch closeDone = new CountDownLatch(1);
-        
+
         connection.start();
         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE);
 
         // preload the queue
         sendMessages(session, destination, 2000);
-        
+
 
         final ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer)session.createConsumer(destination);
-       
-        final Map<Thread, Throwable> exceptions = 
+
+        final Map<Thread, Throwable> exceptions =
             Collections.synchronizedMap(new HashMap<Thread, Throwable>());
         Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
+            @Override
             public void uncaughtException(Thread t, Throwable e) {
                 LOG.error("Uncaught exception:", e);
                 exceptions.put(t, e);
             }
         });
-        
-        final class AckAndClose implements Runnable {            
-            private Message message;
+
+        final class AckAndClose implements Runnable {
+            private final Message message;
 
             public AckAndClose(Message m) {
                 this.message = m;
             }
 
+            @Override
             public void run() {
-                try {   
+                try {
                     int count = counter.incrementAndGet();
                     if (count == 590) {
                         // close in a separate thread is ok by jms
@@ -161,16 +166,17 @@ public class JMSConsumerTest extends Jms
                         // ack every 200
                         message.acknowledge();
                     }
-                } catch (Exception e) {        
+                } catch (Exception e) {
                     LOG.error("Exception on close or ack:", e);
                     exceptions.put(Thread.currentThread(), e);
-                } 
-            }  
+                }
+            }
         };
-    
+
         final ExecutorService executor = Executors.newCachedThreadPool();
         consumer.setMessageListener(new MessageListener() {
-            public void onMessage(Message m) { 
+            @Override
+            public void onMessage(Message m) {
                 // ack and close eventually in separate thread
                 executor.execute(new AckAndClose(m));
             }
@@ -182,7 +188,7 @@ public class JMSConsumerTest extends Jms
         assertTrue("no exceptions: " + exceptions, exceptions.isEmpty());
     }
 
-    
+
     public void initCombosForTestMutiReceiveWithPrefetch1() {
         addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
         addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.AUTO_ACKNOWLEDGE), Integer.valueOf(Session.DUPS_OK_ACKNOWLEDGE),
@@ -310,6 +316,7 @@ public class JMSConsumerTest extends Jms
 
         // See if the message get sent to the listener
         consumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 counter.incrementAndGet();
                 if (counter.get() == 4) {
@@ -339,6 +346,7 @@ public class JMSConsumerTest extends Jms
         ActiveMQSession session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         destination = createDestination(session, destinationType);
         MessageConsumer consumer = session.createConsumer(destination, new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 counter.incrementAndGet();
                 if (counter.get() == 4) {
@@ -346,6 +354,7 @@ public class JMSConsumerTest extends Jms
                 }
             }
         });
+        assertNotNull(consumer);
 
         // Send the messages
         sendMessages(session, destination, 4);
@@ -357,14 +366,14 @@ public class JMSConsumerTest extends Jms
         assertEquals(4, counter.get());
     }
 
-    public void initCombosForTestMessageListenerOnMessageCloseUnackedWithPrefetch1StayInQueue() { 
+    public void initCombosForTestMessageListenerOnMessageCloseUnackedWithPrefetch1StayInQueue() {
         addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
         addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.CLIENT_ACKNOWLEDGE)});
         addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)});
     }
 
     public void testMessageListenerOnMessageCloseUnackedWithPrefetch1StayInQueue() throws Exception {
-    
+
         final AtomicInteger counter = new AtomicInteger(0);
         final CountDownLatch sendDone = new CountDownLatch(1);
         final CountDownLatch got2Done = new CountDownLatch(1);
@@ -383,6 +392,7 @@ public class JMSConsumerTest extends Jms
         destination = createDestination(session, destinationType);
         MessageConsumer consumer = session.createConsumer(destination);
         consumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 try {
                     TextMessage tm = (TextMessage)m;
@@ -420,6 +430,7 @@ public class JMSConsumerTest extends Jms
         session = connection.createSession(false, ackMode);
         consumer = session.createConsumer(destination);
         consumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 try {
                     TextMessage tm = (TextMessage)m;
@@ -440,7 +451,7 @@ public class JMSConsumerTest extends Jms
         Thread.sleep(200);
 
         // assert msg 2 was redelivered as close() from onMessages() will only ack in auto_ack and dups_ok mode
-        assertEquals(5, counter.get());      
+        assertEquals(5, counter.get());
     }
 
     public void initCombosForTestMessageListenerAutoAckOnCloseWithPrefetch1() {
@@ -450,7 +461,7 @@ public class JMSConsumerTest extends Jms
     }
 
     public void testMessageListenerAutoAckOnCloseWithPrefetch1() throws Exception {
-    
+
         final AtomicInteger counter = new AtomicInteger(0);
         final CountDownLatch sendDone = new CountDownLatch(1);
         final CountDownLatch got2Done = new CountDownLatch(1);
@@ -469,6 +480,7 @@ public class JMSConsumerTest extends Jms
         destination = createDestination(session, destinationType);
         MessageConsumer consumer = session.createConsumer(destination);
         consumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 try {
                     TextMessage tm = (TextMessage)m;
@@ -506,6 +518,7 @@ public class JMSConsumerTest extends Jms
         session = connection.createSession(false, ackMode);
         consumer = session.createConsumer(destination);
         consumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 try {
                     TextMessage tm = (TextMessage)m;
@@ -547,6 +560,7 @@ public class JMSConsumerTest extends Jms
         destination = createDestination(session, destinationType);
         MessageConsumer consumer = session.createConsumer(destination);
         consumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 counter.incrementAndGet();
                 if (counter.get() == 4) {
@@ -582,6 +596,7 @@ public class JMSConsumerTest extends Jms
         destination = createDestination(session, destinationType);
         MessageConsumer consumer = session.createConsumer(destination);
         consumer.setMessageListener(new MessageListener() {
+            @Override
             public void onMessage(Message m) {
                 counter.incrementAndGet();
                 if (counter.get() == 4) {
@@ -756,7 +771,7 @@ public class JMSConsumerTest extends Jms
         assertNull(consumer.receiveNoWait());
     }
 
-    
+
     public void testDupsOkConsumer() throws Exception {
 
         // Receive a message with the JMS API
@@ -774,10 +789,10 @@ public class JMSConsumerTest extends Jms
             assertNotNull(m);
         }
         assertNull(consumer.receive(1000));
-        
+
         // Close out the consumer.. no other messages should be left on the queue.
         consumer.close();
-        
+
         consumer = session.createConsumer(destination);
         assertNull(consumer.receive(1000));
     }
@@ -787,55 +802,55 @@ public class JMSConsumerTest extends Jms
         connection.start();
         Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
         destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE);
-        
+
         sendMessages(connection, destination, 2);
-        
+
         MessageConsumer consumer = session.createConsumer(destination);
         assertNotNull(consumer.receive(1000));
         assertNotNull(consumer.receive(1000));
-        
+
         // install another consumer while message dispatch is unacked/uncommitted
         Session redispatchSession = connection.createSession(true, Session.SESSION_TRANSACTED);
         MessageConsumer redispatchConsumer = redispatchSession.createConsumer(destination);
 
         // no commit so will auto rollback and get re-dispatched to redisptachConsumer
         session.close();
-                
+
         Message msg = redispatchConsumer.receive(1000);
         assertNotNull(msg);
         assertTrue("redelivered flag set", msg.getJMSRedelivered());
         assertEquals(2, msg.getLongProperty("JMSXDeliveryCount"));
-        
+
         msg = redispatchConsumer.receive(1000);
         assertNotNull(msg);
         assertTrue(msg.getJMSRedelivered());
         assertEquals(2, msg.getLongProperty("JMSXDeliveryCount"));
         redispatchSession.commit();
-        
+
         assertNull(redispatchConsumer.receive(500));
         redispatchSession.close();
     }
 
-    
+
     public void testRedispatchOfRolledbackTx() throws Exception {
 
         connection.start();
         Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
         destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE);
-        
+
         sendMessages(connection, destination, 2);
-        
+
         MessageConsumer consumer = session.createConsumer(destination);
         assertNotNull(consumer.receive(1000));
         assertNotNull(consumer.receive(1000));
-        
+
         // install another consumer while message dispatch is unacked/uncommitted
         Session redispatchSession = connection.createSession(true, Session.SESSION_TRANSACTED);
         MessageConsumer redispatchConsumer = redispatchSession.createConsumer(destination);
 
         session.rollback();
         session.close();
-                
+
         Message msg = redispatchConsumer.receive(1000);
         assertNotNull(msg);
         assertTrue(msg.getJMSRedelivered());
@@ -845,31 +860,31 @@ public class JMSConsumerTest extends Jms
         assertTrue(msg.getJMSRedelivered());
         assertEquals(2, msg.getLongProperty("JMSXDeliveryCount"));
         redispatchSession.commit();
-        
+
         assertNull(redispatchConsumer.receive(500));
         redispatchSession.close();
     }
-    
-    
+
+
     public void initCombosForTestAckOfExpired() {
-        addCombinationValues("destinationType", 
+        addCombinationValues("destinationType",
                 new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)});
     }
-        
+
     public void testAckOfExpired() throws Exception {
-        
+
         ActiveMQConnectionFactory fact = new ActiveMQConnectionFactory("vm://localhost?jms.prefetchPolicy.all=4&jms.sendAcksAsync=false");
         connection = fact.createActiveMQConnection();
-        
+
         connection.start();
-        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);  
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         destination = (ActiveMQDestination) (destinationType == ActiveMQDestination.QUEUE_TYPE ?
                 session.createQueue("test") : session.createTopic("test"));
-                    
+
         MessageConsumer consumer = session.createConsumer(destination);
         connection.setStatsEnabled(true);
-                
-        Session sendSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);  
+
+        Session sendSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             MessageProducer producer = sendSession.createProducer(destination);
         producer.setTimeToLive(1000);
         final int count = 4;
@@ -877,37 +892,37 @@ public class JMSConsumerTest extends Jms
             TextMessage message = sendSession.createTextMessage("" + i);
             producer.send(message);
         }
-        
+
         // let first bunch in queue expire
         Thread.sleep(2000);
-        
+
         producer.setTimeToLive(0);
         for (int i = 0; i < count; i++) {
             TextMessage message = sendSession.createTextMessage("no expiry" + i);
             producer.send(message);
         }
-        
+
         ActiveMQMessageConsumer amqConsumer = (ActiveMQMessageConsumer) consumer;
-        
+
         for(int i=0; i<count; i++) {
             TextMessage msg = (TextMessage) amqConsumer.receive();
             assertNotNull(msg);
             assertTrue("message has \"no expiry\" text: " + msg.getText(), msg.getText().contains("no expiry"));
-            
+
             // force an ack when there are expired messages
-            amqConsumer.acknowledge();         
+            amqConsumer.acknowledge();
         }
         assertEquals("consumer has expiredMessages", count, amqConsumer.getConsumerStats().getExpiredMessageCount().getCount());
-    
+
         DestinationViewMBean view = createView(destination);
-        
+
         assertEquals("Wrong inFlightCount: " + view.getInFlightCount(), 0, view.getInFlightCount());
         assertEquals("Wrong dispatch count: " + view.getDispatchCount(), 8, view.getDispatchCount());
         assertEquals("Wrong dequeue count: " + view.getDequeueCount(), 8, view.getDequeueCount());
     }
-    
+
     protected DestinationViewMBean createView(ActiveMQDestination destination) throws Exception {
-         
+
          String domain = "org.apache.activemq";
          ObjectName name;
         if (destination.isQueue()) {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java Wed Feb  6 22:56:12 2013
@@ -438,7 +438,7 @@ public class JMSMessageTest extends JmsT
         }
 
         @Override
-        public Enumeration getPropertyNames() throws JMSException {
+        public Enumeration<?> getPropertyNames() throws JMSException {
             return new Vector<String>(props.keySet()).elements();
         }
 

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java Wed Feb  6 22:56:12 2013
@@ -37,9 +37,9 @@ import javax.jms.MessageProducer;
 import javax.jms.Session;
 
 import junit.framework.Test;
+
 import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.TransportConnector;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.slf4j.Logger;
@@ -50,8 +50,8 @@ import org.slf4j.LoggerFactory;
  * same destination. Make sure you run with jvm option -server (makes a big
  * difference). The tests simulate storing 1000 1k jms messages to see the rate
  * of processing msg/sec.
- * 
- * 
+ *
+ *
  */
 public class JmsBenchmark extends JmsTestSupport {
     private static final transient Logger LOG = LoggerFactory.getLogger(JmsBenchmark.class);
@@ -76,12 +76,14 @@ public class JmsBenchmark extends JmsTes
         addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST")});
     }
 
+    @Override
     protected BrokerService createBroker() throws Exception {
         return BrokerFactory.createBroker(new URI("broker://(tcp://localhost:0)?persistent=false"));
     }
 
+    @Override
     protected ConnectionFactory createConnectionFactory() throws URISyntaxException, IOException {
-        return new ActiveMQConnectionFactory(((TransportConnector)broker.getTransportConnectors().get(0)).getServer().getConnectURI());
+        return new ActiveMQConnectionFactory(broker.getTransportConnectors().get(0).getServer().getConnectURI());
     }
 
     /**
@@ -96,7 +98,8 @@ public class JmsBenchmark extends JmsTes
         final AtomicInteger producedMessages = new AtomicInteger(0);
         final AtomicInteger receivedMessages = new AtomicInteger(0);
 
-        final Callable producer = new Callable() {
+        final Callable<Object> producer = new Callable<Object>() {
+            @Override
             public Object call() throws JMSException, InterruptedException {
                 Connection connection = factory.createConnection();
                 connections.add(connection);
@@ -119,7 +122,8 @@ public class JmsBenchmark extends JmsTes
             }
         };
 
-        final Callable consumer = new Callable() {
+        final Callable<Object> consumer = new Callable<Object>() {
+            @Override
             public Object call() throws JMSException, InterruptedException {
                 Connection connection = factory.createConnection();
                 connections.add(connection);
@@ -127,6 +131,7 @@ public class JmsBenchmark extends JmsTes
                 MessageConsumer consumer = session.createConsumer(destination);
 
                 consumer.setMessageListener(new MessageListener() {
+                    @Override
                     public void onMessage(Message msg) {
                         receivedMessages.incrementAndGet();
                     }
@@ -145,6 +150,7 @@ public class JmsBenchmark extends JmsTes
         final Throwable workerError[] = new Throwable[1];
         for (int i = 0; i < PRODUCER_COUNT; i++) {
             new Thread("Producer:" + i) {
+                @Override
                 public void run() {
                     try {
                         producer.call();
@@ -158,6 +164,7 @@ public class JmsBenchmark extends JmsTes
 
         for (int i = 0; i < CONSUMER_COUNT; i++) {
             new Thread("Consumer:" + i) {
+                @Override
                 public void run() {
                     try {
                         consumer.call();
@@ -198,7 +205,5 @@ public class JmsBenchmark extends JmsTes
         if (workerError[0] != null) {
             throw workerError[0];
         }
-
     }
-
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java Wed Feb  6 22:56:12 2013
@@ -18,13 +18,10 @@ package org.apache.activemq;
 
 import java.util.Random;
 import java.util.Vector;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
+
 import javax.jms.Connection;
 import javax.jms.JMSException;
 import javax.jms.Message;
@@ -35,7 +32,7 @@ import javax.jms.TextMessage;
 import javax.jms.Topic;
 
 /**
- * 
+ *
  */
 public class JmsConnectionStartStopTest extends TestSupport {
 
@@ -48,6 +45,7 @@ public class JmsConnectionStartStopTest 
     /**
      * @see junit.framework.TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
 
         LOG.info(getClass().getClassLoader().getResource("log4j.properties"));
@@ -61,6 +59,7 @@ public class JmsConnectionStartStopTest 
     /**
      * @see junit.framework.TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         stoppedConnection.close();
         startedConnection.close();
@@ -69,7 +68,7 @@ public class JmsConnectionStartStopTest 
     /**
      * Tests if the consumer receives the messages that were sent before the
      * connection was started.
-     * 
+     *
      * @throws JMSException
      */
     public void testStoppedConsumerHoldsMessagesTillStarted() throws JMSException {
@@ -104,7 +103,7 @@ public class JmsConnectionStartStopTest 
     /**
      * Tests if the consumer is able to receive messages eveb when the
      * connecction restarts multiple times.
-     * 
+     *
      * @throws Exception
      */
     public void testMultipleConnectionStops() throws Exception {
@@ -123,6 +122,7 @@ public class JmsConnectionStartStopTest 
         final Vector<Throwable> exceptions = new Vector<Throwable>();
         final Random rand = new Random();
         Runnable createSessionTask = new Runnable() {
+            @Override
             public void run() {
                 try {
                     TimeUnit.MILLISECONDS.sleep(rand.nextInt(10));
@@ -134,6 +134,7 @@ public class JmsConnectionStartStopTest 
         };
 
         Runnable startStopTask = new Runnable() {
+            @Override
             public void run() {
                 try {
                     TimeUnit.MILLISECONDS.sleep(rand.nextInt(10));

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java Wed Feb  6 22:56:12 2013
@@ -19,18 +19,19 @@ package org.apache.activemq;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
+
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
-import javax.jms.Queue;
 import javax.jms.QueueBrowser;
 import javax.jms.Session;
-import javax.jms.Connection;
 import javax.jms.TextMessage;
 import javax.management.ObjectName;
 import javax.management.openmbean.CompositeData;
 import javax.management.openmbean.TabularData;
+
 import junit.framework.Test;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.jmx.QueueViewMBean;
 import org.apache.activemq.broker.region.BaseDestination;
@@ -39,7 +40,7 @@ import org.apache.activemq.broker.region
 import org.apache.activemq.command.ActiveMQQueue;
 
 /**
- * 
+ *
  */
 public class JmsQueueBrowserTest extends JmsTestSupport {
     private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
@@ -80,16 +81,16 @@ public class JmsQueueBrowserTest extends
         consumer.close();
         //Thread.sleep(200);
 
-        QueueBrowser browser = session.createBrowser((Queue) destination);
-        Enumeration enumeration = browser.getEnumeration();
+        QueueBrowser browser = session.createBrowser(destination);
+        Enumeration<?> enumeration = browser.getEnumeration();
 
         // browse the second
         assertTrue("should have received the second message", enumeration.hasMoreElements());
-        assertEquals(outbound[1], (Message) enumeration.nextElement());
+        assertEquals(outbound[1], enumeration.nextElement());
 
         // browse the third.
         assertTrue("Should have received the third message", enumeration.hasMoreElements());
-        assertEquals(outbound[2], (Message) enumeration.nextElement());
+        assertEquals(outbound[2], enumeration.nextElement());
 
         // There should be no more.
         boolean tooMany = false;
@@ -135,8 +136,8 @@ public class JmsQueueBrowserTest extends
             producer.send(outbound[i]);
         }
 
-        QueueBrowser browser = session.createBrowser((Queue) destination);
-        Enumeration enumeration = browser.getEnumeration();
+        QueueBrowser browser = session.createBrowser(destination);
+        Enumeration<?> enumeration = browser.getEnumeration();
 
         for (int i=0; i<outbound.length; i++) {
             assertTrue("should have a", enumeration.hasMoreElements());
@@ -149,7 +150,7 @@ public class JmsQueueBrowserTest extends
         }
 
         // verify second batch is visible to browse
-        browser = session.createBrowser((Queue) destination);
+        browser = session.createBrowser(destination);
         enumeration = browser.getEnumeration();
         for (int j=0; j<2;j++) {
             for (int i=0; i<outbound.length; i++) {
@@ -272,7 +273,7 @@ public class JmsQueueBrowserTest extends
     public void testBrowseReceive() throws Exception {
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         ActiveMQQueue destination = new ActiveMQQueue("TEST");
-       
+
         connection.start();
 
         // create consumer
@@ -285,18 +286,18 @@ public class JmsQueueBrowserTest extends
                                            session.createTextMessage("Second Message"),
                                            session.createTextMessage("Third Message")};
 
-        
+
         MessageProducer producer = session.createProducer(destination);
         producer.send(outbound[0]);
-        
+
         // create browser first
-        QueueBrowser browser = session.createBrowser((Queue) destination);
-        Enumeration enumeration = browser.getEnumeration();
+        QueueBrowser browser = session.createBrowser(destination);
+        Enumeration<?> enumeration = browser.getEnumeration();
 
         // browse the first message
         assertTrue("should have received the first message", enumeration.hasMoreElements());
-        assertEquals(outbound[0], (Message) enumeration.nextElement());
-        
+        assertEquals(outbound[0], enumeration.nextElement());
+
         // Receive the first message.
         assertEquals(outbound[0], consumer.receive(1000));
         consumer.close();
@@ -317,7 +318,7 @@ public class JmsQueueBrowserTest extends
         }
 
         QueueBrowser browser = session.createBrowser(destination);
-        Enumeration enumeration = browser.getEnumeration();
+        Enumeration<?> enumeration = browser.getEnumeration();
 
         assertTrue(enumeration.hasMoreElements());
 
@@ -334,14 +335,14 @@ public class JmsQueueBrowserTest extends
         producer.close();
 
     }
-    
+
     public void testQueueBrowserWith2Consumers() throws Exception {
         final int numMessages = 1000;
         connection.setAlwaysSyncSend(false);
         Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         ActiveMQQueue destination = new ActiveMQQueue("TEST");
         ActiveMQQueue destinationPrefetch10 = new ActiveMQQueue("TEST?jms.prefetchSize=10");
-        ActiveMQQueue destinationPrefetch1 = new ActiveMQQueue("TEST?jms.prefetchsize=1");      
+        ActiveMQQueue destinationPrefetch1 = new ActiveMQQueue("TEST?jms.prefetchsize=1");
         connection.start();
 
         ActiveMQConnection connection2 = (ActiveMQConnection)factory.createConnection(userName, password);
@@ -355,15 +356,16 @@ public class JmsQueueBrowserTest extends
         // lets consume any outstanding messages from previous test runs
         while (consumer.receive(1000) != null) {
         }
-  
+
         for (int i=0; i<numMessages; i++) {
             TextMessage message = session.createTextMessage("Message: " + i);
-            producer.send(message);   
+            producer.send(message);
         }
-        
+
         QueueBrowser browser = session2.createBrowser(destinationPrefetch1);
+        @SuppressWarnings("unchecked")
         Enumeration<Message> browserView = browser.getEnumeration();
-    
+
         List<Message> messages = new ArrayList<Message>();
         for (int i = 0; i < numMessages; i++) {
             Message m1 = consumer.receive(5000);
@@ -378,7 +380,7 @@ public class JmsQueueBrowserTest extends
             assertNotNull("m2 is null for index: " + i, m2);
             assertEquals(m1.getJMSMessageID(), m2.getJMSMessageID());
         }
-        
+
         // currently browse max page size is ignored for a queue browser consumer
         // only guarantee is a page size - but a snapshot of pagedinpending is
         // used so it is most likely more
@@ -412,19 +414,16 @@ public class JmsQueueBrowserTest extends
 
 
         // create browser first
-        QueueBrowser browser = session.createBrowser((Queue) destination);
-        Enumeration enumeration = browser.getEnumeration();
-
+        QueueBrowser browser = session.createBrowser(destination);
+        Enumeration<?> enumeration = browser.getEnumeration();
 
         // browse some messages
-        assertEquals(outbound[0], (Message) enumeration.nextElement());
-        assertEquals(outbound[1], (Message) enumeration.nextElement());
+        assertEquals(outbound[0], enumeration.nextElement());
+        assertEquals(outbound[1], enumeration.nextElement());
         //assertEquals(outbound[2], (Message) enumeration.nextElement());
 
-
         browser.close();
 
-
         // Receive the first message.
         TextMessage msg = (TextMessage)consumer.receive(1000);
         assertEquals("Expected " + outbound[0].getText() + " but received " + msg.getText(),  outbound[0], msg);
@@ -435,9 +434,9 @@ public class JmsQueueBrowserTest extends
 
         consumer.close();
         producer.close();
-
     }
 
+    @Override
     protected BrokerService createBroker() throws Exception {
         BrokerService brokerService = super.createBroker();
         PolicyMap policyMap = new PolicyMap();
@@ -447,5 +446,4 @@ public class JmsQueueBrowserTest extends
         brokerService.setDestinationPolicy(policyMap);
         return brokerService;
     }
-
 }

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java Wed Feb  6 22:56:12 2013
@@ -17,19 +17,18 @@
 package org.apache.activemq;
 
 import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
- * 
+ *
  */
 public class JmsQueueSendReceiveTwoConnectionsTest extends JmsTopicSendReceiveWithTwoConnectionsTest {
 
     /**
      * Set up the test with a queue and using two connections.
-     * 
+     *
      * @see junit.framework.TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         topic = false;
         super.setUp();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java Wed Feb  6 22:56:12 2013
@@ -40,6 +40,7 @@ import javax.jms.TemporaryQueue;
 import javax.jms.TextMessage;
 
 import junit.framework.TestCase;
+
 import org.apache.activemq.transport.TransportListener;
 import org.apache.activemq.transport.vm.VMTransport;
 import org.apache.activemq.util.Wait;
@@ -56,6 +57,7 @@ public class JmsTempDestinationTest exte
     private ActiveMQConnectionFactory factory;
     protected List<Connection> connections = Collections.synchronizedList(new ArrayList<Connection>());
 
+    @Override
     protected void setUp() throws Exception {
         factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
         factory.setAlwaysSyncSend(true);
@@ -66,9 +68,10 @@ public class JmsTempDestinationTest exte
     /**
      * @see junit.framework.TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
-        for (Iterator iter = connections.iterator(); iter.hasNext();) {
-            Connection conn = (Connection)iter.next();
+        for (Iterator<Connection> iter = connections.iterator(); iter.hasNext();) {
+            Connection conn = iter.next();
             try {
                 conn.close();
             } catch (Throwable e) {
@@ -79,7 +82,7 @@ public class JmsTempDestinationTest exte
 
     /**
      * Make sure Temp destination can only be consumed by local connection
-     * 
+     *
      * @throws JMSException
      */
     public void testTempDestOnlyConsumedByLocalConn() throws JMSException {
@@ -120,7 +123,7 @@ public class JmsTempDestinationTest exte
     /**
      * Make sure that a temp queue does not drop message if there is an active
      * consumers.
-     * 
+     *
      * @throws JMSException
      */
     public void testTempQueueHoldsMessagesWithConsumers() throws JMSException {
@@ -143,7 +146,7 @@ public class JmsTempDestinationTest exte
     /**
      * Make sure that a temp queue does not drop message if there are no active
      * consumers.
-     * 
+     *
      * @throws JMSException
      */
     public void testTempQueueHoldsMessagesWithoutConsumers() throws JMSException {
@@ -166,14 +169,14 @@ public class JmsTempDestinationTest exte
 
     /**
      * Test temp queue works under load
-     * 
+     *
      * @throws JMSException
      */
     public void testTmpQueueWorksUnderLoad() throws JMSException {
         int count = 500;
         int dataSize = 1024;
 
-        ArrayList list = new ArrayList(count);
+        ArrayList<BytesMessage> list = new ArrayList<BytesMessage>(count);
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         Queue queue = session.createTemporaryQueue();
         MessageProducer producer = session.createProducer(queue);
@@ -201,13 +204,13 @@ public class JmsTempDestinationTest exte
     /**
      * Make sure you cannot publish to a temp destination that does not exist
      * anymore.
-     * 
+     *
      * @throws JMSException
      * @throws InterruptedException
-     * @throws URISyntaxException 
+     * @throws URISyntaxException
      */
     public void testPublishFailsForClosedConnection() throws Exception {
-        
+
         Connection tempConnection = factory.createConnection();
         connections.add(tempConnection);
         Session tempSession = tempConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -249,7 +252,7 @@ public class JmsTempDestinationTest exte
     /**
      * Make sure you cannot publish to a temp destination that does not exist
      * anymore.
-     * 
+     *
      * @throws JMSException
      * @throws InterruptedException
      */
@@ -295,7 +298,7 @@ public class JmsTempDestinationTest exte
 
     /**
      * Test you can't delete a Destination with Active Subscribers
-     * 
+     *
      * @throws JMSException
      */
     public void testDeleteDestinationWithSubscribersFails() throws JMSException {

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/LargeStreamletTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/LargeStreamletTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/LargeStreamletTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/LargeStreamletTest.java Wed Feb  6 22:56:12 2013
@@ -42,8 +42,8 @@ import java.util.concurrent.atomic.Atomi
 import javax.jms.Destination;
 import javax.jms.Session;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -60,9 +60,9 @@ public final class LargeStreamletTest ex
     protected Exception writerException;
     protected Exception readerException;
 
-    private AtomicInteger totalRead = new AtomicInteger();
-    private AtomicInteger totalWritten = new AtomicInteger();
-    private AtomicBoolean stopThreads = new AtomicBoolean(false);
+    private final AtomicInteger totalRead = new AtomicInteger();
+    private final AtomicInteger totalWritten = new AtomicInteger();
+    private final AtomicBoolean stopThreads = new AtomicBoolean(false);
 
     public void testStreamlets() throws Exception {
         final ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(BROKER_URL);
@@ -75,6 +75,7 @@ public final class LargeStreamletTest ex
                 final Destination destination = session.createQueue("wibble");
                 final Thread readerThread = new Thread(new Runnable() {
 
+                    @Override
                     public void run() {
                         totalRead.set(0);
                         try {
@@ -100,6 +101,7 @@ public final class LargeStreamletTest ex
                 final Thread writerThread = new Thread(new Runnable() {
                     private final Random random = new Random();
 
+                    @Override
                     public void run() {
                         totalWritten.set(0);
                         int count = MESSAGE_COUNT;
@@ -147,7 +149,7 @@ public final class LargeStreamletTest ex
                 assertTrue("Should not have received a reader exception", readerException == null);
                 assertTrue("Should not have received a writer exception", writerException == null);
 
-                Assert.assertEquals("Not all messages accounted for", totalWritten.get(), totalRead.get());
+                assertEquals("Not all messages accounted for", totalWritten.get(), totalRead.get());
 
             } finally {
                 session.close();

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageEvictionTest.java Wed Feb  6 22:56:12 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.activemq;
 
-import static junit.framework.Assert.fail;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -41,7 +41,6 @@ import javax.jms.Topic;
 
 import org.apache.activemq.advisory.AdvisorySupport;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.TransportConnector;
 import org.apache.activemq.broker.region.policy.ConstantPendingMessageLimitStrategy;
 import org.apache.activemq.broker.region.policy.FilePendingSubscriberMessageStoragePolicy;
 import org.apache.activemq.broker.region.policy.OldestMessageEvictionStrategy;
@@ -53,10 +52,10 @@ import org.apache.activemq.command.Activ
 import org.apache.activemq.command.ActiveMQMessage;
 import org.apache.activemq.command.ActiveMQTopic;
 import org.apache.activemq.util.Wait;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.junit.After;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class MessageEvictionTest {
     static final Logger LOG = LoggerFactory.getLogger(MessageEvictionTest.class);
@@ -78,45 +77,47 @@ public class MessageEvictionTest {
         session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         destination = session.createTopic(destinationName);
     }
-    
+
     @After
     public void tearDown() throws Exception {
         connection.stop();
         broker.stop();
     }
-    
+
     @Test
     public void testMessageEvictionMemoryUsageFileCursor() throws Exception {
         setUp(new FilePendingSubscriberMessageStoragePolicy());
         doTestMessageEvictionMemoryUsage();
     }
-    
+
     @Test
     public void testMessageEvictionMemoryUsageVmCursor() throws Exception {
         setUp(new VMPendingSubscriberMessageStoragePolicy());
         doTestMessageEvictionMemoryUsage();
     }
-    
+
     @Test
     public void testMessageEvictionDiscardedAdvisory() throws Exception {
         setUp(new VMPendingSubscriberMessageStoragePolicy());
-        
+
         ExecutorService executor = Executors.newSingleThreadExecutor();
         final CountDownLatch consumerRegistered = new CountDownLatch(1);
         final CountDownLatch gotAdvisory = new CountDownLatch(1);
         final CountDownLatch advisoryIsGood = new CountDownLatch(1);
-        
+
         executor.execute(new Runnable() {
+            @Override
             public void run() {
                 try {
-                    ActiveMQTopic discardedAdvisoryDestination = 
+                    ActiveMQTopic discardedAdvisoryDestination =
                         AdvisorySupport.getMessageDiscardedAdvisoryTopic(destination);
-                    // use separate session rather than asyncDispatch on consumer session 
+                    // use separate session rather than asyncDispatch on consumer session
                     // as we want consumer session to block
                     Session advisorySession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                     final MessageConsumer consumer = advisorySession.createConsumer(discardedAdvisoryDestination);
                     consumer.setMessageListener(new MessageListener() {
                         int advisoriesReceived = 0;
+                        @Override
                         public void onMessage(Message message) {
                             try {
                                 LOG.info("advisory:" + message);
@@ -131,7 +132,7 @@ public class MessageEvictionTest {
                             } finally {
                                 gotAdvisory.countDown();
                             }
-                        }           
+                        }
                     });
                     consumerRegistered.countDown();
                     gotAdvisory.await(120, TimeUnit.SECONDS);
@@ -148,18 +149,20 @@ public class MessageEvictionTest {
         assertTrue("got an advisory for discarded", gotAdvisory.await(0, TimeUnit.SECONDS));
         assertTrue("advisory is good",advisoryIsGood.await(0, TimeUnit.SECONDS));
     }
-    
+
     public void doTestMessageEvictionMemoryUsage() throws Exception {
-        
+
         ExecutorService executor = Executors.newCachedThreadPool();
         final CountDownLatch doAck = new CountDownLatch(1);
         final CountDownLatch ackDone = new CountDownLatch(1);
         final CountDownLatch consumerRegistered = new CountDownLatch(1);
         executor.execute(new Runnable() {
+            @Override
             public void run() {
                 try {
                     final MessageConsumer consumer = session.createConsumer(destination);
                     consumer.setMessageListener(new MessageListener() {
+                        @Override
                         public void onMessage(Message message) {
                             try {
                                 // very slow, only ack once
@@ -168,13 +171,13 @@ public class MessageEvictionTest {
                                 message.acknowledge();
                                 ackDone.countDown();
                             } catch (Exception e) {
-                                e.printStackTrace();   
+                                e.printStackTrace();
                                 fail(e.toString());
                             } finally {
                                 consumerRegistered.countDown();
                                 ackDone.countDown();
                             }
-                        }           
+                        }
                     });
                     consumerRegistered.countDown();
                     ackDone.await(60, TimeUnit.SECONDS);
@@ -185,12 +188,13 @@ public class MessageEvictionTest {
                 }
             }
         });
-        
+
         assertTrue("we have a consumer", consumerRegistered.await(10, TimeUnit.SECONDS));
-        
+
         final AtomicInteger sent = new AtomicInteger(0);
         final CountDownLatch sendDone = new CountDownLatch(1);
         executor.execute(new Runnable() {
+            @Override
             public void run() {
                MessageProducer producer;
                try {
@@ -209,17 +213,18 @@ public class MessageEvictionTest {
                }
             }
         });
-        
+
         assertTrue("messages sending done", sendDone.await(180, TimeUnit.SECONDS));
         assertEquals("all message were sent", numMessages, sent.get());
-        
+
         doAck.countDown();
         executor.shutdown();
         executor.awaitTermination(30, TimeUnit.SECONDS);
-        
+
         assertTrue("usage goes to 0 once consumer goes away", Wait.waitFor(new Wait.Condition() {
+            @Override
             public boolean isSatisified() throws Exception {
-                return 0 == TestSupport.getDestination(broker, 
+                return 0 == TestSupport.getDestination(broker,
                         ActiveMQDestination.transform(destination)).getMemoryUsage().getPercentUsage();
             }
         }));
@@ -230,22 +235,22 @@ public class MessageEvictionTest {
         brokerService.addConnector("tcp://localhost:0");
         brokerService.setUseJmx(false);
         brokerService.setDeleteAllMessagesOnStartup(true);
-        
+
         // spooling to disk early so topic memory limit is not reached
         brokerService.getSystemUsage().getMemoryUsage().setLimit(500*1024);
-        
+
         final List<PolicyEntry> policyEntries = new ArrayList<PolicyEntry>();
         final PolicyEntry entry = new PolicyEntry();
         entry.setTopic(">");
-        
+
         entry.setAdvisoryForDiscardingMessages(true);
-        
+
         // so consumer does not get over run while blocked limit the prefetch
         entry.setTopicPrefetch(50);
-        
-        
+
+
         entry.setPendingSubscriberPolicy(pendingSubscriberPolicy);
-        
+
         // limit the number of outstanding messages, large enough to use the file store
         // or small enough not to blow memory limit
         int pendingMessageLimit = 50;
@@ -261,7 +266,7 @@ public class MessageEvictionTest {
         // whether to check expiry before eviction, default limit 1000 is fine as no ttl set in this test
         //messageEvictionStrategy.setEvictExpiredMessagesHighWatermark(1000);
         entry.setMessageEvictionStrategy(messageEvictionStrategy);
-        
+
         // let evicted messaged disappear
         entry.setDeadLetterStrategy(null);
         policyEntries.add(entry);
@@ -269,12 +274,12 @@ public class MessageEvictionTest {
         final PolicyMap policyMap = new PolicyMap();
         policyMap.setPolicyEntries(policyEntries);
         brokerService.setDestinationPolicy(policyMap);
-        
+
         return brokerService;
     }
 
     ConnectionFactory createConnectionFactory() throws Exception {
-        String url = ((TransportConnector) broker.getTransportConnectors().get(0)).getServer().getConnectURI().toString();
+        String url = broker.getTransportConnectors().get(0).getServer().getConnectURI().toString();
         ActiveMQConnectionFactory factory =  new ActiveMQConnectionFactory(url);
         factory.setWatchTopicAdvisories(false);
         return factory;

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java?rev=1443267&r1=1443266&r2=1443267&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java (original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java Wed Feb  6 22:56:12 2013
@@ -24,8 +24,8 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
+
 import org.apache.activemq.command.ActiveMQQueue;
 
 public class QueueConsumerPriorityTest extends TestCase {
@@ -36,10 +36,12 @@ public class QueueConsumerPriorityTest e
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -64,6 +66,7 @@ public class QueueConsumerPriorityTest e
 
             consumerLowPriority = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
             consumerHighPriority = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            assertNotNull(consumerHighPriority);
             senderSession = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
             String queueName = getClass().getName();
             ActiveMQQueue low = new ActiveMQQueue(queueName+"?consumer.priority=1");
@@ -79,17 +82,13 @@ public class QueueConsumerPriorityTest e
             Message msg = senderSession.createTextMessage("test");
             for (int i =0; i< 10000;i++) {
                 producer.send(msg);
-                Assert.assertNotNull("null on iteration: " + i, highConsumer.receive(500));
+                assertNotNull("null on iteration: " + i, highConsumer.receive(500));
             }
-            Assert.assertNull(lowConsumer.receive(2000));
-            
-           
+            assertNull(lowConsumer.receive(2000));
+
         } finally {
             conn.close();
         }
-
     }
-
-
 }
 



Mime
View raw message