activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r563982 [28/32] - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/ main/java/org/apache/activemq/advisory/ main/java/org/apache/activemq/blob/ main/java/org/apache/activemq/broker/ main/java/org/apache/activemq/broker/jm...
Date Wed, 08 Aug 2007 18:58:13 GMT
Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/CombinationTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/CombinationTestSupport.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/CombinationTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/CombinationTestSupport.java Wed Aug  8 11:56:59 2007
@@ -37,27 +37,20 @@
 
 /**
  * Poor mans way of getting JUnit to run a test case through a few different
- * combinations of options.
- * 
- * 
- * Usage: If you have a test case called testFoo what you want to run through a
- * few combinations, of of values for the attributes age and color, you would
- * something like: <code>
+ * combinations of options. Usage: If you have a test case called testFoo what
+ * you want to run through a few combinations, of of values for the attributes
+ * age and color, you would something like: <code>
  *    public void initCombosForTestFoo() {    
  *        addCombinationValues( "age", new Object[]{ new Integer(21), new Integer(30) } );
  *        addCombinationValues( "color", new Object[]{"blue", "green"} );
  *    }
  * </code>
- * 
  * The testFoo test case would be run for each possible combination of age and
- * color that you setup in the initCombosForTestFoo method. Before each combination is
- * run, the age and color fields of the test class are set to one of the values
- * defined. This is done before the normal setUp method is called.
- * 
+ * color that you setup in the initCombosForTestFoo method. Before each
+ * combination is run, the age and color fields of the test class are set to one
+ * of the values defined. This is done before the normal setUp method is called.
  * If you want the test combinations to show up as separate test runs in the
- * JUnit reports, add a suite method to your test case similar to:
- * 
- * <code>
+ * JUnit reports, add a suite method to your test case similar to: <code>
  *     public static Test suite() {
  *         return suite(FooTest.class);
  *     }
@@ -68,7 +61,7 @@
 public abstract class CombinationTestSupport extends AutoFailTestSupport {
 
     protected static final Log log = LogFactory.getLog(CombinationTestSupport.class);
-    
+
     private HashMap comboOptions = new HashMap();
     private boolean combosEvaluated;
     private Map options;
@@ -84,7 +77,7 @@
     }
 
     public void addCombinationValues(String attribute, Object[] options) {
-        ComboOption co = (ComboOption) this.comboOptions.get(attribute);
+        ComboOption co = (ComboOption)this.comboOptions.get(attribute);
         if (co == null) {
             this.comboOptions.put(attribute, new ComboOption(attribute, Arrays.asList(options)));
         } else {
@@ -99,8 +92,8 @@
             CombinationTestSupport[] combinations = getCombinations();
             for (int i = 0; i < combinations.length; i++) {
                 CombinationTestSupport test = combinations[i];
-                if( getName()==null || getName().equals( test.getName()) ) {  
-                	test.runBare();
+                if (getName() == null || getName().equals(test.getName())) {
+                    test.runBare();
                 }
             }
         }
@@ -109,14 +102,13 @@
     private void setOptions(Map options) throws NoSuchFieldException, IllegalAccessException {
         this.options = options;
         for (Iterator iterator = options.keySet().iterator(); iterator.hasNext();) {
-            String attribute = (String) iterator.next();
+            String attribute = (String)iterator.next();
             Object value = options.get(attribute);
             try {
                 Field field = getClass().getField(attribute);
                 field.set(this, value);
             } catch (Throwable e) {
-                log.info("Could not set field '" + attribute + "' to value '" + value
-                        + "', make sure the field exists and is public.");
+                log.info("Could not set field '" + attribute + "' to value '" + value + "', make sure the field exists and is public.");
             }
         }
     }
@@ -127,8 +119,8 @@
             method.invoke(this, null);
         } catch (Throwable e) {
         }
-        
-        String name = getName().split(" ")[0];        
+
+        String name = getName().split(" ")[0];
         String comboSetupMethodName = "initCombosFor" + Character.toUpperCase(name.charAt(0)) + name.substring(1);
         try {
             Method method = getClass().getMethod(comboSetupMethodName, null);
@@ -139,28 +131,28 @@
         try {
             ArrayList expandedOptions = new ArrayList();
             expandCombinations(new ArrayList(comboOptions.values()), expandedOptions);
-    
+
             if (expandedOptions.isEmpty()) {
                 combosEvaluated = true;
-                return new CombinationTestSupport[] { this };
+                return new CombinationTestSupport[] {this};
             } else {
-    
+
                 ArrayList result = new ArrayList();
                 // Run the test case for each possible combination
                 for (Iterator iter = expandedOptions.iterator(); iter.hasNext();) {
-                    CombinationTestSupport combo = (CombinationTestSupport) TestSuite.createTest(getClass(), name);
+                    CombinationTestSupport combo = (CombinationTestSupport)TestSuite.createTest(getClass(), name);
                     combo.combosEvaluated = true;
-                    combo.setOptions((Map) iter.next());
+                    combo.setOptions((Map)iter.next());
                     result.add(combo);
                 }
-    
+
                 CombinationTestSupport rc[] = new CombinationTestSupport[result.size()];
                 result.toArray(rc);
                 return rc;
             }
         } catch (Throwable e) {
             combosEvaluated = true;
-            return new CombinationTestSupport[] { this };
+            return new CombinationTestSupport[] {this};
         }
 
     }
@@ -172,14 +164,14 @@
                 map = new HashMap();
                 expandedCombos.add(map);
             } else {
-                map = (HashMap) expandedCombos.get(expandedCombos.size() - 1);
+                map = (HashMap)expandedCombos.get(expandedCombos.size() - 1);
             }
 
             LinkedList l = new LinkedList(optionsLeft);
-            ComboOption comboOption = (ComboOption) l.removeLast();
+            ComboOption comboOption = (ComboOption)l.removeLast();
             int i = 0;
             for (Iterator iter = comboOption.values.iterator(); iter.hasNext();) {
-                Object value = (Object) iter.next();
+                Object value = (Object)iter.next();
                 if (i != 0) {
                     map = new HashMap(map);
                     expandedCombos.add(map);
@@ -203,7 +195,7 @@
             names.add(name);
             Test test = TestSuite.createTest(clazz, name);
             if (test instanceof CombinationTestSupport) {
-                CombinationTestSupport[] combinations = ((CombinationTestSupport) test).getCombinations();
+                CombinationTestSupport[] combinations = ((CombinationTestSupport)test).getCombinations();
                 for (int j = 0; j < combinations.length; j++) {
                     suite.addTest(combinations[j]);
                 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ConsumerReceiveWithTimeoutTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ConsumerReceiveWithTimeoutTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ConsumerReceiveWithTimeoutTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ConsumerReceiveWithTimeoutTest.java Wed Aug  8 11:56:59 2007
@@ -24,11 +24,10 @@
 import javax.jms.Queue;
 import javax.jms.Session;
 
-
 /**
  * @version $Revision: 1.1.1.1 $
  */
