activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r564679 [7/8] - in /activemq/trunk: activemq-core/src/main/java/org/apache/activemq/ activemq-core/src/main/java/org/apache/activemq/broker/ activemq-core/src/main/java/org/apache/activemq/broker/jmx/ activemq-core/src/main/java/org/apache/...
Date Fri, 10 Aug 2007 16:57:10 GMT
Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java Fri Aug 10 09:57:01 2007
@@ -61,8 +61,8 @@
     public static final String AUTO_ASSIGN_TRANSPORT = "tcp://localhost:0";
     public static int maxSetupTime = 5000;
 
-    protected Map brokers;
-    protected Map destinations;
+    protected Map<String, BrokerItem> brokers;
+    protected Map<String, Destination> destinations;
 
     protected int messageSize = 1;
 
@@ -74,15 +74,15 @@
     }
 
     protected void bridgeBrokers(String localBrokerName, String remoteBrokerName, boolean dynamicOnly) throws Exception {
-        BrokerService localBroker = ((BrokerItem)brokers.get(localBrokerName)).broker;
-        BrokerService remoteBroker = ((BrokerItem)brokers.get(remoteBrokerName)).broker;
+        BrokerService localBroker = brokers.get(localBrokerName).broker;
+        BrokerService remoteBroker = brokers.get(remoteBrokerName).broker;
 
         bridgeBrokers(localBroker, remoteBroker, dynamicOnly, 1);
     }
 
     protected NetworkConnector bridgeBrokers(String localBrokerName, String remoteBrokerName, boolean dynamicOnly, int networkTTL) throws Exception {
-        BrokerService localBroker = ((BrokerItem)brokers.get(localBrokerName)).broker;
-        BrokerService remoteBroker = ((BrokerItem)brokers.get(remoteBrokerName)).broker;
+        BrokerService localBroker = brokers.get(localBrokerName).broker;
+        BrokerService remoteBroker = brokers.get(remoteBrokerName).broker;
 
         return bridgeBrokers(localBroker, remoteBroker, dynamicOnly, networkTTL);
     }
