activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r397324 - in /incubator/activemq/trunk: activemq-jaas/src/main/java/org/apache/activemq/jaas/ activemq-optional/src/test/java/org/apache/activemq/transport/xstream/ assembly/src/test/java/org/apache/activemq/config/ assembly/src/test/java/o...
Date Wed, 26 Apr 2006 22:33:49 GMT
Author: chirino
Date: Wed Apr 26 15:33:48 2006
New Revision: 397324

URL: http://svn.apache.org/viewcvs?rev=397324&view=rev
Log:
converted more println in the test cases to log.info() calls.

Modified:
    incubator/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
    incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/xstream/XStreamWireFormatTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/config/ConfigTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/transport/TopicClusterTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ExceptionListenerTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java
    incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionTest.java

Modified: incubator/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
(original)
+++ incubator/activemq/trunk/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
Wed Apr 26 15:33:48 2006
@@ -69,7 +69,6 @@
         } else {
             baseDir = new File(".");
         }
-        System.out.println("setting based dir="+baseDir);
 
         debug = "true".equalsIgnoreCase((String) options.get("debug"));
         usersFile = (String) options.get(USER_FILE)+"";

Modified: incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/xstream/XStreamWireFormatTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/xstream/XStreamWireFormatTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/xstream/XStreamWireFormatTest.java
(original)
+++ incubator/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/xstream/XStreamWireFormatTest.java
Wed Apr 26 15:33:48 2006
@@ -31,8 +31,8 @@
         super.assertBeanMarshalls(original);
 
         String xml = getXStreamWireFormat().toString((Command) original);