-public class ConsumerReceiveWithTimeoutTest  extends TestSupport {
+public class ConsumerReceiveWithTimeoutTest extends TestSupport {
 
     private Connection connection;
 
@@ -49,8 +48,9 @@
     }
 
     /**
-     * Test to check if consumer thread wakes up inside a receive(timeout) after a message is dispatched to the consumer
-     *
+     * Test to check if consumer thread wakes up inside a receive(timeout) after
+     * a message is dispatched to the consumer
+     * 
      * @throws javax.jms.JMSException
      */
     public void testConsumerReceiveBeforeMessageDispatched() throws JMSException {
@@ -61,15 +61,18 @@
         final Queue queue = session.createQueue("test");
 
         Thread t = new Thread() {
-               public void run(){
-                  try {
-                     //wait for 10 seconds to allow consumer.receive to be run first
-                     Thread.sleep(10000);
-                     MessageProducer producer = session.createProducer(queue);
-                     producer.send(session.createTextMessage("Hello"));
-                  }catch(Exception e){e.printStackTrace();}
-               }
-           };
+            public void run() {
+                try {
+                    // wait for 10 seconds to allow consumer.receive to be run
+                    // first
+                    Thread.sleep(10000);
+                    MessageProducer producer = session.createProducer(queue);
+                    producer.send(session.createTextMessage("Hello"));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        };
 
         t.start();
 
@@ -80,9 +83,5 @@
         session.close();
 
     }
-
-
-
-
 
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java Wed Aug  8 11:56:59 2007
@@ -272,7 +272,7 @@
         addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.AUTO_ACKNOWLEDGE),
                                                       Integer.valueOf(Session.DUPS_OK_ACKNOWLEDGE),
                                                       Integer.valueOf(Session.CLIENT_ACKNOWLEDGE)});
-        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE),});
+        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)});
     }
 
     public void testMessageListenerUnackedWithPrefetch1StayInQueue() throws Exception {
@@ -438,7 +438,7 @@
         addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.AUTO_ACKNOWLEDGE),
                                                       Integer.valueOf(Session.DUPS_OK_ACKNOWLEDGE),
                                                       Integer.valueOf(Session.CLIENT_ACKNOWLEDGE)});
-        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE),});
+        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)});
     }
 
     public void testUnackedWithPrefetch1StayInQueue() throws Exception {
@@ -528,9 +528,9 @@
     }
 
     public void initCombosForTestDontStart() {
-        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT),});
+        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT)});
         addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE),
-                                                              Byte.valueOf(ActiveMQDestination.TOPIC_TYPE),});
+                                                              Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)});
     }
 
     public void testDontStart() throws Exception {
@@ -547,9 +547,9 @@
     }
 
     public void initCombosForTestStartAfterSend() {
-        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT),});
+        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT)});
         addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE),
-                                                              Byte.valueOf(ActiveMQDestination.TOPIC_TYPE),});
+                                                              Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)});
     }
 
     public void testStartAfterSend() throws Exception {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSDurableTopicRedeliverTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSDurableTopicRedeliverTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSDurableTopicRedeliverTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSDurableTopicRedeliverTest.java Wed Aug  8 11:56:59 2007
@@ -24,22 +24,21 @@
  * @version $Revision: 1.4 $
  */
 public class JMSDurableTopicRedeliverTest extends JmsTopicRedeliverTest {
-    
-    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
-            .getLog(JMSDurableTopicRedeliverTest.class);
-    
+
+    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JMSDurableTopicRedeliverTest.class);
+
     protected void setUp() throws Exception {
         durable = true;
         super.setUp();
     }
-    
+
     /**
      * Sends and consumes the messages.
-     *
+     * 
      * @throws Exception
      */
     public void testRedeliverNewSession() throws Exception {
-        String text = "TEST: "+System.currentTimeMillis();
+        String text = "TEST: " + System.currentTimeMillis();
         Message sendMessage = session.createTextMessage(text);
 
         if (verbose) {
@@ -47,26 +46,26 @@
         }
         producer.send(producerDestination, sendMessage);
 
-        //receive but don't acknowledge
+        // receive but don't acknowledge
         Message unackMessage = consumer.receive(1000);
         assertNotNull(unackMessage);
         String unackId = unackMessage.getJMSMessageID();
-        assertEquals(((TextMessage) unackMessage).getText(), text);
+        assertEquals(((TextMessage)unackMessage).getText(), text);
         assertFalse(unackMessage.getJMSRedelivered());
-        assertEquals(unackMessage.getIntProperty("JMSXDeliveryCount"),1);
+        assertEquals(unackMessage.getIntProperty("JMSXDeliveryCount"), 1);
         consumeSession.close();
         consumer.close();
 
-        //receive then acknowledge
+        // receive then acknowledge
         consumeSession = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         consumer = createConsumer();
         Message ackMessage = consumer.receive(1000);
         assertNotNull(ackMessage);
         ackMessage.acknowledge();
         String ackId = ackMessage.getJMSMessageID();
-        assertEquals(((TextMessage) ackMessage).getText(), text);
+        assertEquals(((TextMessage)ackMessage).getText(), text);
         assertTrue(ackMessage.getJMSRedelivered());
-        assertEquals(ackMessage.getIntProperty("JMSXDeliveryCount"),2);
+        assertEquals(ackMessage.getIntProperty("JMSXDeliveryCount"), 2);
         assertEquals(unackId, ackId);
         consumeSession.close();
         consumer.close();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSExclusiveConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSExclusiveConsumerTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSExclusiveConsumerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSExclusiveConsumerTest.java Wed Aug  8 11:56:59 2007
@@ -42,14 +42,14 @@
     }
 
     public int deliveryMode;
-    
+
     public void initCombosForTestRoundRobinDispatchOnNonExclusive() {
-        addCombinationValues("deliveryMode", new Object[] { Integer.valueOf(DeliveryMode.NON_PERSISTENT),
-        		Integer.valueOf(DeliveryMode.PERSISTENT) });
+        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
     }
 
     /**
-     * Shows that by default messages are round robined across a set of consumers.
+     * Shows that by default messages are round robined across a set of
+     * consumers.
      * 
      * @throws Exception
      */
@@ -61,18 +61,18 @@
         ActiveMQQueue destination = new ActiveMQQueue("TEST");
         MessageProducer producer = session.createProducer(destination);
         producer.setDeliveryMode(deliveryMode);
-        
+
         MessageConsumer consumer1 = session.createConsumer(destination);
         MessageConsumer consumer2 = session.createConsumer(destination);
 
         // Send the messages
         producer.send(session.createTextMessage("1st"));
         producer.send(session.createTextMessage("2nd"));
-        
+
         Message m;
         m = consumer2.receive(1000);
         assertNotNull(m);
-        
+
         m = consumer1.receive(1000);
         assertNotNull(m);
 
@@ -81,13 +81,12 @@
     }
 
     public void initCombosForTestDispatchExclusive() {
-        addCombinationValues("deliveryMode", new Object[] { Integer.valueOf(DeliveryMode.NON_PERSISTENT),
-        		Integer.valueOf(DeliveryMode.PERSISTENT) });
+        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
     }
 
     /**
-     * Shows that if the "?consumer.exclusive=true" option is added to destination,
-     * then all messages are routed to 1 consumer.
+     * Shows that if the "?consumer.exclusive=true" option is added to
+     * destination, then all messages are routed to 1 consumer.
      * 
      * @throws Exception
      */
@@ -99,7 +98,7 @@
         ActiveMQQueue destination = new ActiveMQQueue("TEST?consumer.exclusive=true");
         MessageProducer producer = session.createProducer(destination);
         producer.setDeliveryMode(deliveryMode);
-        
+
         MessageConsumer consumer1 = session.createConsumer(destination);
         MessageConsumer consumer2 = session.createConsumer(destination);
 
@@ -107,10 +106,10 @@
         producer.send(session.createTextMessage("1st"));
         producer.send(session.createTextMessage("2nd"));
         producer.send(session.createTextMessage("3nd"));
-        
+
         Message m;
         m = consumer2.receive(1000);