@@ -113,9 +113,9 @@
     }
 
     protected void bridgeAllBrokers(String groupName) throws Exception {
-        Collection brokerList = brokers.values();
-        for (Iterator i = brokerList.iterator(); i.hasNext();) {
-            BrokerService broker = ((BrokerItem)i.next()).broker;
+        Collection<BrokerItem> brokerList = brokers.values();
+        for (Iterator<BrokerItem> i = brokerList.iterator(); i.hasNext();) {
+            BrokerService broker = i.next().broker;
             List transportConnectors = broker.getTransportConnectors();
 
             if (transportConnectors.isEmpty()) {
@@ -133,9 +133,9 @@
     }
 
     protected void startAllBrokers() throws Exception {
-        Collection brokerList = brokers.values();
-        for (Iterator i = brokerList.iterator(); i.hasNext();) {
-            BrokerService broker = ((BrokerItem)i.next()).broker;
+        Collection<BrokerItem> brokerList = brokers.values();
+        for (Iterator<BrokerItem> i = brokerList.iterator(); i.hasNext();) {
+            BrokerService broker = i.next().broker;
             broker.start();
         }
 
@@ -168,7 +168,7 @@
     }
 
     protected ConnectionFactory getConnectionFactory(String brokerName) throws Exception {
-        BrokerItem brokerItem = (BrokerItem)brokers.get(brokerName);
+        BrokerItem brokerItem = brokers.get(brokerName);
         if (brokerItem != null) {
             return brokerItem.factory;
         }
@@ -176,7 +176,7 @@
     }
 
     protected Connection createConnection(String brokerName) throws Exception {
-        BrokerItem brokerItem = (BrokerItem)brokers.get(brokerName);
+        BrokerItem brokerItem = brokers.get(brokerName);
         if (brokerItem != null) {
             return brokerItem.createConnection();
         }
@@ -188,7 +188,7 @@
     }
 
     protected MessageConsumer createConsumer(String brokerName, Destination dest, CountDownLatch latch) throws Exception {
-        BrokerItem brokerItem = (BrokerItem)brokers.get(brokerName);
+        BrokerItem brokerItem = brokers.get(brokerName);
         if (brokerItem != null) {
             return brokerItem.createConsumer(dest, latch);
         }
@@ -196,7 +196,7 @@
     }
 
     protected MessageConsumer createDurableSubscriber(String brokerName, Topic dest, String name) throws Exception {
-        BrokerItem brokerItem = (BrokerItem)brokers.get(brokerName);
+        BrokerItem brokerItem = brokers.get(brokerName);
         if (brokerItem != null) {
             return brokerItem.createDurableSubscriber(dest, name);
         }
@@ -204,7 +204,7 @@
     }
 
     protected MessageIdList getBrokerMessages(String brokerName) {
-        BrokerItem brokerItem = (BrokerItem)brokers.get(brokerName);
+        BrokerItem brokerItem = brokers.get(brokerName);
         if (brokerItem != null) {
             return brokerItem.getAllMessages();
         }
@@ -212,7 +212,7 @@
     }
 
     protected MessageIdList getConsumerMessages(String brokerName, MessageConsumer consumer) {
-        BrokerItem brokerItem = (BrokerItem)brokers.get(brokerName);
+        BrokerItem brokerItem = brokers.get(brokerName);
         if (brokerItem != null) {
             return brokerItem.getConsumerMessages(consumer);
         }
@@ -220,7 +220,7 @@
     }
 
     protected void sendMessages(String brokerName, Destination destination, int count) throws Exception {
-        BrokerItem brokerItem = (BrokerItem)brokers.get(brokerName);
+        BrokerItem brokerItem = brokers.get(brokerName);
 
         Connection conn = brokerItem.createConnection();
         conn.start();
@@ -273,8 +273,8 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        brokers = new HashMap();
-        destinations = new HashMap();
+        brokers = new HashMap<String, BrokerItem>();
+        destinations = new HashMap<String, Destination>();
     }
 
     protected void tearDown() throws Exception {
@@ -283,7 +283,7 @@
     }
 
     protected void destroyBroker(String brokerName) throws Exception {
-        BrokerItem brokerItem = (BrokerItem)brokers.remove(brokerName);
+        BrokerItem brokerItem = brokers.remove(brokerName);
 
         if (brokerItem != null) {
             brokerItem.destroy();
@@ -291,8 +291,8 @@
     }
 
     protected void destroyAllBrokers() throws Exception {
-        for (Iterator i = brokers.values().iterator(); i.hasNext();) {
-            BrokerItem brokerItem = (BrokerItem)i.next();
+        for (Iterator<BrokerItem> i = brokers.values().iterator(); i.hasNext();) {
+            BrokerItem brokerItem = i.next();
             brokerItem.destroy();
         }
         brokers.clear();
@@ -302,20 +302,18 @@
     public class BrokerItem {
         public BrokerService broker;
         public ActiveMQConnectionFactory factory;
-        public List connections;
-        public Map consumers;
+        public List<Connection> connections;
+        public Map<MessageConsumer, MessageIdList> consumers;
         public MessageIdList allMessages = new MessageIdList();
-
-        private IdGenerator id;
-
         public boolean persistent;
+        private IdGenerator id;
 
         public BrokerItem(BrokerService broker) throws Exception {
             this.broker = broker;
 
             factory = new ActiveMQConnectionFactory(broker.getVmConnectorURI());
-            consumers = Collections.synchronizedMap(new HashMap());
-            connections = Collections.synchronizedList(new ArrayList());
+            consumers = Collections.synchronizedMap(new HashMap<MessageConsumer, MessageIdList>());
+            connections = Collections.synchronizedList(new ArrayList<Connection>());
             allMessages.setVerbose(verbose);
             id = new IdGenerator(broker.getBrokerName() + ":");
         }
@@ -375,7 +373,7 @@
         }
 
         public MessageIdList getConsumerMessages(MessageConsumer consumer) {
-            return (MessageIdList)consumers.get(consumer);
+            return consumers.get(consumer);
         }
 
         public MessageProducer createProducer(Destination dest) throws Exception {
@@ -393,7 +391,7 @@
 
         public void destroy() throws Exception {
             while (!connections.isEmpty()) {
-                Connection c = (Connection)connections.remove(0);
+                Connection c = connections.remove(0);
                 try {
                     c.close();
                 } catch (ConnectionClosedException e) {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java Fri Aug 10 09:57:01 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.activemq;
 
-
 import javax.jms.Connection;
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
@@ -36,7 +35,7 @@
         BrokerService broker = new BrokerService();
         broker.setPersistent(false);
         broker.setUseJmx(true);
-        broker.setPlugins(new BrokerPlugin[] { new ConnectionDotFilePlugin(), new UDPTraceBrokerPlugin() });
+        broker.setPlugins(new BrokerPlugin[] {new ConnectionDotFilePlugin(), new UDPTraceBrokerPlugin()});
         broker.addConnector("tcp://localhost:61616");
         broker.addConnector("stomp://localhost:61613");
         broker.start();
@@ -79,15 +78,12 @@
         assertEquals(sentMessage.getJMSMessageID(), receivedMessage.getJMSMessageID());
 
         // assert message timestamp is in window
-        assertTrue("JMS Message Timestamp should be set during the send method: \n" 
-                + "        beforeSend = " + beforeSend + "\n"
-                + "   getJMSTimestamp = " + receivedMessage.getJMSTimestamp() + "\n"
-                + "         afterSend = " + afterSend + "\n",
-                beforeSend <= receivedMessage.getJMSTimestamp() && receivedMessage.getJMSTimestamp() <= afterSend);
+        assertTrue("JMS Message Timestamp should be set during the send method: \n" + "        beforeSend = " + beforeSend + "\n" + "   getJMSTimestamp = "
+                   + receivedMessage.getJMSTimestamp() + "\n" + "         afterSend = " + afterSend + "\n", beforeSend <= receivedMessage.getJMSTimestamp()
+                                                                                                            && receivedMessage.getJMSTimestamp() <= afterSend);
 
         // assert message timestamp is unchanged
-        assertEquals("JMS Message Timestamp of recieved message should be the same as the sent message\n        ",
-                sentMessage.getJMSTimestamp(), receivedMessage.getJMSTimestamp());
+        assertEquals("JMS Message Timestamp of recieved message should be the same as the sent message\n        ", sentMessage.getJMSTimestamp(), receivedMessage.getJMSTimestamp());
 
         // Clean up
         producer.close();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempDestDeleteTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempDestDeleteTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempDestDeleteTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/advisory/TempDestDeleteTest.java Fri Aug 10 09:57:01 2007
@@ -37,7 +37,6 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
- * 
  * @version $Revision: 397249 $
  */
 public class TempDestDeleteTest extends EmbeddedBrokerTestSupport implements ConsumerListener {
@@ -60,14 +59,15 @@
         assertConsumerEvent(1, true);
 
         Topic advisoryTopic = AdvisorySupport.getConsumerAdvisoryTopic(tempTopic);
-        assertTrue( destinationExists(advisoryTopic) );
-        
+        assertTrue(destinationExists(advisoryTopic));
+
         consumer.close();
-        
-        // Once we delete the topic, the advisory topic for the destination should also be deleted.
+
+        // Once we delete the topic, the advisory topic for the destination
+        // should also be deleted.
         tempTopic.delete();
-        
-        assertFalse( destinationExists(advisoryTopic) );
+
+        assertFalse(destinationExists(advisoryTopic));
     }
 
     public void testDeleteTempQueueDeletesAvisoryTopics() throws Exception {
@@ -77,22 +77,21 @@
         assertConsumerEvent(1, true);
 
         Topic advisoryTopic = AdvisorySupport.getConsumerAdvisoryTopic(tempQueue);
-        assertTrue( destinationExists(advisoryTopic) );
-        
+        assertTrue(destinationExists(advisoryTopic));
+
         consumer.close();
-        
-        // Once we delete the queue, the advisory topic for the destination should also be deleted.
+
+        // Once we delete the queue, the advisory topic for the destination
+        // should also be deleted.
         tempQueue.delete();
-        
-        assertFalse( destinationExists(advisoryTopic) );
+
+        assertFalse(destinationExists(advisoryTopic));
     }
 
     private boolean destinationExists(Destination dest) throws Exception {
-        RegionBroker rb = (RegionBroker) broker.getBroker().getAdaptor(RegionBroker.class);
-        return rb.getTopicRegion().getDestinationMap().containsKey(dest)
-                || rb.getQueueRegion().getDestinationMap().containsKey(dest)
-                || rb.getTempTopicRegion().getDestinationMap().containsKey(dest)
-                || rb.getTempQueueRegion().getDestinationMap().containsKey(dest);
+        RegionBroker rb = (RegionBroker)broker.getBroker().getAdaptor(RegionBroker.class);
+        return rb.getTopicRegion().getDestinationMap().containsKey(dest) || rb.getQueueRegion().getDestinationMap().containsKey(dest)
+               || rb.getTempTopicRegion().getDestinationMap().containsKey(dest) || rb.getTempQueueRegion().getDestinationMap().containsKey(dest);
     }
 
     public void onConsumerEvent(ConsumerEvent event) {
@@ -103,14 +102,14 @@
         super.setUp();
         connection = createConnection();
         connection.start();
-        
+
         session = connection.createSession(false, 0);
-        
-        tempTopic = (ActiveMQTempTopic) session.createTemporaryTopic();
+
+        tempTopic = (ActiveMQTempTopic)session.createTemporaryTopic();
         topicConsumerEventSource = new ConsumerEventSource(connection, tempTopic);
         topicConsumerEventSource.setConsumerListener(this);
-    
-        tempQueue = (ActiveMQTempQueue) session.createTemporaryQueue();
+
+        tempQueue = (ActiveMQTempQueue)session.createTemporaryQueue();
         queueConsumerEventSource = new ConsumerEventSource(connection, tempQueue);
         queueConsumerEventSource.setConsumerListener(this);
     }
@@ -131,7 +130,7 @@
     protected MessageConsumer createConsumer(Destination dest) throws JMSException {
         final String consumerText = "Consumer: " + (++consumerCounter);
         LOG.info("Creating consumer: " + consumerText + " on destination: " + dest);
-        
+
         MessageConsumer consumer = session.createConsumer(dest);
         consumer.setMessageListener(new MessageListener() {
             public void onMessage(Message message) {
@@ -142,7 +141,7 @@
     }
 
     protected ConsumerEvent waitForConsumerEvent() throws InterruptedException {
-        ConsumerEvent answer = (ConsumerEvent) eventQueue.poll(1000, TimeUnit.MILLISECONDS);
+        ConsumerEvent answer = (ConsumerEvent)eventQueue.poll(1000, TimeUnit.MILLISECONDS);
         assertTrue("Should have received a consumer event!", answer != null);
         return answer;
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTestSupport.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/policy/DeadLetterTestSupport.java Fri Aug 10 09:57:01 2007
@@ -41,7 +41,6 @@
     protected Session session;
     protected MessageConsumer consumer;
     protected MessageProducer producer;
-    private Destination destination;
     protected int deliveryMode = DeliveryMode.PERSISTENT;
     protected boolean durableSubscriber;
     protected Destination dlqDestination;
@@ -49,6 +48,7 @@
     protected BrokerService broker;
     protected boolean transactedMode;
     protected int acknowledgeMode = Session.CLIENT_ACKNOWLEDGE;
+    private Destination destination;
 
     protected void setUp() throws Exception {
         super.setUp();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java Fri Aug 10 09:57:01 2007
@@ -41,10 +41,11 @@
  * @version $Revision: 1.3 $
  */
 public abstract class CursorSupport extends TestCase {
-    private static final Log LOG = LogFactory.getLog(CursorSupport.class);
 
     protected static final int MESSAGE_COUNT = 500;
     protected static final int PREFETCH_SIZE = 50;
+    private static final Log LOG = LogFactory.getLog(CursorSupport.class);
+
     protected BrokerService broker;
     protected String bindAddress = "tcp://localhost:60706";
 
@@ -63,7 +64,7 @@
         producerConnection.start();
         Session session = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer producer = session.createProducer(getDestination(session));
-        List senderList = new ArrayList();
+        List<Message> senderList = new ArrayList<Message>();
         for (int i = 0; i < MESSAGE_COUNT; i++) {
             Message msg = session.createTextMessage("test" + i);
             senderList.add(msg);
@@ -74,7 +75,7 @@
         consumerConnection = getConsumerConnection(factory);
         // create durable subs
         consumer = getConsumer(consumerConnection);
-        List consumerList = new ArrayList();
+        List<Message> consumerList = new ArrayList<Message>();
         for (int i = 0; i < MESSAGE_COUNT; i++) {
             Message msg = consumer.receive();
             consumerList.add(msg);
@@ -93,7 +94,7 @@
         producerConnection.start();
         Session session = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer producer = session.createProducer(getDestination(session));
-        List senderList = new ArrayList();
+        List<TextMessage> senderList = new ArrayList<TextMessage>();
         for (int i = 0; i < MESSAGE_COUNT / 10; i++) {
             TextMessage msg = session.createTextMessage("test" + i);
             senderList.add(msg);
@@ -103,7 +104,7 @@
         consumerConnection = getConsumerConnection(factory);
         // create durable subs
         consumer = getConsumer(consumerConnection);
-        final List consumerList = new ArrayList();
+        final List<Message> consumerList = new ArrayList<Message>();
         final CountDownLatch latch = new CountDownLatch(1);
         consumer.setMessageListener(new MessageListener() {
 
@@ -134,8 +135,8 @@
         assertEquals("Still dipatching - count down latch not sprung", latch.getCount(), 0);
         assertEquals("cosumerList - expected: " + MESSAGE_COUNT + " but was: " + consumerList.size(), consumerList.size(), senderList.size());
         for (int i = 0; i < senderList.size(); i++) {
-            Message sent = (Message)senderList.get(i);
-            Message consumed = (Message)consumerList.get(i);
+            Message sent = senderList.get(i);
+            Message consumed = consumerList.get(i);
             if (!sent.equals(consumed)) {
                 LOG.error("BAD MATCH AT POS " + i);
                 LOG.error(sent);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeQueueTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeQueueTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/CompositeQueueTest.java Fri Aug 10 09:57:01 2007
@@ -43,9 +43,8 @@
 
     private static final Log LOG = LogFactory.getLog(CompositeQueueTest.class);
     
-    private Connection connection;
-
     protected int total = 10;
+    private Connection connection;
 
 
     public void testVirtualTopicCreation() throws Exception {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/SlowConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/SlowConsumerTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/SlowConsumerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/SlowConsumerTest.java Fri Aug 10 09:57:01 2007
@@ -37,14 +37,16 @@
 import org.apache.commons.logging.LogFactory;
 
 public class SlowConsumerTest extends TestCase {
-    private static final Log LOG = LogFactory.getLog(SlowConsumerTest.class);
-    private Socket stompSocket;
-    private ByteArrayOutputStream inputBuffer;
 
+    private static final Log LOG = LogFactory.getLog(SlowConsumerTest.class);
     private static final int MESSAGES_COUNT = 10000;
-    private int messagesCount;
+
     protected int messageLogFrequency = 2500;
     protected long messageReceiveTimeout = 10000L;
+
+    private Socket stompSocket;
+    private ByteArrayOutputStream inputBuffer;
+    private int messagesCount;
 
     /**
      * @param args

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java Fri Aug 10 09:57:01 2007
@@ -43,7 +43,7 @@
 
     protected boolean readOnlyMessage;
 
-        private String jmsMessageID;
+    private String jmsMessageID;
     private String jmsCorrelationID;
     private ActiveMQDestination jmsDestination;
     private ActiveMQDestination jmsReplyTo;
@@ -787,8 +787,8 @@
         Object obj = new Object();
         try {
             ((org.apache.activemq.command.Message)msg).setProperty(propertyName, obj); // bypass
-                                                                                        // object
-                                                                                        // check
+            // object
+            // check
         } catch (IOException e) {
         }
         try {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageCompressionTest.java Fri Aug 10 09:57:01 2007
@@ -31,11 +31,8 @@
 import org.apache.activemq.broker.TransportConnector;
 
 public class MessageCompressionTest extends TestCase {
-
-    protected BrokerService broker;
-    private ActiveMQQueue queue;
+    
     private static final String BROKER_URL = "tcp://localhost:61216";
-
     // The following text should compress well
     private static final String TEXT = "The quick red fox jumped over the lazy brown dog. " + "The quick red fox jumped over the lazy brown dog. "
                                        + "The quick red fox jumped over the lazy brown dog. " + "The quick red fox jumped over the lazy brown dog. "
@@ -46,6 +43,9 @@
                                        + "The quick red fox jumped over the lazy brown dog. " + "The quick red fox jumped over the lazy brown dog. "
                                        + "The quick red fox jumped over the lazy brown dog. " + "The quick red fox jumped over the lazy brown dog. "
                                        + "The quick red fox jumped over the lazy brown dog. ";
+
+    protected BrokerService broker;
+    private ActiveMQQueue queue;
 
     protected void setUp() throws Exception {
         broker = new BrokerService();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageSendTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageSendTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageSendTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageSendTest.java Fri Aug 10 09:57:01 2007
@@ -37,12 +37,12 @@
     }
 
     public void initCombosForTestMessageSendMarshaling() {
-        addCombinationValues("cacheEnabled", new Object[] { Boolean.TRUE, Boolean.FALSE });
+        addCombinationValues("cacheEnabled", new Object[] {Boolean.TRUE, Boolean.FALSE});
     }
 
     public void testMessageSendMarshaling() throws IOException {
         ActiveMQMessage message = new ActiveMQMessage();
-        message.setCommandId((short) 1);
+        message.setCommandId((short)1);
         message.setDestination(new ActiveMQQueue("queue"));
         message.setGroupID("group");
         message.setGroupSequence(4);
@@ -58,7 +58,7 @@
         ActiveMQMessage message = new ActiveMQMessage();
         message.setProducerId(new ProducerId(new SessionId(new ConnectionId(new ConnectionId("test")), 1), 1));
         message.setMessageId(new MessageId(message.getProducerId(), 1));
-        message.setCommandId((short) 1);
+        message.setCommandId((short)1);
         message.setGroupID("group");
         message.setGroupSequence(4);
         message.setCorrelationId("correlation");

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/command/MessageTest.java Fri Aug 10 09:57:01 2007
@@ -34,12 +34,12 @@
     }
 
     public void initCombosForTestActiveMQMessageMarshaling() {
-        addCombinationValues("cacheEnabled", new Object[] { Boolean.TRUE, Boolean.FALSE });
+        addCombinationValues("cacheEnabled", new Object[] {Boolean.TRUE, Boolean.FALSE});
     }
 
     public void testActiveMQMessageMarshaling() throws IOException {
         ActiveMQMessage message = new ActiveMQMessage();
-        message.setCommandId((short) 1);
+        message.setCommandId((short)1);
         message.setOriginalDestination(new ActiveMQQueue("queue"));
         message.setGroupID("group");
         message.setGroupSequence(4);
@@ -50,7 +50,7 @@
 
     public void testActiveMQMessageMarshalingBigMessageId() throws IOException {
         ActiveMQMessage message = new ActiveMQMessage();
-        message.setCommandId((short) 1);
+        message.setCommandId((short)1);
         message.setOriginalDestination(new ActiveMQQueue("queue"));
         message.setGroupID("group");
         message.setGroupSequence(4);
@@ -61,7 +61,7 @@
 
     public void testActiveMQMessageMarshalingBiggerMessageId() throws IOException {
         ActiveMQMessage message = new ActiveMQMessage();
-        message.setCommandId((short) 1);
+        message.setCommandId((short)1);
         message.setOriginalDestination(new ActiveMQQueue("queue"));
         message.setGroupID("group");
         message.setGroupSequence(4);
@@ -72,7 +72,7 @@
 
     public void testActiveMQMessageMarshalingBiggestMessageId() throws IOException {
         ActiveMQMessage message = new ActiveMQMessage();
-        message.setCommandId((short) 1);
+        message.setCommandId((short)1);
         message.setOriginalDestination(new ActiveMQQueue("queue"));
         message.setGroupID("group");
         message.setGroupSequence(4);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java Fri Aug 10 09:57:01 2007
@@ -52,11 +52,10 @@
  */
 public class ConfigTest extends TestCase {
 
-    private static final Log LOG = LogFactory.getLog(ConfigTest.class);
-
     protected static final String JOURNAL_ROOT = "target/test-data/";
     protected static final String DERBY_ROOT = "target/test-data/";
     protected static final String CONF_ROOT = "src/test/resources/org/apache/activemq/config/sample-conf/";
+    private static final Log LOG = LogFactory.getLog(ConfigTest.class);
 
     static {
         System.setProperty("javax.net.ssl.trustStore", "src/test/resources/client.keystore");
@@ -104,7 +103,7 @@
             // Check persistence factory configurations
             // System.out.print("Checking persistence adapter factory
             // settings... ");
-            JournalPersistenceAdapter pa = (JournalPersistenceAdapter)broker.getPersistenceAdapter();
+            broker.getPersistenceAdapter();
 
             LOG.info("Success");
         } finally {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/filter/DummyPolicyTest.java Fri Aug 10 09:57:01 2007
@@ -24,19 +24,18 @@
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
- *
  * @version $Revision: 1.1 $
  */
 public class DummyPolicyTest extends SpringTestSupport {
 
     public void testPolicy() throws Exception {
-        DummyPolicy policy = (DummyPolicy) getBean("policy");
-        
+        DummyPolicy policy = (DummyPolicy)getBean("policy");
+
         Set set = policy.get(new ActiveMQTopic("FOO.BAR"));
-        
-        assertSetEquals("FOO.BAR set", new Object[] { "Edam", "Cheddar" }, set);
+
+        assertSetEquals("FOO.BAR set", new Object[] {"Edam", "Cheddar"}, set);
     }
-    
+
     protected AbstractApplicationContext createApplicationContext() {
         // TODO Auto-generated method stub
         return new ClassPathXmlApplicationContext("org/apache/activemq/filter/dummyPolicy.xml");

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/ListContainerTest.java Fri Aug 10 09:57:01 2007
@@ -24,11 +24,13 @@
 import junit.framework.TestCase;
 
 public class ListContainerTest extends TestCase {
+    
+    protected static final int COUNT = 10;
+
     protected String name = "test";
     protected Store store;
-    protected ListContainer container;
-    protected LinkedList testList;
-    protected static final int COUNT = 10;
+    protected ListContainer<Object> container;
+    protected LinkedList<Object> testList;
 
     /*
      * Test method for 'org.apache.activemq.kaha.ListContainer.size()'
@@ -93,10 +95,10 @@
      */
     public void testIterator() throws Exception {
         container.addAll(testList);
-        for (Iterator i = testList.iterator(), j = container.iterator(); i.hasNext();) {
+        for (Iterator<Object> i = testList.iterator(), j = container.iterator(); i.hasNext();) {
             assertEquals(i.next(), j.next());
         }
-        for (Iterator i = container.iterator(); i.hasNext();) {
+        for (Iterator<Object> i = container.iterator(); i.hasNext();) {
             i.next();
             i.remove();
         }
@@ -115,7 +117,7 @@
      */
     public void testContains() throws Exception {
         container.addAll(testList);
-        for (Iterator i = testList.iterator(), j = container.iterator(); i.hasNext();) {
+        for (Iterator<Object> i = testList.iterator(), j = container.iterator(); i.hasNext();) {
             assertTrue(container.contains(i.next()));
         }
     }
@@ -250,8 +252,8 @@
      */
     public void testListIterator() throws Exception {
         container.addAll(testList);
-        ListIterator containerIter = container.listIterator();
-        ListIterator testIter = testList.listIterator();
+        ListIterator<Object> containerIter = container.listIterator();
+        ListIterator<Object> testIter = testList.listIterator();
         assertTrue(testIter.hasNext());
         assertTrue(containerIter.hasNext());
         while (testIter.hasNext()) {
@@ -271,8 +273,8 @@
     public void testListIteratorInt() throws Exception {
         container.addAll(testList);
         int start = testList.size() / 2;
-        ListIterator containerIter = container.listIterator(start);
-        ListIterator testIter = testList.listIterator(start);
+        ListIterator<Object> containerIter = container.listIterator(start);
+        ListIterator<Object> testIter = testList.listIterator(start);
         assertTrue(testIter.hasNext());
         assertTrue(containerIter.hasNext());
         while (testIter.hasNext()) {
@@ -288,8 +290,8 @@
     public void testSubList() throws Exception {
         container.addAll(testList);
         int start = testList.size() / 2;
-        List l1 = testList.subList(start, testList.size());
-        List l2 = container.subList(start, testList.size());
+        List<Object> l1 = testList.subList(start, testList.size());
+        List<Object> l2 = container.subList(start, testList.size());
         assertEquals(l1.size(), l2.size());
         assertEquals(l1, l2);
     }
@@ -306,7 +308,7 @@
         store.deleteListContainer(name);
         container = store.getListContainer(name);
         container.load();
-        testList = new LinkedList();
+        testList = new LinkedList<Object>();
         for (int i = 0; i < COUNT; i++) {
             String value = "value:" + i;
             testList.add(value);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/Loader.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/Loader.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/Loader.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/Loader.java Fri Aug 10 09:57:01 2007
@@ -50,9 +50,9 @@
         try {
             start.countDown();
             start.await();
-            Marshaller keyMarshaller = new StringMarshaller();
-            Marshaller valueMarshaller = new BytesMarshaller();
-            MapContainer container = store.getMapContainer(name, Store.DEFAULT_CONTAINER_NAME, true);
+            Marshaller<String> keyMarshaller = new StringMarshaller();
+            Marshaller<Object> valueMarshaller = new BytesMarshaller();
+            MapContainer<String, Object> container = store.getMapContainer(name, Store.DEFAULT_CONTAINER_NAME, true);
 
             container.setKeyMarshaller(keyMarshaller);
             container.setValueMarshaller(valueMarshaller);
@@ -69,10 +69,10 @@
             long totalLoadTime = finishLoad - startLoad;
             LOG.info("name " + name + " load time = " + totalLoadTime + "(ms)");
 
-            Set keys = container.keySet();
+            Set<String> keys = container.keySet();
             long startExtract = System.currentTimeMillis();
 
-            for (Iterator i = keys.iterator(); i.hasNext();) {
+            for (Iterator<String> i = keys.iterator(); i.hasNext();) {
                 byte[] data = (byte[])container.get(i.next());
             }
             long finishExtract = System.currentTimeMillis();
@@ -80,7 +80,7 @@
             LOG.info("name " + name + " extract time = " + totalExtractTime + "(ms)");
 
             long startRemove = System.currentTimeMillis();
-            for (Iterator i = keys.iterator(); i.hasNext();) {
+            for (Iterator<String> i = keys.iterator(); i.hasNext();) {
                 container.remove(i.next());
             }
             long finishRemove = System.currentTimeMillis();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/MapContainerTest.java Fri Aug 10 09:57:01 2007
@@ -28,16 +28,17 @@
 
 public class MapContainerTest extends TestCase {
 
+    protected static final int COUNT = 10;
+
     protected String name = "test";
     protected Store store;
-    protected MapContainer container;
-    protected Map testMap;
-    protected static final int COUNT = 10;
+    protected MapContainer<String, String> container;
+    protected Map<String, String> testMap;
 
     public void testBasicAllocations() throws Exception {
         String key = "key";
         Object value = testMap;
-        MapContainer test = store.getMapContainer("test", "test");
+        MapContainer<String, Object> test = store.getMapContainer("test", "test");
         test.put(key, value);
         store.close();
         store = getStore();
@@ -126,9 +127,9 @@
      */
     public void testKeySet() throws Exception {
         container.putAll(testMap);
-        Set keys = container.keySet();
+        Set<String> keys = container.keySet();
         assertTrue(keys.size() == testMap.size());
-        for (Iterator i = testMap.keySet().iterator(); i.hasNext();) {
+        for (Iterator<String> i = testMap.keySet().iterator(); i.hasNext();) {
             Object key = i.next();
             assertTrue(keys.contains(key));
             keys.remove(key);
@@ -142,9 +143,9 @@
      */
     public void testValues() throws Exception {
         container.putAll(testMap);
-        Collection values = container.values();
+        Collection<String> values = container.values();
         assertTrue(values.size() == testMap.size());
-        for (Iterator i = testMap.values().iterator(); i.hasNext();) {
+        for (Iterator<String> i = testMap.values().iterator(); i.hasNext();) {
             Object value = i.next();
             assertTrue(values.contains(value));
             assertTrue(values.remove(value));
@@ -173,7 +174,7 @@
      */
     public void testRemoveObject() throws Exception {
         container.putAll(testMap);
-        for (Iterator i = testMap.keySet().iterator(); i.hasNext();) {
+        for (Iterator<String> i = testMap.keySet().iterator(); i.hasNext();) {
             container.remove(i.next());
         }
         assertTrue(container.isEmpty());
@@ -189,7 +190,7 @@
         store = getStore();
         container = store.getMapContainer("test", "test", true);
         container.load();
-        testMap = new HashMap();
+        testMap = new HashMap<String, String>();
         for (int i = 0; i < COUNT; i++) {
             String key = "key:" + i;
             String value = "value:" + i;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/VolumeTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/VolumeTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/VolumeTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/kaha/VolumeTest.java Fri Aug 10 09:57:01 2007
@@ -24,12 +24,12 @@
 import org.apache.commons.logging.LogFactory;
 
 public class VolumeTest extends TestCase {
+
+    protected static final int NUMBER = 1;
     private static final transient Log LOG = LogFactory.getLog(VolumeTest.class);
 
     protected Store store;
     protected String name;
-
-    protected static final int NUMBER = 1;
 
     /*
      * dump a large number of messages into a list - then retreive them

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java Fri Aug 10 09:57:01 2007
@@ -42,19 +42,18 @@
 
     public void testLongNumberRanges() throws Exception {
         long[] numberValues = {
-                               // bytes
-                               0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xf0, 0xff,
-                               // shorts
-                               0x7eff, 0x7fffL, 0x8001L, 0x8000L, 0xe000L, 0xe0001L, 0xff00L, 0xffffL,
-                               // ints
-                               0x10000L, 0x700000L, 0x12345678L, 0x72345678L, 0x7fffffffL, 0x80000000L, 0x80000001L, 0xE0000001L, 0xFFFFFFFFL,
-
-                               // 3 byte longs
-                               0x123456781L, 0x1234567812L, 0x12345678123L, 0x123456781234L, 0x1234567812345L, 0x12345678123456L, 0x7e345678123456L, 0x7fffffffffffffL,
-                               0x80000000000000L, 0x80000000000001L, 0xe0000000000001L, 0xffffffffffffffL,
-
-                               // 4 byte longs
-                               0x1234567812345678L, 0x7fffffffffffffffL, 0x8000000000000000L, 0x8000000000000001L, 0xe000000000000001L, 0xffffffffffffffffL, 1};
+            // bytes
+            0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xf0, 0xff,
+            // shorts
+            0x7eff, 0x7fffL, 0x8001L, 0x8000L, 0xe000L, 0xe0001L, 0xff00L, 0xffffL,
+            // ints
+            0x10000L, 0x700000L, 0x12345678L, 0x72345678L, 0x7fffffffL, 0x80000000L, 0x80000001L, 0xE0000001L, 0xFFFFFFFFL,
+            // 3 byte longs
+            0x123456781L, 0x1234567812L, 0x12345678123L, 0x123456781234L, 0x1234567812345L, 0x12345678123456L, 0x7e345678123456L, 0x7fffffffffffffL,
+            0x80000000000000L, 0x80000000000001L, 0xe0000000000001L, 0xffffffffffffffL,
+            // 4 byte longs
+            0x1234567812345678L, 0x7fffffffffffffffL, 0x8000000000000000L, 0x8000000000000001L, 0xe000000000000001L, 0xffffffffffffffffL, 1
+        };
 
         for (int i = 0; i < numberValues.length; i++) {
             long value = numberValues[i];

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/InactiveDurableTopicTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/InactiveDurableTopicTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/InactiveDurableTopicTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/InactiveDurableTopicTest.java Fri Aug 10 09:57:01 2007
@@ -52,8 +52,8 @@
     private TopicSubscriber subscriber;
     private Topic topic;
     private Session session;
-    ActiveMQConnectionFactory connectionFactory;
-    BrokerService broker;
+    private ActiveMQConnectionFactory connectionFactory;
+    private BrokerService broker;
 
     protected void setUp() throws Exception {
         super.setUp();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/SecurityTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/SecurityTestSupport.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/SecurityTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/SecurityTestSupport.java Fri Aug 10 09:57:01 2007
@@ -32,7 +32,6 @@
 import org.apache.activemq.command.ActiveMQTopic;
 
 /**
- * 
  * @version $Revision$
  */
 public class SecurityTestSupport extends JmsTestSupport {
@@ -140,8 +139,7 @@
         Message m = consumer.receive(1000);
         if (fail) {
             assertNull(m);
-        }
-        else {
+        } else {
             assertNotNull(m);
             assertEquals("0", ((TextMessage)m).getText());
             assertNull(consumer.receiveNoWait());
@@ -188,10 +186,7 @@
     public void initCombosForTestUserReceiveFails() {
         addCombinationValues("userName", new Object[] {"user"});
         addCombinationValues("password", new Object[] {"password"});
-        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"),
-                                                          new ActiveMQTopic("TEST"),
-                                                          new ActiveMQQueue("GUEST.BAR"),
-                                                          new ActiveMQTopic("GUEST.BAR"),});
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"), new ActiveMQTopic("TEST"), new ActiveMQQueue("GUEST.BAR"), new ActiveMQTopic("GUEST.BAR"),});
     }
 
     /**
@@ -208,8 +203,7 @@
     public void initCombosForTestUserReceiveSucceeds() {
         addCombinationValues("userName", new Object[] {"user"});
         addCombinationValues("password", new Object[] {"password"});
-        addCombinationValues("destination", new Object[] {new ActiveMQQueue("USERS.FOO"),
-                                                          new ActiveMQTopic("USERS.FOO"),});
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("USERS.FOO"), new ActiveMQTopic("USERS.FOO"),});
     }
 
     /**
@@ -218,8 +212,7 @@
     public void initCombosForTestGuestReceiveSucceeds() {
         addCombinationValues("userName", new Object[] {"guest"});
         addCombinationValues("password", new Object[] {"password"});
-        addCombinationValues("destination", new Object[] {new ActiveMQQueue("GUEST.BAR"),
-                                                          new ActiveMQTopic("GUEST.BAR"),});
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("GUEST.BAR"), new ActiveMQTopic("GUEST.BAR"),});
     }
 
     /**
@@ -228,10 +221,7 @@
     public void initCombosForTestGuestReceiveFails() {
         addCombinationValues("userName", new Object[] {"guest"});
         addCombinationValues("password", new Object[] {"password"});
-        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"),
-                                                          new ActiveMQTopic("TEST"),
-                                                          new ActiveMQQueue("USERS.FOO"),
-                                                          new ActiveMQTopic("USERS.FOO"),});
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"), new ActiveMQTopic("TEST"), new ActiveMQQueue("USERS.FOO"), new ActiveMQTopic("USERS.FOO"),});
     }
 
     /**
@@ -240,9 +230,7 @@
     public void initCombosForTestUserSendSucceeds() {
         addCombinationValues("userName", new Object[] {"user"});
         addCombinationValues("password", new Object[] {"password"});
-        addCombinationValues("destination", new Object[] {new ActiveMQQueue("USERS.FOO"),
-                                                          new ActiveMQQueue("GUEST.BAR"),
-                                                          new ActiveMQTopic("USERS.FOO"),
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("USERS.FOO"), new ActiveMQQueue("GUEST.BAR"), new ActiveMQTopic("USERS.FOO"),
                                                           new ActiveMQTopic("GUEST.BAR"),});
     }
 
@@ -252,8 +240,7 @@
     public void initCombosForTestUserSendFails() {
         addCombinationValues("userName", new Object[] {"user"});
         addCombinationValues("password", new Object[] {"password"});
-        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"),
-                                                          new ActiveMQTopic("TEST"),});
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"), new ActiveMQTopic("TEST"),});
     }
 
     /**
@@ -262,10 +249,7 @@
     public void initCombosForTestGuestSendFails() {
         addCombinationValues("userName", new Object[] {"guest"});
         addCombinationValues("password", new Object[] {"password"});
-        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"),
-                                                          new ActiveMQTopic("TEST"),
-                                                          new ActiveMQQueue("USERS.FOO"),
-                                                          new ActiveMQTopic("USERS.FOO")});
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"), new ActiveMQTopic("TEST"), new ActiveMQQueue("USERS.FOO"), new ActiveMQTopic("USERS.FOO")});
     }
 
     /**
@@ -274,7 +258,6 @@
     public void initCombosForTestGuestSendSucceeds() {
         addCombinationValues("userName", new Object[] {"guest"});
         addCombinationValues("password", new Object[] {"password"});
-        addCombinationValues("destination", new Object[] {new ActiveMQQueue("GUEST.BAR"),
-                                                          new ActiveMQTopic("GUEST.BAR"),});
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("GUEST.BAR"), new ActiveMQTopic("GUEST.BAR"),});
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/SimpleSecurityBrokerSystemTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/SimpleSecurityBrokerSystemTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/SimpleSecurityBrokerSystemTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/SimpleSecurityBrokerSystemTest.java Fri Aug 10 09:57:01 2007
@@ -114,9 +114,9 @@
             u.put("guest", "password");
 
             HashMap groups = new HashMap();
-            groups.put("system", new HashSet(Arrays.asList(new Object[] { ADMINS, USERS })));
-            groups.put("user", new HashSet(Arrays.asList(new Object[] { USERS })));
-            groups.put("guest", new HashSet(Arrays.asList(new Object[] { GUESTS })));
+            groups.put("system", new HashSet(Arrays.asList(new Object[] {ADMINS, USERS})));
+            groups.put("user", new HashSet(Arrays.asList(new Object[] {USERS})));
+            groups.put("guest", new HashSet(Arrays.asList(new Object[] {GUESTS})));
 
             return new SimpleAuthenticationBroker(broker, u, groups);
         }
@@ -130,16 +130,15 @@
      * @see {@link CombinationTestSupport}
      */
     public void initCombos() {
-        addCombinationValues("authorizationPlugin", new Object[] { new AuthorizationPlugin(createAuthorizationMap()), });
-        addCombinationValues("authenticationPlugin", new Object[] { new SimpleAuthenticationFactory(), new JaasAuthenticationPlugin(), });
+        addCombinationValues("authorizationPlugin", new Object[] {new AuthorizationPlugin(createAuthorizationMap()),});
+        addCombinationValues("authenticationPlugin", new Object[] {new SimpleAuthenticationFactory(), new JaasAuthenticationPlugin(),});
     }
 
     protected BrokerService createBroker() throws Exception {
         BrokerService broker = super.createBroker();
-        broker.setPlugins(new BrokerPlugin[] { authorizationPlugin, authenticationPlugin });
+        broker.setPlugins(new BrokerPlugin[] {authorizationPlugin, authenticationPlugin});
         broker.setPersistent(false);
         return broker;
     }
-
 
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/StubJaasConfiguration.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/StubJaasConfiguration.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/StubJaasConfiguration.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/StubJaasConfiguration.java Fri Aug 10 09:57:01 2007
@@ -22,13 +22,13 @@
 
 public class StubJaasConfiguration extends Configuration {
     private AppConfigurationEntry configEntry;
-    
+
     public StubJaasConfiguration(AppConfigurationEntry configEntry) {
         this.configEntry = configEntry;
     }
-    
+
     public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
-        return new AppConfigurationEntry[] { configEntry };
+        return new AppConfigurationEntry[] {configEntry};
     }
 
     public void refresh() {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/ConsumerBean.java Fri Aug 10 09:57:01 2007
@@ -22,10 +22,9 @@
 import javax.jms.Message;
 import javax.jms.MessageListener;
 
+import junit.framework.Assert;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import junit.framework.Assert;
 
 public class ConsumerBean extends Assert implements MessageListener {
     private static final Log LOG = LogFactory.getLog(ConsumerBean.class);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/streams/JMSInputStreamTest.java Fri Aug 10 09:57:01 2007
@@ -33,11 +33,11 @@
  */
 public class JMSInputStreamTest extends JmsTestSupport {
 
+    public Destination destination;
     protected DataOutputStream out;
     protected DataInputStream in;
     private ActiveMQConnection connection2;
 
-    public Destination destination;
 
     public static Test suite() {
         return suite(JMSInputStreamTest.class);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java Fri Aug 10 09:57:01 2007
@@ -41,7 +41,7 @@
         Object value = message.getObjectProperty("textField");
         assertEquals("textField", data[index], value);
 
-        Map map = (Map) message.getObjectProperty("mapField");
+        Map map = (Map)message.getObjectProperty("mapField");
         assertNotNull(map);
         assertEquals("mapField.a", "foo", map.get("a"));
         assertEquals("mapField.b", new Integer(23), map.get("b"));
@@ -49,18 +49,18 @@
 
         value = map.get("d");
         assertTrue("mapField.d should be a Map", value instanceof Map);
-        map = (Map) value;
+        map = (Map)value;
 
         assertEquals("mapField.d.x", "abc", map.get("x"));
         value = map.get("y");
         assertTrue("mapField.d.y is a List", value instanceof List);
-        List list = (List) value;
+        List list = (List)value;
         LOG.debug("mapField.d.y: " + list);
         assertEquals("listField.size", 3, list.size());
 
         LOG.debug("Found map: " + map);
 
-        list = (List) message.getObjectProperty("listField");
+        list = (List)message.getObjectProperty("listField");
         LOG.debug("listField: " + list);
         assertEquals("listField.size", 3, list.size());
         assertEquals("listField[0]", "a", list.get(0));
@@ -73,18 +73,18 @@
 
         answer.setStringProperty("textField", data[index]);
 
-        Map grandChildMap = new HashMap();
+        Map<String, Object> grandChildMap = new HashMap<String, Object>();
         grandChildMap.put("x", "abc");
-        grandChildMap.put("y", Arrays.asList(new Object[] { "a", "b", "c" }));
+        grandChildMap.put("y", Arrays.asList(new Object[] {"a", "b", "c"}));
 
-        Map nestedMap = new HashMap();
+        Map<String, Object> nestedMap = new HashMap<String, Object>();
         nestedMap.put("a", "foo");
         nestedMap.put("b", new Integer(23));
         nestedMap.put("c", new Long(45));
         nestedMap.put("d", grandChildMap);
 
         answer.setObjectProperty("mapField", nestedMap);
-        answer.setObjectProperty("listField", Arrays.asList(new Object[] { "a", "b", "c" }));
+        answer.setObjectProperty("listField", Arrays.asList(new Object[] {"a", "b", "c"}));
 
         return answer;
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java Fri Aug 10 09:57:01 2007
@@ -30,7 +30,6 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
- * 
  * @version $Revision$
  */
 public class NestedMapMessageTest extends JmsTopicSendReceiveWithTwoConnectionsAndEmbeddedBrokerTest {
@@ -40,12 +39,12 @@
     protected void assertMessageValid(int index, Message message) throws JMSException {
         assertTrue("Should be a MapMessage: " + message, message instanceof MapMessage);
 
-        MapMessage mapMessage = (MapMessage) message;
+        MapMessage mapMessage = (MapMessage)message;
 
         Object value = mapMessage.getObject("textField");
         assertEquals("textField", data[index], value);
 
-        Map map = (Map) mapMessage.getObject("mapField");
+        Map map = (Map)mapMessage.getObject("mapField");
         assertNotNull(map);
         assertEquals("mapField.a", "foo", map.get("a"));
         assertEquals("mapField.b", Integer.valueOf(23), map.get("b"));
@@ -53,18 +52,18 @@
 
         value = map.get("d");
         assertTrue("mapField.d should be a Map", value instanceof Map);
-        map = (Map) value;
+        map = (Map)value;
 
         assertEquals("mapField.d.x", "abc", map.get("x"));
         value = map.get("y");
         assertTrue("mapField.d.y is a List", value instanceof List);
-        List list = (List) value;
+        List list = (List)value;
         LOG.debug("mapField.d.y: " + list);
         assertEquals("listField.size", 3, list.size());
 
         LOG.debug("Found map: " + map);
 
-        list = (List) mapMessage.getObject("listField");
+        list = (List)mapMessage.getObject("listField");
         LOG.debug("listField: " + list);
         assertEquals("listField.size", 3, list.size());
         assertEquals("listField[0]", "a", list.get(0));
@@ -79,7 +78,7 @@
 
         Map grandChildMap = new HashMap();
         grandChildMap.put("x", "abc");
-        grandChildMap.put("y", Arrays.asList(new Object[] { "a", "b", "c" }));
+        grandChildMap.put("y", Arrays.asList(new Object[] {"a", "b", "c"}));
 
         Map nestedMap = new HashMap();
         nestedMap.put("a", "foo");
@@ -88,7 +87,7 @@
         nestedMap.put("d", grandChildMap);
 
         answer.setObject("mapField", nestedMap);
-        answer.setObject("listField", Arrays.asList(new Object[] { "a", "b", "c" }));
+        answer.setObject("listField", Arrays.asList(new Object[] {"a", "b", "c"}));
 
         return answer;
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/DummyMessageQuery.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/DummyMessageQuery.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/DummyMessageQuery.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/DummyMessageQuery.java Fri Aug 10 09:57:01 2007
@@ -31,9 +31,9 @@
  */
 public class DummyMessageQuery implements MessageQuery {
     
+    public static final int MESSAGE_COUNT = 10;
     private static final Log LOG = LogFactory.getLog(DummyMessageQuery.class);
 
-    public static final int MESSAGE_COUNT = 10;
     
     public void execute(ActiveMQDestination destination, MessageListener listener) throws Exception {
         LOG.info("Initial query is creating: " + MESSAGE_COUNT + " messages");

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest.java Fri Aug 10 09:57:01 2007
@@ -24,15 +24,14 @@
 import org.apache.activemq.command.ActiveMQTopic;
 
 /**
- *
  * @version $Revision$
  */
 public class RetroactiveConsumerTestWithLastImagePolicyWithWildcardTest extends RetroactiveConsumerTestWithSimpleMessageListTest {
     private int counter = 1;
-    
+
     protected void sendMessage(MessageProducer producer, TextMessage message) throws JMSException {
         ActiveMQTopic topic = new ActiveMQTopic(destination.toString() + "." + (counter++));
-//        System.out.println("Sending to destination: " + topic);
+        // System.out.println("Sending to destination: " + topic);
         producer.send(topic, message);
     }
 
@@ -41,7 +40,7 @@
     }
 
     protected MessageConsumer createConsumer() throws JMSException {
-        return session.createConsumer( new ActiveMQTopic(destination.toString() + ".>"));
+        return session.createConsumer(new ActiveMQTopic(destination.toString() + ".>"));
     }
 
     protected String getBrokerXml() {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/TaskRunnerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/TaskRunnerTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/TaskRunnerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/TaskRunnerTest.java Fri Aug 10 09:57:01 2007
@@ -22,11 +22,9 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.activemq.transport.TopicClusterTest;
+import junit.framework.TestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import junit.framework.TestCase;
 
 public class TaskRunnerTest extends TestCase {
     private static final Log LOG = LogFactory.getLog(TaskRunnerTest.class);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java Fri Aug 10 09:57:01 2007
@@ -43,11 +43,12 @@
  * @version $Revision: 1.1.1.1 $
  */
 public class PeerTransportTest extends TestCase {
-    protected Log log = LogFactory.getLog(getClass());
-    protected ActiveMQDestination destination;
-    protected boolean topic = true;
     protected static final int MESSAGE_COUNT = 50;
     protected static final int NUMBER_IN_CLUSTER = 3;
+    private static final Log LOG = LogFactory.getLog(PeerTransportTest.class);
+    
+    protected ActiveMQDestination destination;
+    protected boolean topic = true;
     protected int deliveryMode = DeliveryMode.NON_PERSISTENT;
     protected MessageProducer[] producers;
     protected Connection[] connections;
@@ -75,7 +76,7 @@
             consumer.setMessageListener(messageIdList[i]);
         }
 
-        log.info("Waiting for cluster to be fully connected");
+        LOG.info("Waiting for cluster to be fully connected");
 
         // Each connection should see that NUMBER_IN_CLUSTER consumers get
         // registered on the destination.
@@ -98,7 +99,7 @@
             session.close();
         }
 
-        log.info("Cluster is online.");
+        LOG.info("Cluster is online.");
     }
 
     protected void tearDown() throws Exception {
@@ -114,7 +115,7 @@
     }
 
     protected Connection createConnection(int i) throws JMSException {
-        log.info("creating connection ....");
+        LOG.info("creating connection ....");
         ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("peer://" + getClass().getName() + "/node" + i);
         return fac.createConnection();
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java Fri Aug 10 09:57:01 2007
@@ -32,13 +32,15 @@
 import org.apache.activemq.transport.TransportFactory;
 import org.apache.activemq.transport.TransportListener;
 import org.apache.activemq.transport.TransportServer;
-import org.apache.activemq.transport.stomp.StompTest;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 public class InactivityMonitorTest extends CombinationTestSupport implements TransportAcceptListener {
     private static final Log LOG = LogFactory.getLog(InactivityMonitorTest.class);
 
+    public Runnable serverRunOnCommand;
+    public Runnable clientRunOnCommand;
+
     private TransportServer server;
     private Transport clientTransport;
     private Transport serverTransport;
@@ -50,9 +52,6 @@
 
     private final AtomicBoolean ignoreClientError = new AtomicBoolean(false);
     private final AtomicBoolean ignoreServerError = new AtomicBoolean(false);
-
-    public Runnable serverRunOnCommand;
-    public Runnable clientRunOnCommand;
 
     protected void setUp() throws Exception {
         super.setUp();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java Fri Aug 10 09:57:01 2007
@@ -46,8 +46,8 @@
         SslTransportServer sslTransportServer = null;
 
         for (int i = 0; i < 4; ++i) {
-            final boolean wantClientAuth = ((i & 0x1) == 1);
-            final boolean needClientAuth = ((i & 0x2) == 1);
+            final boolean wantClientAuth = (i & 0x1) == 1;
+            final boolean needClientAuth = (i & 0x2) == 1;
 
             String options = "wantClientAuth=" + (wantClientAuth ? "true" : "false") + "&needClientAuth="
                              + (needClientAuth ? "true" : "false");

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportServerTest.java Fri Aug 10 09:57:01 2007
@@ -52,11 +52,11 @@
 
     public void testWantAndNeedClientAuthSetters() throws IOException {
         for (int i = 0; i < 4; ++i) {
-            final boolean wantClientAuth = ((i & 0x1) == 1);
-            final boolean needClientAuth = ((i & 0x2) == 1);
+            final boolean wantClientAuth = (i & 0x1) == 1;
+            final boolean needClientAuth = (i & 0x2) == 1;
 
-            final int expectedWantStatus = (wantClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE);
-            final int expectedNeedStatus = (needClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE);
+            final int expectedWantStatus = wantClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE;
+            final int expectedNeedStatus = needClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE;
 
             createAndBindTransportServer(wantClientAuth, needClientAuth, "");
 
@@ -68,11 +68,11 @@
 
     public void testWantAndNeedAuthReflection() throws IOException {
         for (int i = 0; i < 4; ++i) {
-            final boolean wantClientAuth = ((i & 0x1) == 1);
-            final boolean needClientAuth = ((i & 0x2) == 1);
+            final boolean wantClientAuth = (i & 0x1) == 1;
+            final boolean needClientAuth = (i & 0x2) == 1;
 
-            final int expectedWantStatus = (wantClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE);
-            final int expectedNeedStatus = (needClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE);
+            final int expectedWantStatus = wantClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE;
+            final int expectedNeedStatus = needClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.FALSE;
 
             String options = "wantClientAuth=" + (wantClientAuth ? "true" : "false") + "&needClientAuth=" + (needClientAuth ? "true" : "false");
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLServerSocket.java Fri Aug 10 09:57:01 2007
@@ -42,11 +42,11 @@
     }
     
     public void setWantClientAuth(boolean want) {
-        wantClientAuthStatus = (want ? TRUE : FALSE);
+        wantClientAuthStatus = want ? TRUE : FALSE;
     }
     
     public void setNeedClientAuth(boolean need) {
-        needClientAuthStatus = (need ? TRUE : FALSE);
+        needClientAuthStatus = need ? TRUE : FALSE;
     }
 
     // --- Stubbed methods ---

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java Fri Aug 10 09:57:01 2007
@@ -24,65 +24,64 @@
 import javax.net.ssl.SSLSocket;
 
 public class StubSSLSocket extends SSLSocket {
-    
+
     public static final int UNTOUCHED = -1;
     public static final int FALSE = 0;
     public static final int TRUE = 1;
-    
+
     private int wantClientAuthStatus = UNTOUCHED;
     private int needClientAuthStatus = UNTOUCHED;
     private int useClientModeStatus = UNTOUCHED;
-    
-    final StubSSLSession session; 
-        
+
+    final StubSSLSession session;
+
     public StubSSLSocket(StubSSLSession ses) {
         this.session = ses;
     }
-    
+
     public void setWantClientAuth(boolean arg0) {
-        this.wantClientAuthStatus = (arg0 ? TRUE : FALSE);
+        this.wantClientAuthStatus = arg0 ? TRUE : FALSE;
     }
-    
+
     public void setNeedClientAuth(boolean arg0) {
-        this.needClientAuthStatus = (arg0 ? TRUE : FALSE);
-        if ( session != null ) {
+        this.needClientAuthStatus = arg0 ? TRUE : FALSE;
+        if (session != null) {
             this.session.setIsVerified(arg0);
         }
     }
-    
+
     public void setUseClientMode(boolean arg0) {
-        useClientModeStatus = (arg0 ? TRUE : FALSE);
+        useClientModeStatus = arg0 ? TRUE : FALSE;
     }
-    
+
     public boolean getWantClientAuth() {
-        return (wantClientAuthStatus == TRUE);
+        return wantClientAuthStatus == TRUE;
     }
 
     public boolean getNeedClientAuth() {
-        return (needClientAuthStatus == TRUE);
+        return needClientAuthStatus == TRUE;
     }
-    
+
     public boolean getUseClientMode() {
-        return (useClientModeStatus == TRUE );
+        return useClientModeStatus == TRUE;
     }
-    
+
     public int getWantClientAuthStatus() {
         return wantClientAuthStatus;
     }
-    
+
     public int getNeedClientAuthStatus() {
         return needClientAuthStatus;
     }
-    
+
     public int getUseClientModeStatus() {
         return useClientModeStatus;
     }
-    
+
     public SSLSession getSession() {
         return this.session;
     }
-    
-    
+
     // --- Stubbed methods ---
 
     public String[] getSupportedCipherSuites() {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSslTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSslTransport.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSslTransport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSslTransport.java Fri Aug 10 09:57:01 2007
@@ -25,26 +25,26 @@
     public static final int UNTOUCHED = -1;
     public static final int FALSE = 0;
     public static final int TRUE = 1;
-    
+
     private int wantClientAuthStatus = UNTOUCHED;
     private int needClientAuthStatus = UNTOUCHED;
-    
+
     public StubSslTransport(WireFormat wireFormat, SSLSocket socket) throws Exception {
         super(wireFormat, socket);
     }
-    
+
     public void setWantClientAuth(boolean arg0) {
-        this.wantClientAuthStatus = (arg0 ? TRUE : FALSE);
+        this.wantClientAuthStatus = arg0 ? TRUE : FALSE;
     }
-    
+
     public void setNeedClientAuth(boolean arg0) {
-        this.needClientAuthStatus = (arg0 ? TRUE : FALSE);
+        this.needClientAuthStatus = arg0 ? TRUE : FALSE;
     }
-    
+
     public int getWantClientAuthStatus() {
         return wantClientAuthStatus;
     }
-    
+
     public int getNeedClientAuthStatus() {
         return needClientAuthStatus;
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQDeadlockTestW4Brokers.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQDeadlockTestW4Brokers.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQDeadlockTestW4Brokers.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQDeadlockTestW4Brokers.java Fri Aug 10 09:57:01 2007
@@ -18,6 +18,7 @@
 
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -176,7 +177,7 @@
         memoryManager.setLimit(100000000);
         brokerService.setMemoryManager(memoryManager);
 
-        final ArrayList<PolicyEntry> policyEntries = new ArrayList<PolicyEntry>();
+        final List<PolicyEntry> policyEntries = new ArrayList<PolicyEntry>();
 
         final PolicyEntry entry = new PolicyEntry();
         entry.setQueue(">");
@@ -232,8 +233,8 @@
     }
 
     private static class TestMessageListener1 implements MessageListener {
-        private final long waitTime;
         final AtomicInteger count = new AtomicInteger(0);
+        private final long waitTime;
 
         public TestMessageListener1(long waitTime) {
             this.waitTime = waitTime;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java Fri Aug 10 09:57:01 2007
@@ -27,7 +27,6 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
- * 
  * @version $Revision: 1.1 $
  */
 public class CreateLotsOfTemporaryQueuesTest extends EmbeddedBrokerAndConnectionTestSupport {
@@ -36,12 +35,11 @@
     private static int numberToCreate = 500;
     private static long sleep = 20;
 
-
     public static void main(String[] args) {
         configure(args);
         TestRunner.run(suite());
     }
-    
+
     public static Test suite() {
         return new TestSuite(CreateLotsOfTemporaryQueuesTest.class);
     }
@@ -56,7 +54,7 @@
             }
             TemporaryQueue temporaryQueue = session.createTemporaryQueue();
             temporaryQueue.delete();
-            Thread.sleep(sleep );
+            Thread.sleep(sleep);
         }
         LOG.info("Created " + numberToCreate + " temporary queue(s)");
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java Fri Aug 10 09:57:01 2007
@@ -38,6 +38,13 @@
 
 public class TwoBrokerMulticastQueueTest extends CombinationTestSupport {
 
+    public static final int MESSAGE_COUNT = 100;
+    public static final int BROKER_COUNT = 2;
+    public static final int CONSUMER_COUNT = 20;
+
+    public String sendUri, recvUri;
+    private BrokerService[] brokers;
+
     public static Test suite() {
         return suite(TwoBrokerMulticastQueueTest.class);
     }
@@ -45,13 +52,6 @@
     public static void main(String[] args) {
         junit.textui.TestRunner.run(suite());
     }
-
-    public static final int MESSAGE_COUNT = 100;
-    public static final int BROKER_COUNT = 2;
-    public static final int CONSUMER_COUNT = 20;
-
-    private BrokerService[] brokers;
-    public String sendUri, recvUri;
 
     public void setUp() throws Exception {
         super.setAutoFail(true);

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/JndiJmsLogAppender.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/JndiJmsLogAppender.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/JndiJmsLogAppender.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/JndiJmsLogAppender.java Fri Aug 10 09:57:01 2007
@@ -137,7 +137,7 @@
             return new InitialContext();
         }
         else {
-            Hashtable env = new Hashtable();
+            Hashtable<String, String> env = new Hashtable<String, String>();
             env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactoryName);
             if (providerURL != null) {
                 env.put(Context.PROVIDER_URL, providerURL);

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java (original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java Fri Aug 10 09:57:01 2007
@@ -54,7 +54,7 @@
 
     private static final long INITIAL_RECONNECT_DELAY = 1000; // 1 second.
     private static final long MAX_RECONNECT_DELAY = 1000*30; // 30 seconds.
-    private static final ThreadLocal threadLocal = new ThreadLocal();
+    private static final ThreadLocal<Session> threadLocal = new ThreadLocal<Session>();
     
     static {
         try {

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/InboundContextSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/InboundContextSupport.java?view=diff&rev=564679&r1=564678&r2=564679
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/InboundContextSupport.java (original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/InboundContextSupport.java Fri Aug 10 09:57:01 2007
@@ -26,7 +26,7 @@
  * @version $Revision$
  */
 public class InboundContextSupport {
-    private static final ThreadLocal threadLocal = new ThreadLocal();
+    private static final ThreadLocal<InboundContext> threadLocal = new ThreadLocal<InboundContext>();
 
     /**
      * Returns the current {@link InboundContext} used by the current thread which is processing a message.
@@ -36,7 +36,7 @@
      * @return
      */
     public static InboundContext getActiveSessionAndProducer() {
-        return (InboundContext) threadLocal.get();
+        return threadLocal.get();
     }
 
 



Mime
View raw message