-        System.out.println(original.getClass().getName() + " as XML is:");
-        System.out.println(xml);
+        log.info(original.getClass().getName() + " as XML is:");
+        log.info(xml);
     }
 
     protected XStreamWireFormat getXStreamWireFormat() {

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/config/ConfigTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/config/ConfigTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/config/ConfigTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/config/ConfigTest.java
Wed Apr 26 15:33:48 2006
@@ -43,6 +43,8 @@
 import org.apache.activemq.transport.activeio.ActiveIOTransportServer;
 import org.apache.activemq.transport.tcp.TcpTransportServer;
 import org.apache.activemq.xbean.BrokerFactoryBean;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.derby.jdbc.EmbeddedDataSource;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.FileSystemResource;
@@ -52,6 +54,9 @@
  * @version $Revision: 1.2 $
  */
 public class ConfigTest extends TestCase {
+    
+    private static final Log log = LogFactory.getLog(ConfigTest.class);
+    
     protected static final String JOURNAL_ROOT = "target/test-data/";
     protected static final String DERBY_ROOT = "target/test-data/";
     protected static final String CONF_ROOT = "src/sample-conf/";
@@ -99,7 +104,7 @@
             System.out.print("Checking persistence adapter factory settings... ");
             JournalPersistenceAdapter pa = (JournalPersistenceAdapter) broker.getPersistenceAdapter();
             
-            System.out.println("Success");
+            log.info("Success");
         } finally {
             if (broker != null) {
                 broker.stop();
@@ -128,7 +133,7 @@
             assertTrue("Should have created a DefaultWireFormat",
                     ((JDBCPersistenceAdapter)adapter).getWireFormat() instanceof DefaultWireFormat);
 
-            System.out.println("Success");
+            log.info("Success");
         } finally {
             if (broker != null) {
                 broker.stop();
@@ -149,7 +154,7 @@
         // Create broker from resource
         System.out.print("Creating broker... ");
         broker = createBroker("org/apache/activemq/config/example.xml");
-        System.out.println("Success");
+        log.info("Success");
 
         try {
             // Check broker configuration
@@ -161,12 +166,12 @@
             assertEquals("Broker Config Error (persistent)", false, broker.isPersistent());
             assertEquals("Broker Config Error (useShutdownHook)", false, broker.isUseShutdownHook());
             assertEquals("Broker Config Error (deleteAllMessagesOnStartup)", true, broker.isDeleteAllMessagesOnStartup());
-            System.out.println("Success");
+            log.info("Success");
 
             // Check specific vm transport
             System.out.print("Checking vm connector... ");
             assertEquals("Should have a specific VM Connector", "vm://javacoola", broker.getVmConnectorURI().toString());
-            System.out.println("Success");
+            log.info("Success");
 
             // Check transport connectors list
             System.out.print("Checking transport connectors... ");
@@ -188,13 +193,13 @@
             assertEquals("WireFormat Config Error (stackTraceEnabled)", false, ((OpenWireFormat)myWireFormat).getPreferedWireFormatInfo().isStackTraceEnabled());
             assertEquals("WireFormat Config Error (tcpNoDelayEnabled)", true, ((OpenWireFormat)myWireFormat).getPreferedWireFormatInfo().isTcpNoDelayEnabled());
             assertEquals("WireFormat Config Error (cacheEnabled)", false, ((OpenWireFormat)myWireFormat).getPreferedWireFormatInfo().isCacheEnabled());
-            System.out.println("Success");
+            log.info("Success");
 
             // Check network connectors
             System.out.print("Checking network connectors... ");
             List networkConnectors = broker.getNetworkConnectors();
             assertEquals("Should have a single network connector", 1, networkConnectors.size());
-            System.out.println("Success");
+            log.info("Success");
 
             // Check dispatch policy configuration
             System.out.print("Checking dispatch policies... ");
@@ -210,7 +215,7 @@
             dest = new ActiveMQTopic("Topic.StrictOrderDispatch");
             assertTrue("Should have a strict order dispatch policy for " + dest.getTopicName(),
                     broker.getDestinationPolicy().getEntryFor(dest).getDispatchPolicy() instanceof
StrictOrderDispatchPolicy);
-            System.out.println("Success");
+            log.info("Success");
 
             // Check subscription policy configuration
             System.out.print("Checking subscription recovery policies... ");
@@ -241,7 +246,7 @@
                     subsPolicy instanceof TimedSubscriptionRecoveryPolicy);
             assertEquals("TimedSubsPolicy Config Error (recoverDuration)", 25000,
                     ((TimedSubscriptionRecoveryPolicy)subsPolicy).getRecoverDuration());
-            System.out.println("Success");
+            log.info("Success");
 
             // Check usage manager
             System.out.print("Checking memory manager configurations... ");
@@ -249,9 +254,9 @@
             assertTrue("Should have a memory manager", memMgr != null);
             assertEquals("UsageManager Config Error (limit)", 200000, memMgr.getLimit());
             assertEquals("UsageManager Config Error (percentUsageMinDelta)", 20, memMgr.getPercentUsageMinDelta());
-            System.out.println("Success");
+            log.info("Success");
 
-            System.out.println("Success");
+            log.info("Success");
         } finally {
             if (broker != null) {
                 broker.stop();
@@ -278,7 +283,7 @@
             assertTrue("Should have created a journal persistence adapter", adapter instanceof
JournalPersistenceAdapter);
             assertTrue("Should have created a journal directory at " + journalFile.getAbsolutePath(),
journalFile.exists());
 
-            System.out.println("Success");
+            log.info("Success");
         } finally {
             if (broker != null) {
                 broker.stop();
@@ -310,7 +315,7 @@
             assertTrue("Should have not created a derby directory at " + derbyFile.getAbsolutePath(),
!derbyFile.exists());
             assertTrue("Should have not created a journal directory at " + journalFile.getAbsolutePath(),
!journalFile.exists());
 
-            System.out.println("Success");
+            log.info("Success");
         } finally {
             if (broker != null) {
                 broker.stop();

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/transport/TopicClusterTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/transport/TopicClusterTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/transport/TopicClusterTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/transport/TopicClusterTest.java
Wed Apr 26 15:33:48 2006
@@ -16,19 +16,9 @@
  */
 
 package org.apache.activemq.transport;
-import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.TransportConnector;
-import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.command.ActiveMQTextMessage;
-import org.apache.activemq.command.ActiveMQTopic;
-import org.apache.activemq.network.NetworkConnector;
-import org.apache.activemq.transport.discovery.rendezvous.RendezvousDiscoveryAgent;
-import org.apache.activemq.util.ServiceStopper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.jms.Connection;
 import javax.jms.DeliveryMode;
@@ -41,17 +31,25 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
 import junit.framework.TestCase;
 
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.TransportConnector;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ActiveMQTextMessage;
+import org.apache.activemq.command.ActiveMQTopic;
+import org.apache.activemq.util.ServiceStopper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
+
 /**
  * @version $Revision: 1.1.1.1 $
  */
 public class TopicClusterTest extends TestCase implements MessageListener {
-    protected Log log = LogFactory.getLog(getClass());
+    protected final static Log log = LogFactory.getLog(TopicClusterTest.class);
     protected Destination destination;
     protected boolean topic = true;
     protected AtomicInteger receivedMessageCount = new AtomicInteger(0);
@@ -85,7 +83,7 @@
                 consumer.setMessageListener(this);
 
             }
-            System.out.println("Sleeping to ensure cluster is fully connected");
+            log.info("Sleeping to ensure cluster is fully connected");
             Thread.sleep(5000);
         } finally {
             System.setProperty("activemq.store.dir", root);
@@ -147,7 +145,7 @@
      * @param msg
      */
     public void onMessage(Message msg) {
-        //System.out.println("GOT: " + msg);
+        //log.info("GOT: " + msg);
         receivedMessageCount.incrementAndGet();
         synchronized (receivedMessageCount) {
             if (receivedMessageCount.get() >= expectedReceiveCount()) {

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositeConsumeTest.java
Wed Apr 26 15:33:48 2006
@@ -37,7 +37,7 @@
             Message message = session.createTextMessage(data[i]);
 
             if (verbose) {
-                System.out.println("About to send a message: " + message + " with text: "
+ data[i]);
+                log.info("About to send a message: " + message + " with text: " + data[i]);
             }
 
             producer.send(destinations[destIdx], message);

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java
Wed Apr 26 15:33:48 2006
@@ -51,18 +51,18 @@
         receiveConnection = createConnection();
         receiveConnection.start();
 
-        System.out.println("Created sendConnection: " + sendConnection);
-        System.out.println("Created receiveConnection: " + receiveConnection);
+        log.info("Created sendConnection: " + sendConnection);
+        log.info("Created receiveConnection: " + receiveConnection);
 
         session = sendConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         receiveSession = receiveConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-        System.out.println("Created sendSession: " + session);
-        System.out.println("Created receiveSession: " + receiveSession);
+        log.info("Created sendSession: " + session);
+        log.info("Created receiveSession: " + receiveSession);
 
         producer = session.createProducer(null);
 
-        System.out.println("Created producer: " + producer);
+        log.info("Created producer: " + producer);
 
         if (topic) {
             consumerDestination = session.createTopic(getConsumerSubject());
@@ -73,8 +73,8 @@
             producerDestination = session.createQueue(getProducerSubject());
         }
 
-        System.out.println("Created  consumer destination: " + consumerDestination + " of
type: " + consumerDestination.getClass());
-        System.out.println("Created  producer destination: " + producerDestination + " of
type: " + producerDestination.getClass());
+        log.info("Created  consumer destination: " + consumerDestination + " of type: " +
consumerDestination.getClass());
+        log.info("Created  producer destination: " + producerDestination + " of type: " +
producerDestination.getClass());
 
         Destination[] destinations = getDestinations();
         consumers = new MessageConsumer[destinations.length];
@@ -87,7 +87,7 @@
         }
 
 
-        System.out.println("Started connections");
+        log.info("Started connections");
     }
 
     protected MessageListener createMessageListener(int i, final List messageList) {
@@ -120,7 +120,7 @@
         waitForMessagesToBeDelivered();
 
         for (int i = 0, size = messageLists.length; i < size; i++) {
-            System.out.println("Message list: " + i + " contains: " + messageLists[i].size()
+ " message(s)");
+            log.info("Message list: " + i + " contains: " + messageLists[i].size() + " message(s)");
         }
 
         for (int i = 0, size = messageLists.length; i < size; i++) {

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java
Wed Apr 26 15:33:48 2006
@@ -47,7 +47,7 @@
     protected void testWithMessageCount(int messageCount) throws JMSException {
         makeMessages(messageCount);
 
-        System.out.println("About to send and receive: " + messageCount + " on destination:
" + destination
+        log.info("About to send and receive: " + messageCount + " on destination: " + destination
                 + " of type: " + destination.getClass().getName());
 
         for (int i = 0; i < messageCount; i++) {

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/CreateLotsOfTemporaryQueuesTest.java
Wed Apr 26 15:33:48 2006
@@ -46,20 +46,20 @@
     }
 
     public void testCreateLotsOfTemporaryQueues() throws Exception {
-        System.out.println("Creating " + numberToCreate + " temporary queue(s)");
+        log.info("Creating " + numberToCreate + " temporary queue(s)");
 
         Connection connection = createConnection();
         connection.start();
         Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
         for (int i = 0; i < numberToCreate; i++) {
             if (i % 1000 == 0) {
-                System.out.println("attempt " + i);
+                log.info("attempt " + i);
             }
             TemporaryQueue temporaryQueue = session.createTemporaryQueue();
             temporaryQueue.delete();
             Thread.sleep(sleep );
         }
-        System.out.println("Created " + numberToCreate + " temporary queue(s)");
+        log.info("Created " + numberToCreate + " temporary queue(s)");
         connection.close();
     }
 

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/DurableConsumerCloseAndReconnectTest.java
Wed Apr 26 15:33:48 2006
@@ -73,7 +73,7 @@
 
         closeConsumer();
 
-        System.out.println("Now lets create the consumer again and because we didn't ack,
we should get it again");
+        log.info("Now lets create the consumer again and because we didn't ack, we should
get it again");
         makeConsumer();
 
         message = consumer.receive(RECEIVE_TIMEOUT);
@@ -82,7 +82,7 @@
 
         closeConsumer();
 
-        System.out.println("Now lets create the consumer again and because we didn't ack,
we should get it again");
+        log.info("Now lets create the consumer again and because we didn't ack, we should
get it again");
         makeConsumer();
 
         message = consumer.receive(2000);
@@ -90,7 +90,7 @@
 
         closeConsumer();
 
-        System.out.println("Lets publish one more message now");
+        log.info("Lets publish one more message now");
         publish();
 
         makeConsumer();
@@ -147,7 +147,7 @@
     protected void makeConsumer() throws Exception {
         String durableName = getName();
         String clientID = getSubject();
-        System.out.println("Creating a durable subscribe for clientID: " + clientID + " and
durable name: " + durableName);
+        log.info("Creating a durable subscribe for clientID: " + clientID + " and durable
name: " + durableName);
         createSession(clientID);
         consumer = createConsumer(durableName);
     }

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ExceptionListenerTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ExceptionListenerTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ExceptionListenerTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ExceptionListenerTest.java
Wed Apr 26 15:33:48 2006
@@ -71,7 +71,7 @@
             producer.send(session.createTextMessage("This will never get anywhere"));
         }
         catch (JMSException e) {
-            System.out.println("Caught: " + e);
+            log.info("Caught: " + e);
         }
 
         try {

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java
Wed Apr 26 15:33:48 2006
@@ -19,6 +19,8 @@
 import junit.framework.TestCase;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.jms.*;
 import java.util.List;
@@ -29,6 +31,8 @@
 
 public final class PublishOnQueueConsumedMessageInTransactionTest extends TestCase implements
MessageListener {
 
+    private static final Log log = LogFactory.getLog(PublishOnQueueConsumedMessageInTransactionTest.class);
+    
     private Session producerSession;
     private Session consumerSession;
     private Destination queue;
@@ -89,12 +93,12 @@
                 objectMessage = producerSession.createObjectMessage(data[i]);
                 producer.send(objectMessage);
                 producerSession.commit();
-                System.out.println("sending message :" + objectMessage);
+                log.info("sending message :" + objectMessage);
             }
         } catch (Exception e) {
             if (producerSession != null) {
                 producerSession.rollback();
-                System.out.println("rollback");
+                log.info("rollback");
                 producerSession.close();
             }
 
@@ -108,18 +112,18 @@
             objectMessage = (ObjectMessage) m;
             consumeMessage(objectMessage,messages);
 
-            System.out.println("consumer received message :" + objectMessage);
+            log.info("consumer received message :" + objectMessage);
             consumerSession.commit();
 
         } catch (Exception e) {
             try {
                 consumerSession.rollback();
-                System.out.println("rolled back transaction");
+                log.info("rolled back transaction");
             } catch (JMSException e1) {
-                System.out.println(e1);
+                log.info(e1);
                 e1.printStackTrace();
             }
-            System.out.println(e);
+            log.info(e);
             e.printStackTrace();
         }
     }

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageUsingActivemqXMLTest.java
Wed Apr 26 15:33:48 2006
@@ -59,7 +59,7 @@
         // Create broker from resource
         System.out.print("Creating broker... ");
         broker = createBroker("org/apache/activemq/usecases/activemq.xml");
-        System.out.println("Success");
+        log.info("Success");
         super.setUp();
 
     }
@@ -71,11 +71,11 @@
      * @see junit.framework.TestCase#tearDown()
      */
     protected void tearDown() throws Exception {
-         System.out.println("Closing Broker");
+         log.info("Closing Broker");
             if (broker != null) {
                broker.stop();
             }
-         System.out.println("Broker closed...");
+         log.info("Broker closed...");
 
 
     }

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumedMessageTest.java
Wed Apr 26 15:33:48 2006
@@ -37,11 +37,11 @@
             Message msgCopy = (Message)((org.apache.activemq.command.Message)message).copy();
             replyProducer.send(msgCopy);
 
-            //System.out.println("Sending reply: " + message);
+            //log.info("Sending reply: " + message);
             super.onMessage(message);
         }
         catch (JMSException e) {
-            System.out.println("Failed to send message: " + e);
+            log.info("Failed to send message: " + e);
             e.printStackTrace();
         }
     }
@@ -59,7 +59,7 @@
         }
 
         replyProducer = receiveSession.createProducer(replyDestination);
-        System.out.println("Created replyProducer: " + replyProducer);
+        log.info("Created replyProducer: " + replyProducer);
 
     }
 }

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/PublishOnTopicConsumerMessageUsingActivemqXMLTest.java
Wed Apr 26 15:33:48 2006
@@ -58,7 +58,7 @@
         // Create broker from resource
         System.out.print("Creating broker... ");
         broker = createBroker("org/apache/activemq/usecases/activemq.xml");
-        System.out.println("Success");
+        log.info("Success");
         super.setUp();
 
     }
@@ -70,11 +70,11 @@
      * @see junit.framework.TestCase#tearDown()
      */
     protected void tearDown() throws Exception {
-         System.out.println("Closing Broker");
+         log.info("Closing Broker");
             if (broker != null) {
                broker.stop();
             }
-         System.out.println("Broker closed...");
+         log.info("Broker closed...");
 
 
     }

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java
Wed Apr 26 15:33:48 2006
@@ -21,10 +21,8 @@
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import java.net.URI;
-import java.net.URISyntaxException;
+
 import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.JMSException;
@@ -34,10 +32,17 @@
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
+
 import junit.framework.TestCase;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 public class QueueDuplicatesTest extends TestCase {
+    
+    private static final Log log = LogFactory.getLog(QueueDuplicatesTest.class);
+
     private static DateFormat formatter = new SimpleDateFormat("HH:mm:ss SSS");
     private String brokerUrl;
     private String subject;
@@ -127,7 +132,7 @@
                     String txt = "Text Message: " + i;
                     TextMessage msg = session.createTextMessage(txt);
                     producer.send(msg);
-                    System.out.println(formatter.format(new Date()) + " Sent ==> " + msg
+ " to " + subject);
+                    log.info(formatter.format(new Date()) + " Sent ==> " + msg + " to
" + subject);
                     Thread.sleep(1000);
                 }
                 session.close();
@@ -141,7 +146,7 @@
         private Map msgs = new HashMap();
 
         public void onMessage(Message message) {
-            System.out.println(formatter.format(new Date()) + " SimpleConsumer Message Received:
" + message);
+            log.info(formatter.format(new Date()) + " SimpleConsumer Message Received: "
+ message);
             try {
                 String id = message.getJMSMessageID();
                 assertNull("Message is duplicate: " + id, msgs.get(id));

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
Wed Apr 26 15:33:48 2006
@@ -111,7 +111,7 @@
                     for (int i = 0;i < firstBatch;i++) {
                         Message msg = consumer.receive(RECEIVE_TIMEOUT);
                         if (msg != null) {
-                            //System.out.println("GOT: " + msg);
+                            //log.info("GOT: " + msg);
                             messagesReceived.incrementAndGet();
                         }
                     }
@@ -122,7 +122,7 @@
                     Thread.sleep(2000);
                     for (int i = firstBatch;i < MESSAGE_COUNT;i++) {
                         Message msg = consumer.receive(RECEIVE_TIMEOUT);
-                        //System.out.println("GOT: " + msg);
+                        //log.info("GOT: " + msg);
                         if (msg != null) {
                             messagesReceived.incrementAndGet();
                         }

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java
Wed Apr 26 15:33:48 2006
@@ -16,11 +16,8 @@
  */
 package org.apache.activemq.usecases;
 
-import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
-import junit.framework.TestCase;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.command.ActiveMQTopic;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -31,8 +28,15 @@
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
 
 /**
@@ -42,6 +46,7 @@
  * @version $Revision: 1.1 $
  */
 public final class TransactionRollbackOrderTest extends TestCase {
+    private static final Log log = LogFactory.getLog(TransactionRollbackOrderTest.class);
 
     private volatile String receivedText;
 
@@ -87,17 +92,17 @@
                         msgRedelivered.add(receivedText);
                     }
 
-                    System.out.println("consumer received message: " + receivedText + (tm.getJMSRedelivered()
? " ** Redelivered **" : ""));
+                    log.info("consumer received message: " + receivedText + (tm.getJMSRedelivered()
? " ** Redelivered **" : ""));
                     if (msgCount == 3) {
                         msgRolledBack.add(receivedText);
                         consumerSession.rollback();
-                        System.out.println("[msg: " + receivedText + "] ** rolled back **");
+                        log.info("[msg: " + receivedText + "] ** rolled back **");
                     }
                     else {
                         msgCommittedCount++;
                         msgCommitted.add(receivedText);
                         consumerSession.commit();
-                        System.out.println("[msg: " + receivedText + "] committed transaction
");
+                        log.info("[msg: " + receivedText + "] committed transaction ");
                     }
                     if (msgCommittedCount == NUM_MESSAGES) {
                         latch.countDown();
@@ -106,13 +111,13 @@
                 catch (JMSException e) {
                     try {
                         consumerSession.rollback();
-                        System.out.println("rolled back transaction");
+                        log.info("rolled back transaction");
                     }
                     catch (JMSException e1) {
-                        System.out.println(e1);
+                        log.info(e1);
                         e1.printStackTrace();
                     }
-                    System.out.println(e);
+                    log.info(e);
                     e.printStackTrace();
                 }
             }
@@ -126,21 +131,21 @@
                 tm.setText("Hello " + i);
                 msgSent.add(tm.getText());
                 producer.send(tm);
-                System.out.println("producer sent message: " + tm.getText());
+                log.info("producer sent message: " + tm.getText());
             }
         }
         catch (JMSException e) {
             e.printStackTrace();
         }
 
-        System.out.println("Waiting for latch");
+        log.info("Waiting for latch");
         latch.await();
 
         assertEquals(1, msgRolledBack.size());
         assertEquals(1, msgRedelivered.size());
 
-        System.out.println("msg RolledBack = " + msgRolledBack.get(0));
-        System.out.println("msg Redelivered = " + msgRedelivered.get(0));
+        log.info("msg RolledBack = " + msgRolledBack.get(0));
+        log.info("msg Redelivered = " + msgRedelivered.get(0));
 
         assertEquals(msgRolledBack.get(0), msgRedelivered.get(0));
 
@@ -153,7 +158,7 @@
 
     protected void tearDown() throws Exception {
         if (connection != null) {
-            System.out.println("Closing the connection");
+            log.info("Closing the connection");
             connection.close();
         }
         super.tearDown();

Modified: incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionTest.java?rev=397324&r1=397323&r2=397324&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionTest.java
(original)
+++ incubator/activemq/trunk/assembly/src/test/java/org/apache/activemq/usecases/TransactionTest.java
Wed Apr 26 15:33:48 2006
@@ -16,9 +16,7 @@
  */
 package org.apache.activemq.usecases;
 
-import junit.framework.TestCase;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.command.ActiveMQQueue;
+import java.util.Date;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -29,7 +27,13 @@
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-import java.util.Date;
+
+import junit.framework.TestCase;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
@@ -38,6 +42,8 @@
  * @version $Revision: 1.1.1.1 $
  */
 public final class TransactionTest extends TestCase {
+    
+    private static final Log log = LogFactory.getLog(TransactionTest.class);
 
     private volatile String receivedText;
 
@@ -70,20 +76,20 @@
                     receivedText = tm.getText();
                     latch.countDown();
 
-                    System.out.println("consumer received message :" + receivedText);
+                    log.info("consumer received message :" + receivedText);
                     consumerSession.commit();
-                    System.out.println("committed transaction");
+                    log.info("committed transaction");
                 }
                 catch (JMSException e) {
                     try {
                         consumerSession.rollback();
-                        System.out.println("rolled back transaction");
+                        log.info("rolled back transaction");
                     }
                     catch (JMSException e1) {
-                        System.out.println(e1);
+                        log.info(e1);
                         e1.printStackTrace();
                     }
-                    System.out.println(e);
+                    log.info(e);
                     e.printStackTrace();
                 }
             }
@@ -96,16 +102,16 @@
             tm = producerSession.createTextMessage();
             tm.setText("Hello, " + new Date());
             producer.send(tm);
-            System.out.println("producer sent message :" + tm.getText());
+            log.info("producer sent message :" + tm.getText());
         }
         catch (JMSException e) {
             e.printStackTrace();
         }
 
-        System.out.println("Waiting for latch");
+        log.info("Waiting for latch");
         latch.await();
 
-        System.out.println("test completed, destination=" + receivedText);
+        log.info("test completed, destination=" + receivedText);
     }
 
     protected void tearDown() throws Exception {



Mime
View raw message