-        if( m!=null ) {
+        if (m != null) {
             // Consumer 2 should get all the messages.
             for (int i = 0; i < 2; i++) {
                 m = consumer2.receive(1000);
@@ -138,14 +137,13 @@
         MessageConsumer nonExCon = session.createConsumer(nonExclusiveQueue);
         MessageConsumer exCon = session.createConsumer(exclusiveQueue);
 
-
         MessageProducer prod = session.createProducer(exclusiveQueue);
         prod.send(session.createMessage());
         prod.send(session.createMessage());
         prod.send(session.createMessage());
 
         Message m;
-        for (int i=0; i<3; i++) {
+        for (int i = 0; i < 3; i++) {
             m = exCon.receive(1000);
             assertNotNull(m);
             m = nonExCon.receive(1000);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSUsecaseTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSUsecaseTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSUsecaseTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSUsecaseTest.java Wed Aug  8 11:56:59 2007
@@ -36,7 +36,8 @@
 
     public static Test suite() {
         return suite(JMSUsecaseTest.class);
-    }    
+    }
+
     public static void main(String[] args) {
         junit.textui.TestRunner.run(suite());
     }
@@ -47,46 +48,37 @@
     public byte destinationType;
     public boolean durableConsumer;
 
-    public void initCombosForTestQueueBrowser() {    
-        addCombinationValues( "deliveryMode", new Object[]{ 
-                Integer.valueOf(DeliveryMode.NON_PERSISTENT), 
-                Integer.valueOf(DeliveryMode.PERSISTENT)} );        
-        addCombinationValues( "destinationType", new Object[]{ 
-                Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), 
-                Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), 
-                } );
-    }       
+    public void initCombosForTestQueueBrowser() {
+        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
+        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE)});
+    }
+
     public void testQueueBrowser() throws Exception {
-        
+
         // Send a message to the broker.
         connection.start();
         Session session = connection.createSession(false, Session.SESSION_TRANSACTED);
         destination = createDestination(session, destinationType);
         sendMessages(session, destination, 5);
 
-        
-        QueueBrowser browser = session.createBrowser((Queue) destination);
+        QueueBrowser browser = session.createBrowser((Queue)destination);
         Enumeration enumeration = browser.getEnumeration();
-        for(int i=0; i < 5; i++) {
+        for (int i = 0; i < 5; i++) {
             Thread.sleep(100);
             assertTrue(enumeration.hasMoreElements());
             Message m = (Message)enumeration.nextElement();
             assertNotNull(m);
-            assertEquals(""+i, ((TextMessage)m).getText());
+            assertEquals("" + i, ((TextMessage)m).getText());
         }
         assertFalse(enumeration.hasMoreElements());
     }
 
-    public void initCombosForTestSendReceive() {    
-        addCombinationValues( "deliveryMode", new Object[]{ 
-                Integer.valueOf(DeliveryMode.NON_PERSISTENT), 
-                Integer.valueOf(DeliveryMode.PERSISTENT)} );        
-        addCombinationValues( "destinationType", new Object[]{ 
-                Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), 
-                Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), 
-                Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), 
-                Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)} );
-    }       
+    public void initCombosForTestSendReceive() {
+        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
+        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE),
+                                                              Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)});
+    }
+
     public void testSendReceive() throws Exception {
         // Send a message to the broker.
         connection.start();
@@ -96,22 +88,18 @@
         MessageConsumer consumer = session.createConsumer(destination);
         ActiveMQMessage message = new ActiveMQMessage();
         producer.send(message);
-        
+
         // Make sure only 1 message was delivered.
         assertNotNull(consumer.receive(1000));
-        assertNull(consumer.receiveNoWait());        
+        assertNull(consumer.receiveNoWait());
+    }
+
+    public void initCombosForTestSendReceiveTransacted() {
+        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
+        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE),
+                                                              Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)});
     }
 
-    public void initCombosForTestSendReceiveTransacted() {    
-        addCombinationValues( "deliveryMode", new Object[]{ 
-                Integer.valueOf(DeliveryMode.NON_PERSISTENT), 
-                Integer.valueOf(DeliveryMode.PERSISTENT)} );        
-        addCombinationValues( "destinationType", new Object[]{ 
-                Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), 
-                Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), 
-                Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), 
-                Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)} );
-    }       
     public void testSendReceiveTransacted() throws Exception {
         // Send a message to the broker.
         connection.start();
@@ -120,28 +108,28 @@
         MessageProducer producer = session.createProducer(destination);
         MessageConsumer consumer = session.createConsumer(destination);
         producer.send(session.createTextMessage("test"));
-        
+
         // Message should not be delivered until commit.
-        assertNull(consumer.receiveNoWait());        
+        assertNull(consumer.receiveNoWait());
         session.commit();
-        
+
         // Make sure only 1 message was delivered.
         Message message = consumer.receive(1000);
         assertNotNull(message);
         assertFalse(message.getJMSRedelivered());
         assertNull(consumer.receiveNoWait());
-        
+
         // Message should be redelivered is rollback is used.
         session.rollback();
-        
+
         // Make sure only 1 message was delivered.
         message = consumer.receive(2000);
         assertNotNull(message);
         assertTrue(message.getJMSRedelivered());
         assertNull(consumer.receiveNoWait());
-        
+
         // If we commit now, the message should not be redelivered.
-        session.commit();        
+        session.commit();
         assertNull(consumer.receiveNoWait());
     }
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsAutoAckListenerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsAutoAckListenerTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsAutoAckListenerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsAutoAckListenerTest.java Wed Aug  8 11:56:59 2007
@@ -27,7 +27,7 @@
 /**
  * @version $Revision: 1.2 $
  */
-public class JmsAutoAckListenerTest extends TestSupport implements MessageListener{
+public class JmsAutoAckListenerTest extends TestSupport implements MessageListener {
 
     private Connection connection;
 
@@ -46,7 +46,7 @@
         }
         super.tearDown();
     }
