You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/04/26 19:25:49 UTC

svn commit: r397249 [2/2] - in /incubator/activemq/trunk/activemq-core/src: main/java/org/apache/activemq/filter/ main/java/org/apache/activemq/network/ main/java/org/apache/activemq/transport/udp/ test/java/org/apache/activemq/ test/java/org/apache/ac...

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java?rev=397249&r1=397248&r2=397249&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java (original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java Wed Apr 26 10:25:42 2006
@@ -25,6 +25,9 @@
 
 import junit.framework.Assert;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
  * A simple container of messages for performing testing and rendezvous style
  * code. You can use this class a {@link MessageListener} and then make
@@ -38,6 +41,9 @@
  * @version $Revision: 1.6 $
  */
 public class MessageIdList extends Assert implements MessageListener {
+    
+    protected static final Log log = LogFactory.getLog(MessageIdList.class);
+
     private List messageIds = new ArrayList();
     private Object semaphore;
     private boolean verbose;
@@ -98,7 +104,7 @@
                 semaphore.notifyAll();
             }
             if (verbose) {
-                System.out.println("Received message: " + message);
+                log.info("Received message: " + message);
             }
         } catch (JMSException e) {
             e.printStackTrace();
@@ -115,7 +121,7 @@
     }
 
     public void waitForMessagesToArrive(int messageCount) {
-        System.out.println("Waiting for " + messageCount + " message(s) to arrive");
+        log.info("Waiting for " + messageCount + " message(s) to arrive");
 
         long start = System.currentTimeMillis();
 
@@ -133,12 +139,12 @@
                 }
             }
             catch (InterruptedException e) {
-                System.out.println("Caught: " + e);
+                log.info("Caught: " + e);
             }
         }
         long end = System.currentTimeMillis() - start;
 
-        System.out.println("End of wait for " + end + " millis and received: " + getMessageCount() + " messages");
+        log.info("End of wait for " + end + " millis and received: " + getMessageCount() + " messages");
     }
 
     /**

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithEmbeddedBrokerTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithEmbeddedBrokerTest.java?rev=397249&r1=397248&r2=397249&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithEmbeddedBrokerTest.java (original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithEmbeddedBrokerTest.java Wed Apr 26 10:25:42 2006
@@ -35,12 +35,12 @@
     }
 
     protected void setUp() throws Exception {
-        System.out.println("### starting up the test case: " + getName());
+        log.info("### starting up the test case: " + getName());
 
         super.setUp();
         connection = connectionFactory.createConnection();
         connection.start();
-        System.out.println("### started up the test case: " + getName());
+        log.info("### started up the test case: " + getName());
     }
 
     protected void tearDown() throws Exception {
@@ -48,7 +48,6 @@
 
         super.tearDown();
 
-        System.out.println("### closed down the test case: " + getName());
-        System.out.println();
+        log.info("### closed down the test case: " + getName());
     }
 }

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithSpringFactoryBeanTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithSpringFactoryBeanTest.java?rev=397249&r1=397248&r2=397249&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithSpringFactoryBeanTest.java (original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/MultipleTestsWithSpringFactoryBeanTest.java Wed Apr 26 10:25:42 2006
@@ -16,22 +16,27 @@
  */
 package org.apache.activemq.xbean;
 
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 
 import junit.framework.TestCase;
 
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
 /**
  * 
  * @author Neil Clayton
  * @version $Revision$
  */
 public class MultipleTestsWithSpringFactoryBeanTest extends TestCase {
+    
+    protected static final Log log = LogFactory.getLog(MultipleTestsWithSpringFactoryBeanTest.class);
+    
     protected AbstractApplicationContext context;
     protected BrokerService service;
     private Connection connection;
@@ -43,7 +48,7 @@
     }
     
     protected void setUp() throws Exception {
-        System.out.println("### starting up the test case: " + getName());
+        log.info("### starting up the test case: " + getName());
         
         super.setUp();
         context = new ClassPathXmlApplicationContext("org/apache/activemq/xbean/spring2.xml");
@@ -54,7 +59,7 @@
         
         connection = createConnectionFactory().createConnection();
         connection.start();
-        System.out.println("### started up the test case: " + getName());
+        log.info("### started up the test case: " + getName());
     }
 
     protected void tearDown() throws Exception {
@@ -65,8 +70,7 @@
         context.close();
         super.tearDown();
         
-        System.out.println("### closed down the test case: " + getName());
-        System.out.println();
+        log.info("### closed down the test case: " + getName());
     }
 
     protected ConnectionFactory createConnectionFactory() {

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java?rev=397249&r1=397248&r2=397249&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java (original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java Wed Apr 26 10:25:42 2006
@@ -34,6 +34,8 @@
 import org.apache.activemq.command.ActiveMQTopic;
 import org.apache.activemq.command.ConnectionId;
 import org.apache.activemq.command.ConnectionInfo;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * 
@@ -41,6 +43,8 @@
  */
 public class XBeanConfigTest extends TestCase {
 
+    protected static final Log log = LogFactory.getLog(XBeanConfigTest.class);
+
     protected BrokerService brokerService;
     protected Broker broker;
     protected ConnectionContext context;
@@ -59,9 +63,9 @@
         assertTrue("subscriptionRecoveryPolicy should be LastImageSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                 subscriptionRecoveryPolicy instanceof LastImageSubscriptionRecoveryPolicy);
         
-        System.out.println("destination: " + topic);
-        System.out.println("dispatchPolicy: " + dispatchPolicy);
-        System.out.println("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);
+        log.info("destination: " + topic);
+        log.info("dispatchPolicy: " + dispatchPolicy);
+        log.info("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);
 
         topic = (Topic) broker.addDestination(context, new ActiveMQTopic("ORDERS.BOOKS"));
         dispatchPolicy = topic.getDispatchPolicy();
@@ -73,9 +77,9 @@
         TimedSubscriptionRecoveryPolicy timedSubcriptionPolicy = (TimedSubscriptionRecoveryPolicy) subscriptionRecoveryPolicy;
         assertEquals("getRecoverDuration()", 60000, timedSubcriptionPolicy.getRecoverDuration());
         
-        System.out.println("destination: " + topic);
-        System.out.println("dispatchPolicy: " + dispatchPolicy);
-        System.out.println("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);
+        log.info("destination: " + topic);
+        log.info("dispatchPolicy: " + dispatchPolicy);
+        log.info("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);
     }
 
     protected void setUp() throws Exception {
@@ -112,7 +116,7 @@
 
     protected BrokerService createBroker() throws Exception {
         String uri = "org/apache/activemq/xbean/activemq-policy.xml";
-        System.out.println("Loading broker configuration from the classpath with URI: " + uri);
+        log.info("Loading broker configuration from the classpath with URI: " + uri);
         return BrokerFactory.createBroker(new URI("xbean:"+uri));
     }