-    
+
     /**
      * Tests if acknowleged messages are being consumed.
      * 
@@ -70,14 +70,11 @@
         Message msg = consumer.receive(1000);
         assertNull(msg);
 
-
         session.close();
-     }
-
+    }
 
-   public void onMessage(Message message){
+    public void onMessage(Message message) {
         assertNotNull(message);
 
-
-   }
+    }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsBenchmark.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsBenchmark.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsBenchmark.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsBenchmark.java Wed Aug  8 11:56:59 2007
@@ -47,21 +47,18 @@
 
 /**
  * Benchmarks the broker by starting many consumer and producers against the
- * 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.
+ * 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.
  * 
  * @version $Revision$
  */
 public class JmsBenchmark extends JmsTestSupport {
     private static final transient Log log = LogFactory.getLog(JmsBenchmark.class);
 
-    private static final long SAMPLE_DELAY = Integer.parseInt(System.getProperty("SAMPLE_DELAY",
-                                                                                 "" + 1000 * 5));
+    private static final long SAMPLE_DELAY = Integer.parseInt(System.getProperty("SAMPLE_DELAY", "" + 1000 * 5));
     private static final long SAMPLES = Integer.parseInt(System.getProperty("SAMPLES", "10"));
-    private static final long SAMPLE_DURATION = Integer.parseInt(System.getProperty("SAMPLES_DURATION",
-                                                                                    "" + 1000 * 60));
+    private static final long SAMPLE_DURATION = Integer.parseInt(System.getProperty("SAMPLES_DURATION", "" + 1000 * 60));
     private static final int PRODUCER_COUNT = Integer.parseInt(System.getProperty("PRODUCER_COUNT", "10"));
     private static final int CONSUMER_COUNT = Integer.parseInt(System.getProperty("CONSUMER_COUNT", "10"));
 
@@ -76,9 +73,7 @@
     }
 
     public void initCombos() {
-        addCombinationValues("destination", new Object[] {
-        // new ActiveMQTopic("TEST"),
-                             new ActiveMQQueue("TEST"),});
+        addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST")});
     }
 
     protected BrokerService createBroker() throws Exception {
@@ -86,8 +81,7 @@
     }
 
     protected ConnectionFactory createConnectionFactory() throws URISyntaxException, IOException {
-        return new ActiveMQConnectionFactory(((TransportConnector)broker.getTransportConnectors().get(0))
-            .getServer().getConnectURI());
+        return new ActiveMQConnectionFactory(((TransportConnector)broker.getTransportConnectors().get(0)).getServer().getConnectURI());
     }
 
     /**
@@ -177,8 +171,7 @@
 
         log.info(getName() + ": Waiting for Producers and Consumers to startup.");
         connectionsEstablished.acquire();
-        log.info("Producers and Consumers are now running.  Waiting for system to reach steady state: "
-                 + (SAMPLE_DELAY / 1000.0f) + " seconds");
+        log.info("Producers and Consumers are now running.  Waiting for system to reach steady state: " + (SAMPLE_DELAY / 1000.0f) + " seconds");
         Thread.sleep(1000 * 10);
 
         log.info("Starting sample: " + SAMPLES + " each lasting " + (SAMPLE_DURATION / 1000.0f) + " seconds");
@@ -196,8 +189,7 @@
             int r = receivedMessages.get();
             int p = producedMessages.get();
 
-            log.info("published: " + p + " msgs at " + (p * 1000f / (end - start)) + " msgs/sec, "
-                     + "consumed: " + r + " msgs at " + (r * 1000f / (end - start)) + " msgs/sec");
+            log.info("published: " + p + " msgs at " + (p * 1000f / (end - start)) + " msgs/sec, " + "consumed: " + r + " msgs at " + (r * 1000f / (end - start)) + " msgs/sec");
         }
 
         log.info("Sample done.");

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableTopicSelectorTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableTopicSelectorTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableTopicSelectorTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableTopicSelectorTest.java Wed Aug  8 11:56:59 2007
@@ -21,7 +21,7 @@
  */
 public class JmsDurableTopicSelectorTest extends JmsTopicSelectorTest {
     public void setUp() throws Exception {
-        durable=true;
+        durable = true;
         super.setUp();
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableTopicSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableTopicSendReceiveTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableTopicSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableTopicSendReceiveTest.java Wed Aug  8 11:56:59 2007
@@ -31,9 +31,8 @@
  * @version $Revision: 1.5 $
  */
 public class JmsDurableTopicSendReceiveTest extends JmsTopicSendReceiveTest {
-    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
-            .getLog(JmsDurableTopicSendReceiveTest.class);
-    
+    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JmsDurableTopicSendReceiveTest.class);
+
     protected Connection connection2;
     protected Session session2;
     protected Session consumeSession2;
@@ -41,9 +40,10 @@
     protected MessageProducer producer2;
     protected Destination consumerDestination2;
     protected Destination producerDestination2;
+
     /**
      * Set up a durable suscriber test.
-     *
+     * 
      * @see junit.framework.TestCase#setUp()
      */
     protected void setUp() throws Exception {
@@ -53,7 +53,7 @@
 
     /**
      * Test if all the messages sent are being received.
-     *
+     * 
      * @throws Exception
      */
     public void testSendWhileClosed() throws Exception {
@@ -63,23 +63,23 @@
         session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
         producer2 = session2.createProducer(null);
         producer2.setDeliveryMode(deliveryMode);
-        producerDestination2 = session2.createTopic(getProducerSubject()+"2");
+        producerDestination2 = session2.createTopic(getProducerSubject() + "2");
         Thread.sleep(1000);
 
         consumeSession2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        consumerDestination2 = session2.createTopic(getConsumerSubject()+"2");
+        consumerDestination2 = session2.createTopic(getConsumerSubject() + "2");
         consumer2 = consumeSession2.createDurableSubscriber((Topic)consumerDestination2, getName());
         Thread.sleep(1000);
         consumer2.close();
         TextMessage message = session2.createTextMessage("test");
-        message.setStringProperty("test","test");
+        message.setStringProperty("test", "test");
         message.setJMSType("test");
         producer2.send(producerDestination2, message);
         log.info("Creating durable consumer");
         consumer2 = consumeSession2.createDurableSubscriber((Topic)consumerDestination2, getName());
         Message msg = consumer2.receive(1000);
         assertNotNull(msg);
-        assertEquals(((TextMessage) msg).getText(), "test");
+        assertEquals(((TextMessage)msg).getText(), "test");
         assertEquals(msg.getJMSType(), "test");
         assertEquals(msg.getStringProperty("test"), "test");
         connection2.stop();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueSelectorTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueSelectorTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueSelectorTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueSelectorTest.java Wed Aug  8 11:56:59 2007
@@ -22,7 +22,7 @@
  */
 public class JmsQueueSelectorTest extends JmsTopicSelectorTest {
     public void setUp() throws Exception {
-        topic=false;
+        topic = false;
         super.setUp();
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java Wed Aug  8 11:56:59 2007
@@ -29,34 +29,29 @@
 
 import org.apache.activemq.test.JmsResourceProvider;
 
-
 /**
  * @version $Revision: 1.2 $
  */
 public class JmsQueueTransactionTest extends JmsTransactionTestSupport {
-	private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
-            .getLog(JmsQueueTransactionTest.class);
-    
-	/**
-	 * 
-	 * @see org.apache.activemq.JmsTransactionTestSupport#getJmsResourceProvider()
-	 */
-	protected JmsResourceProvider getJmsResourceProvider() {
+    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JmsQueueTransactionTest.class);
+
+    /**
+     * @see org.apache.activemq.JmsTransactionTestSupport#getJmsResourceProvider()
+     */
+    protected JmsResourceProvider getJmsResourceProvider() {
         JmsResourceProvider p = new JmsResourceProvider();
-        p.setTopic(false); 
+        p.setTopic(false);
         return p;
-	}    
+    }
 
     /**
-     * Tests if the the connection gets reset, the messages will still be received.  
-     *  
+     * Tests if the the connection gets reset, the messages will still be
+     * received.
+     * 
      * @throws Exception
      */
     public void testReceiveTwoThenCloseConnection() throws Exception {
-        Message[] outbound = new Message[]{
-            session.createTextMessage("First Message"),
-            session.createTextMessage("Second Message")
-        };
+        Message[] outbound = new Message[] {session.createTextMessage("First Message"), session.createTextMessage("Second Message")};
 
         // lets consume any outstanding messages from previous test runs
         while (consumer.receive(1000) != null) {
@@ -77,10 +72,10 @@
         message = consumer.receive(1000);
         assertNotNull(message);
         assertEquals(outbound[1], message);
-        
+
         // Close and reopen connection.
-        reconnect();        
-        
+        reconnect();
+
         // Consume again.. the previous message should
         // get redelivered.
         message = consumer.receive(5000);
@@ -99,52 +94,53 @@
 
         assertTextMessagesEqual("Rollback did not work", outbound, inbound);
     }
-    
+
     /**
-     * Tests sending and receiving messages with two sessions(one for producing and another for consuming).
+     * Tests sending and receiving messages with two sessions(one for producing
+     * and another for consuming).
      * 
      * @throws Exception
      */
     public void testSendReceiveInSeperateSessionTest() throws Exception {
-        session.close();        
+        session.close();
         int batchCount = 10;
 
-        for (int i=0; i < batchCount; i++) {
-        	//Session that sends messages
+        for (int i = 0; i < batchCount; i++) {
+            // Session that sends messages
             {
                 Session session = resourceProvider.createSession(connection);
                 MessageProducer producer = resourceProvider.createProducer(session, destination);
-                //consumer = resourceProvider.createConsumer(session, destination);
-                producer.send(session.createTextMessage("Test Message: "+i));                   
+                // consumer = resourceProvider.createConsumer(session,
+                // destination);
+                producer.send(session.createTextMessage("Test Message: " + i));
                 session.commit();
                 session.close();
             }
-            
-        	//Session that consumes messages
+
+            // Session that consumes messages
             {
                 Session session = resourceProvider.createSession(connection);
                 MessageConsumer consumer = resourceProvider.createConsumer(session, destination);
 
-                TextMessage message = (TextMessage) consumer.receive(1000*5);
-                assertNotNull("Received only "+i+" messages in batch ", message);
-                assertEquals("Test Message: "+i, message.getText());
+                TextMessage message = (TextMessage)consumer.receive(1000 * 5);
+                assertNotNull("Received only " + i + " messages in batch ", message);
+                assertEquals("Test Message: " + i, message.getText());
 
                 session.commit();
                 session.close();
             }
         }
     }
-    
+
     /**
-     * Tests the queue browser. Browses the messages then the consumer tries to receive them. 
-     * The messages should still be in the queue even when it was browsed.  
+     * Tests the queue browser. Browses the messages then the consumer tries to
+     * receive them. The messages should still be in the queue even when it was
+     * browsed.
      * 
      * @throws Exception
      */
     public void testReceiveBrowseReceive() throws Exception {
-        Message[] outbound = new Message[] { session.createTextMessage("First Message"),
-        									 session.createTextMessage("Second Message"),
-											 session.createTextMessage("Third Message") };
+        Message[] outbound = new Message[] {session.createTextMessage("First Message"), session.createTextMessage("Second Message"), session.createTextMessage("Third Message")};
 
         // lets consume any outstanding messages from previous test runs
         while (consumer.receive(1000) != null) {
@@ -160,21 +156,21 @@
         assertEquals(outbound[0], consumer.receive(1000));
         consumer.close();
 
-        QueueBrowser browser = session.createBrowser((Queue) destination);
+        QueueBrowser browser = session.createBrowser((Queue)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], (Message)enumeration.nextElement());
 
         // browse the third.
         assertTrue("Should have received the third message", enumeration.hasMoreElements());
-        assertEquals(outbound[2], (Message) enumeration.nextElement());
+        assertEquals(outbound[2], (Message)enumeration.nextElement());
 
         // There should be no more.
         boolean tooMany = false;
         while (enumeration.hasMoreElements()) {
-            log.info("Got extra message: " + ((TextMessage) enumeration.nextElement()).getText());
+            log.info("Got extra message: " + ((TextMessage)enumeration.nextElement()).getText());
             tooMany = true;
         }
         assertFalse(tooMany);
@@ -190,5 +186,5 @@
 
         session.commit();
     }
-    
+
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java Wed Aug  8 11:56:59 2007
@@ -28,19 +28,18 @@
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.test.JmsTopicSendReceiveTest;
 
-
 /**
  * @version $Revision: 1.4 $
  */
 public class JmsQueueWildcardSendReceiveTest extends JmsTopicSendReceiveTest {
 
-    private String destination1String = "TEST.ONE.ONE" ;
-    private String destination2String = "TEST.ONE.ONE.ONE" ;
-    private String destination3String = "TEST.ONE.TWO" ;
-    private String destination4String = "TEST.TWO.ONE" ;
+    private String destination1String = "TEST.ONE.ONE";
+    private String destination2String = "TEST.ONE.ONE.ONE";
+    private String destination3String = "TEST.ONE.TWO";
+    private String destination4String = "TEST.TWO.ONE";
 
     /**
-     * Sets a test to have a queue destination and non-persistent delivery mode. 
+     * Sets a test to have a queue destination and non-persistent delivery mode.
      * 
      * @see junit.framework.TestCase#setUp()
      */
@@ -49,24 +48,24 @@
         deliveryMode = DeliveryMode.NON_PERSISTENT;
         super.setUp();
     }
-    
+
     /**
      * Returns the consumer subject.
      * 
      * @return String - consumer subject
      * @see org.apache.activemq.test.TestSupport#getConsumerSubject()
      */
-    protected String getConsumerSubject(){
+    protected String getConsumerSubject() {
         return "FOO.>";
     }
-    
+
     /**
      * Returns the producer subject.
      * 
      * @return String - producer subject
      * @see org.apache.activemq.test.TestSupport#getProducerSubject()
      */
-    protected String getProducerSubject(){
+    protected String getProducerSubject() {
         return "FOO.BAR.HUMBUG";
     }
 
@@ -74,27 +73,27 @@
         connection.start();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        ActiveMQDestination destination1 = (ActiveMQDestination) session.createQueue(destination1String);
-        ActiveMQDestination destination3 = (ActiveMQDestination) session.createQueue(destination3String);
+        ActiveMQDestination destination1 = (ActiveMQDestination)session.createQueue(destination1String);
+        ActiveMQDestination destination3 = (ActiveMQDestination)session.createQueue(destination3String);
 
         Message m = null;
         MessageConsumer consumer = null;
         String text = null;
 
-        sendMessage(session,destination1,destination1String);
-        sendMessage(session,destination3,destination3String);
-        ActiveMQDestination destination6 = (ActiveMQDestination) session.createQueue("TEST.ONE.*");
+        sendMessage(session, destination1, destination1String);
+        sendMessage(session, destination3, destination3String);
+        ActiveMQDestination destination6 = (ActiveMQDestination)session.createQueue("TEST.ONE.*");
         consumer = session.createConsumer(destination6);
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         assertNull(consumer.receiveNoWait());
@@ -104,33 +103,33 @@
         connection.start();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        ActiveMQDestination destination1 = (ActiveMQDestination) session.createQueue(destination1String);
-        ActiveMQDestination destination2 = (ActiveMQDestination) session.createQueue(destination2String);
-        ActiveMQDestination destination3 = (ActiveMQDestination) session.createQueue(destination3String);
+        ActiveMQDestination destination1 = (ActiveMQDestination)session.createQueue(destination1String);
+        ActiveMQDestination destination2 = (ActiveMQDestination)session.createQueue(destination2String);
+        ActiveMQDestination destination3 = (ActiveMQDestination)session.createQueue(destination3String);
 
         Message m = null;
         MessageConsumer consumer = null;
         String text = null;
 
-        sendMessage(session,destination1,destination1String);
-        sendMessage(session,destination2,destination2String);
-        sendMessage(session,destination3,destination3String);
-        ActiveMQDestination destination7 = (ActiveMQDestination) session.createQueue("TEST.ONE.>");
+        sendMessage(session, destination1, destination1String);
+        sendMessage(session, destination2, destination2String);
+        sendMessage(session, destination3, destination3String);
+        ActiveMQDestination destination7 = (ActiveMQDestination)session.createQueue("TEST.ONE.>");
         consumer = session.createConsumer(destination7);
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         m = consumer.receive(1000);
         assertNotNull(m);
-        if(!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         m = consumer.receive(1000);
         assertNotNull(m);
-        if(!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         assertNull(consumer.receiveNoWait());
@@ -140,27 +139,27 @@
         connection.start();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        ActiveMQDestination destination1 = (ActiveMQDestination) session.createQueue(destination1String);
-        ActiveMQDestination destination4 = (ActiveMQDestination) session.createQueue(destination4String);
+        ActiveMQDestination destination1 = (ActiveMQDestination)session.createQueue(destination1String);
+        ActiveMQDestination destination4 = (ActiveMQDestination)session.createQueue(destination4String);
 
         Message m = null;
         MessageConsumer consumer = null;
         String text = null;
 
-        sendMessage(session,destination1,destination1String);
-        sendMessage(session,destination4,destination4String);
-        ActiveMQDestination destination8 = (ActiveMQDestination) session.createQueue("TEST.*.ONE");
+        sendMessage(session, destination1, destination1String);
+        sendMessage(session, destination4, destination4String);
+        ActiveMQDestination destination8 = (ActiveMQDestination)session.createQueue("TEST.*.ONE");
         consumer = session.createConsumer(destination8);
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination4String))) {
+        if (!(text.equals(destination1String) || text.equals(destination4String))) {
             fail("unexpected message:" + text);
         }
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination4String))) {
+        if (!(text.equals(destination1String) || text.equals(destination4String))) {
             fail("unexpected message:" + text);
         }
         assertNull(consumer.receiveNoWait());

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java Wed Aug  8 11:56:59 2007
@@ -56,10 +56,9 @@
         }
     }
 
-
     /**
      * Make sure Temp destination can only be consumed by local connection
-     *
+     * 
      * @throws JMSException
      */
     public void testTempDestOnlyConsumedByLocalConn() throws JMSException {
@@ -72,7 +71,7 @@
         TextMessage message = tempSession.createTextMessage("First");
         producer.send(message);
 
-        //temp destination should not be consume  when using another connection
+        // temp destination should not be consume when using another connection
         Connection otherConnection = factory.createConnection();
         Session otherSession = otherConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         TemporaryQueue otherQueue = otherSession.createTemporaryQueue();
@@ -80,21 +79,20 @@
         Message msg = consumer.receive(3000);
         assertNull(msg);
 
-        //should throw InvalidDestinationException when consuming a temp destination from another connection
-        try{
-             consumer = otherSession.createConsumer(queue);
-             fail("Send should fail since temp destination should be used from another connection");
-        }catch(InvalidDestinationException e){
-              assertTrue("failed to throw an exception",true);
+        // should throw InvalidDestinationException when consuming a temp
+        // destination from another connection
+        try {
+            consumer = otherSession.createConsumer(queue);
+            fail("Send should fail since temp destination should be used from another connection");
+        } catch (InvalidDestinationException e) {
+            assertTrue("failed to throw an exception", true);
         }
 
-
-        //should be able to consume temp destination from the same connection
+        // should be able to consume temp destination from the same connection
         consumer = tempSession.createConsumer(queue);
         msg = consumer.receive(3000);
         assertNotNull(msg);
 
-
     }
 
     /**
@@ -117,8 +115,7 @@
         Message message2 = consumer.receive(1000);
         assertNotNull(message2);
         assertTrue("Expected message to be a TextMessage", message2 instanceof TextMessage);
-        assertTrue("Expected message to be a '" + message.getText() + "'", 
-                ((TextMessage) message2).getText().equals(message.getText()));
+        assertTrue("Expected message to be a '" + message.getText() + "'", ((TextMessage)message2).getText().equals(message.getText()));
     }
 
     /**
@@ -141,95 +138,100 @@
         Message message2 = consumer.receive(3000);
         assertNotNull(message2);
         assertTrue("Expected message to be a TextMessage", message2 instanceof TextMessage);
-        assertTrue("Expected message to be a '" + message.getText() + "'", 
-                ((TextMessage) message2).getText().equals(message.getText()));
+        assertTrue("Expected message to be a '" + message.getText() + "'", ((TextMessage)message2).getText().equals(message.getText()));
 
     }
-    
+
     /**
      * Test temp queue works under load
+     * 
      * @throws JMSException
      */
     public void testTmpQueueWorksUnderLoad() throws JMSException {
         int count = 500;
         int dataSize = 1024;
-        
+
         ArrayList list = new ArrayList(count);
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         Queue queue = session.createTemporaryQueue();
         MessageProducer producer = session.createProducer(queue);
         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-      
+
         byte[] data = new byte[dataSize];
-        for (int i =0; i < count; i++){
+        for (int i = 0; i < count; i++) {
             BytesMessage message = session.createBytesMessage();
             message.writeBytes(data);
             producer.send(message);
             list.add(message);
         }
-        
 
         connection.start();
         MessageConsumer consumer = session.createConsumer(queue);
-        for (int i =0; i < count; i++){
+        for (int i = 0; i < count; i++) {
             Message message2 = consumer.receive(2000);
-            
+
             assertTrue(message2 != null);
             assertTrue(message2.equals(list.get(i)));
         }
     }
-    
+
     /**
-     * Make sure you cannot publish to a temp destination that does not exist anymore.
+     * Make sure you cannot publish to a temp destination that does not exist
+     * anymore.
      * 
      * @throws JMSException
-     * @throws InterruptedException 
+     * @throws InterruptedException
      */
     public void testPublishFailsForClosedConnection() throws JMSException, InterruptedException {
-        
+
         Connection tempConnection = factory.createConnection();
-        Session tempSession = tempConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);        
+        Session tempSession = tempConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         TemporaryQueue queue = tempSession.createTemporaryQueue();
-        
+
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        connection.start();        
-        
-        // This message delivery should work since the temp connection is still open.
+        connection.start();
+
+        // This message delivery should work since the temp connection is still
+        // open.
         MessageProducer producer = session.createProducer(queue);
         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
         TextMessage message = session.createTextMessage("First");
         producer.send(message);
 
-        // Closing the connection should destroy the temp queue that was created.
+        // Closing the connection should destroy the temp queue that was
+        // created.
         tempConnection.close();
         Thread.sleep(1000); // Wait a little bit to let the delete take effect.
-        
-        // This message delivery NOT should work since the temp connection is now closed.
+
+        // This message delivery NOT should work since the temp connection is
+        // now closed.
         try {
             message = session.createTextMessage("Hello");
             producer.send(message);
             fail("Send should fail since temp destination should not exist anymore.");
-        } catch ( JMSException e ) {      
-            assertTrue("failed to throw an exception",true);
+        } catch (JMSException e) {
+            assertTrue("failed to throw an exception", true);
         }
     }
-    
+
     /**
-     * Make sure you cannot publish to a temp destination that does not exist anymore.
+     * Make sure you cannot publish to a temp destination that does not exist
+     * anymore.
      * 
      * @throws JMSException
-     * @throws InterruptedException 
+     * @throws InterruptedException
      */
     public void testPublishFailsForDestoryedTempDestination() throws JMSException, InterruptedException {
-        
+
         Connection tempConnection = factory.createConnection();
-        Session tempSession = tempConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);        
+        Session tempSession = tempConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         TemporaryQueue queue = tempSession.createTemporaryQueue();
-        
-        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);        
-        connection.start();        
-        
-        // This message delivery should work since the temp connection is still open.
+
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        connection.start();
+
+        // This message delivery should work since the temp connection is still
+        // open.
         MessageProducer producer = session.createProducer(queue);
         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
         TextMessage message = session.createTextMessage("First");
@@ -238,36 +240,39 @@
         // deleting the Queue will cause sends to fail
         queue.delete();
         Thread.sleep(1000); // Wait a little bit to let the delete take effect.
-        
-        // This message delivery NOT should work since the temp connection is now closed.
+
+        // This message delivery NOT should work since the temp connection is
+        // now closed.
         try {
             message = session.createTextMessage("Hello");
             producer.send(message);
             fail("Send should fail since temp destination should not exist anymore.");
-        } catch ( JMSException e ) {      
-            assertTrue("failed to throw an exception",true);
+        } catch (JMSException e) {
+            assertTrue("failed to throw an exception", true);
         }
     }
-    
+
     /**
      * Test you can't delete a Destination with Active Subscribers
+     * 
      * @throws JMSException
      */
     public void testDeleteDestinationWithSubscribersFails() throws JMSException {
         Connection connection = factory.createConnection();
-        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);        
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         TemporaryQueue queue = session.createTemporaryQueue();
-          
-        connection.start();        
-        
+
+        connection.start();
+
         session.createConsumer(queue);
-        
-        // This message delivery should NOT work since the temp connection is now closed.
+
+        // This message delivery should NOT work since the temp connection is
+        // now closed.
         try {
             queue.delete();
             fail("Should fail as Subscribers are active");
-        } catch ( JMSException e ) {      
-            assertTrue("failed to throw an exception",true);
+        } catch (JMSException e) {
+            assertTrue("failed to throw an exception", true);
         }
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java Wed Aug  8 11:56:59 2007
@@ -49,7 +49,7 @@
     protected ConnectionFactory factory;
     protected ActiveMQConnection connection;
     protected BrokerService broker;
-    
+
     protected List connections = Collections.synchronizedList(new ArrayList());
 
     // /////////////////////////////////////////////////////////////////
@@ -60,13 +60,13 @@
     protected ActiveMQDestination createDestination(Session session, byte type) throws JMSException {
         switch (type) {
         case ActiveMQDestination.QUEUE_TYPE:
-            return (ActiveMQDestination) session.createQueue("TEST");
+            return (ActiveMQDestination)session.createQueue("TEST");
         case ActiveMQDestination.TOPIC_TYPE:
-            return (ActiveMQDestination) session.createTopic("TEST");
+            return (ActiveMQDestination)session.createTopic("TEST");
         case ActiveMQDestination.TEMP_QUEUE_TYPE:
-            return (ActiveMQDestination) session.createTemporaryQueue();
+            return (ActiveMQDestination)session.createTemporaryQueue();
         case ActiveMQDestination.TEMP_TOPIC_TYPE:
-            return (ActiveMQDestination) session.createTemporaryTopic();
+            return (ActiveMQDestination)session.createTemporaryTopic();
         }
         throw new IllegalArgumentException("type: " + type);
     }
@@ -88,7 +88,7 @@
     protected void sendMessages(Session session, Destination destination, int count) throws JMSException {
         MessageProducer producer = session.createProducer(destination);
         for (int i = 0; i < count; i++) {
-            producer.send(session.createTextMessage(""+i));
+            producer.send(session.createTextMessage("" + i));
         }
         producer.close();
     }
@@ -104,21 +104,21 @@
     protected void setUp() throws Exception {
         super.setUp();
 
-    	if(System.getProperty("basedir")==null){
-            File file=new File(".");
-            System.setProperty("basedir",file.getAbsolutePath());
+        if (System.getProperty("basedir") == null) {
+            File file = new File(".");
+            System.setProperty("basedir", file.getAbsolutePath());
         }
 
         broker = createBroker();
         broker.start();
         factory = createConnectionFactory();
-        connection = (ActiveMQConnection) factory.createConnection(userName, password);
+        connection = (ActiveMQConnection)factory.createConnection(userName, password);
         connections.add(connection);
     }
 
     protected void tearDown() throws Exception {
         for (Iterator iter = connections.iterator(); iter.hasNext();) {
-            Connection conn= (Connection) iter.next();
+            Connection conn = (Connection)iter.next();
             try {
                 conn.close();
             } catch (Throwable e) {
@@ -127,7 +127,7 @@
         broker.stop();
         super.tearDown();
     }
-    
+
     protected void safeClose(Connection c) {
         try {
             c.close();
@@ -155,17 +155,17 @@
         } catch (Throwable e) {
         }
     }
-    
+
     protected void profilerPause(String prompt) throws IOException {
-        if( System.getProperty("profiler")!=null ) {
+        if (System.getProperty("profiler") != null) {
             pause(prompt);
         }
     }
-    
+
     protected void pause(String prompt) throws IOException {
         System.out.println();
-        System.out.println(prompt+"> Press enter to continue: ");
-        while( System.in.read()!='\n' ) {            
+        System.out.println(prompt + "> Press enter to continue: ");
+        while (System.in.read() != '\n') {
         }
     }
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java Wed Aug  8 11:56:59 2007
@@ -28,16 +28,15 @@
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.test.JmsTopicSendReceiveTest;
 
-
 /**
  * @version $Revision: 1.4 $
  */
 public class JmsTopicWildcardSendReceiveTest extends JmsTopicSendReceiveTest {
 
-    private String destination1String = "TEST.ONE.ONE" ;
-    private String destination2String = "TEST.ONE.ONE.ONE" ;
-    private String destination3String = "TEST.ONE.TWO" ;
-    private String destination4String = "TEST.TWO.ONE" ;
+    private String destination1String = "TEST.ONE.ONE";
+    private String destination2String = "TEST.ONE.ONE.ONE";
+    private String destination3String = "TEST.ONE.TWO";
+    private String destination4String = "TEST.TWO.ONE";
 
     protected void setUp() throws Exception {
         topic = true;
@@ -45,12 +44,12 @@
         deliveryMode = DeliveryMode.NON_PERSISTENT;
         super.setUp();
     }
-    
-    protected String getConsumerSubject(){
+
+    protected String getConsumerSubject() {
         return "FOO.>";
     }
-    
-    protected String getProducerSubject(){
+
+    protected String getProducerSubject() {
         return "FOO.BAR.HUMBUG";
     }
 
@@ -58,27 +57,27 @@
         connection.start();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic(destination1String);
-        ActiveMQDestination destination3 = (ActiveMQDestination) session.createTopic(destination3String);
+        ActiveMQDestination destination1 = (ActiveMQDestination)session.createTopic(destination1String);
+        ActiveMQDestination destination3 = (ActiveMQDestination)session.createTopic(destination3String);
 
         Message m = null;
         MessageConsumer consumer = null;
         String text = null;
 
-        ActiveMQDestination destination6 = (ActiveMQDestination) session.createTopic("TEST.ONE.*");
+        ActiveMQDestination destination6 = (ActiveMQDestination)session.createTopic("TEST.ONE.*");
         consumer = session.createConsumer(destination6);
-        sendMessage(session,destination1,destination1String);
-        sendMessage(session,destination3,destination3String);
+        sendMessage(session, destination1, destination1String);
+        sendMessage(session, destination3, destination3String);
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         assertNull(consumer.receiveNoWait());
@@ -88,33 +87,33 @@
         connection.start();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic(destination1String);
-        ActiveMQDestination destination2 = (ActiveMQDestination) session.createTopic(destination2String);
-        ActiveMQDestination destination3 = (ActiveMQDestination) session.createTopic(destination3String);
+        ActiveMQDestination destination1 = (ActiveMQDestination)session.createTopic(destination1String);
+        ActiveMQDestination destination2 = (ActiveMQDestination)session.createTopic(destination2String);
+        ActiveMQDestination destination3 = (ActiveMQDestination)session.createTopic(destination3String);
 
         Message m = null;
         MessageConsumer consumer = null;
         String text = null;
 
-        ActiveMQDestination destination7 = (ActiveMQDestination) session.createTopic("TEST.ONE.>");
+        ActiveMQDestination destination7 = (ActiveMQDestination)session.createTopic("TEST.ONE.>");
         consumer = session.createConsumer(destination7);
-        sendMessage(session,destination1,destination1String);
-        sendMessage(session,destination2,destination2String);
-        sendMessage(session,destination3,destination3String);
+        sendMessage(session, destination1, destination1String);
+        sendMessage(session, destination2, destination2String);
+        sendMessage(session, destination3, destination3String);
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         m = consumer.receive(1000);
         assertNotNull(m);
-        if(!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         m = consumer.receive(1000);
         assertNotNull(m);
-        if(!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
+        if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
             fail("unexpected message:" + text);
         }
         assertNull(consumer.receiveNoWait());
@@ -124,27 +123,27 @@
         connection.start();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic(destination1String);
-        ActiveMQDestination destination4 = (ActiveMQDestination) session.createTopic(destination4String);
+        ActiveMQDestination destination1 = (ActiveMQDestination)session.createTopic(destination1String);
+        ActiveMQDestination destination4 = (ActiveMQDestination)session.createTopic(destination4String);
 
         Message m = null;
         MessageConsumer consumer = null;
         String text = null;
 
-        ActiveMQDestination destination8 = (ActiveMQDestination) session.createTopic("TEST.*.ONE");
+        ActiveMQDestination destination8 = (ActiveMQDestination)session.createTopic("TEST.*.ONE");
         consumer = session.createConsumer(destination8);
-        sendMessage(session,destination1,destination1String);
-        sendMessage(session,destination4,destination4String);
+        sendMessage(session, destination1, destination1String);
+        sendMessage(session, destination4, destination4String);
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination4String))) {
+        if (!(text.equals(destination1String) || text.equals(destination4String))) {
             fail("unexpected message:" + text);
         }
         m = consumer.receive(1000);
         assertNotNull(m);
         text = ((TextMessage)m).getText();
-        if(!(text.equals(destination1String) || text.equals(destination4String))) {
+        if (!(text.equals(destination1String) || text.equals(destination4String))) {
             fail("unexpected message:" + text);
         }
         assertNull(consumer.receiveNoWait());

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeMessageTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeMessageTestSupport.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeMessageTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeMessageTestSupport.java Wed Aug  8 11:56:59 2007
@@ -41,8 +41,7 @@
  */
 public class LargeMessageTestSupport extends ClientTestSupport implements MessageListener {
 
-    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
-        .getLog(LargeMessageTestSupport.class);
+    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LargeMessageTestSupport.class);
 
     protected static final int LARGE_MESSAGE_SIZE = 128 * 1024;
     protected static final int MESSAGE_COUNT = 100;
@@ -97,7 +96,8 @@
         }
 
         try {
-            Thread.sleep(1000);// allow the broker to start
+            // allow the broker to start
+            Thread.sleep(1000);
         } catch (InterruptedException e) {
             throw new JMSException(e.getMessage());
         }
@@ -185,8 +185,7 @@
             }
         }
         log.info("Finished count = " + messageCount);
-        assertTrue("Not enough messages - expected " + MESSAGE_COUNT + " but got " + messageCount,
-                   messageCount.get() == MESSAGE_COUNT);
+        assertTrue("Not enough messages - expected " + MESSAGE_COUNT + " but got " + messageCount, messageCount.get() == MESSAGE_COUNT);
         assertTrue("received messages are not valid", validMessageConsumption);
         Thread.sleep(1000);
         log.info("FINAL count = " + messageCount);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java?view=diff&rev=563982&r1=563981&r2=563982
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java Wed Aug  8 11:56:59 2007
@@ -1,21 +1,22 @@
 package org.apache.activemq;
+
 /**
-*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -38,13 +39,10 @@
 public final class LargeStreamletTest extends TestCase {
 
     private static final Log log = LogFactory.getLog(LargeStreamletTest.class);
-    
     private static final String BROKER_URL = "vm://localhost?broker.persistent=false";
-
     private static final int BUFFER_SIZE = 1 * 1024;
+    private static final int MESSAGE_COUNT = 10 * 1024;
 
-    private static final int MESSAGE_COUNT = 10*1024;
-    
     private AtomicInteger totalRead = new AtomicInteger();
 
     private AtomicInteger totalWritten = new AtomicInteger();
@@ -56,15 +54,12 @@
     protected Exception readerException;
 
     public void testStreamlets() throws Exception {
-        final ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(
-                BROKER_URL);
+        final ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(BROKER_URL);
 
-        final ActiveMQConnection connection = (ActiveMQConnection) factory
-                .createConnection();
+        final ActiveMQConnection connection = (ActiveMQConnection)factory.createConnection();
         connection.start();
         try {
-            final Session session = connection.createSession(false,
-                    Session.AUTO_ACKNOWLEDGE);
+            final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             try {
                 final Destination destination = session.createQueue("wibble");
                 final Thread readerThread = new Thread(new Runnable() {
@@ -72,20 +67,18 @@
                     public void run() {
                         totalRead.set(0);
                         try {
-                            final InputStream inputStream = connection
-                                    .createInputStream(destination);
+                            final InputStream inputStream = connection.createInputStream(destination);
                             try {
                                 int read;
                                 final byte[] buf = new byte[BUFFER_SIZE];
-                                while (!stopThreads.get()
-                                        && (read = inputStream.read(buf)) != -1) {
+                                while (!stopThreads.get() && (read = inputStream.read(buf)) != -1) {
                                     totalRead.addAndGet(read);
                                 }
                             } finally {
                                 inputStream.close();
                             }
                         } catch (Exception e) {
-                            readerException  = e;
+                            readerException = e;
                             e.printStackTrace();
                         } finally {
                             log.info(totalRead + " total bytes read.");
@@ -94,13 +87,13 @@
                 });
 
                 final Thread writerThread = new Thread(new Runnable() {
-                	private final Random random = new Random();
+                    private final Random random = new Random();
+
                     public void run() {
                         totalWritten.set(0);
                         int count = MESSAGE_COUNT;
                         try {
-                            final OutputStream outputStream = connection
-                                    .createOutputStream(destination);
+                            final OutputStream outputStream = connection.createOutputStream(destination);
                             try {
                                 final byte[] buf = new byte[BUFFER_SIZE];
                                 random.nextBytes(buf);
@@ -116,8 +109,7 @@
                             writerException = e;
                             e.printStackTrace();
                         } finally {
-                            log.info(totalWritten
-                                    + " total bytes written.");
+                            log.info(totalWritten + " total bytes written.");
                         }
                     }
                 });
@@ -125,28 +117,27 @@
                 readerThread.start();
                 writerThread.start();
 
-                
-                // Wait till reader is has finished receiving all the messages or he has stopped
+                // Wait till reader is has finished receiving all the messages
+                // or he has stopped
                 // receiving messages.
                 Thread.sleep(1000);
                 int lastRead = totalRead.get();
-                while( readerThread.isAlive() ) {
+                while (readerThread.isAlive()) {
                     readerThread.join(1000);
                     // No progress?? then stop waiting..
-                    if( lastRead == totalRead.get() ) {
+                    if (lastRead == totalRead.get()) {
                         break;
                     }
                     lastRead = totalRead.get();
                 }
-                
+
                 stopThreads.set(true);
 
                 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());
-                
+
+                Assert.assertEquals("Not all messages accounted for", totalWritten.get(), totalRead.get());
+
             } finally {
                 session.close();
             }



Mime
View raw message