From 796a75c66da4c3d87d0cfceef56012527fbf2273 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Thu, 23 Apr 2020 18:24:24 -0400 Subject: [PATCH] NO-JIRA Removing logs from jms-tests --- .../artemis/jms/tests/AcknowledgementTest.java | 6 +++--- .../jms/tests/ActiveMQServerTestCase.java | 4 ++-- .../jms/tests/AutoAckMessageListenerTest.java | 12 ++++++------ .../jms/tests/TransactedSessionTest.java | 8 ++++---- .../jms/tests/selector/SelectorTest.java | 18 +++++++++--------- .../jms/tests/tools/ServerManagement.java | 6 +++--- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AcknowledgementTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AcknowledgementTest.java index 82fd7db0c2..972b4bce68 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AcknowledgementTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AcknowledgementTest.java @@ -782,7 +782,7 @@ public class AcknowledgementTest extends JMSTestCase { messageReceived = (TextMessage) consumer.receiveNoWait(); if (messageReceived != null) { - System.out.println("Message received " + messageReceived.getText()); + log.debug("Message received " + messageReceived.getText()); } Assert.assertNull(messageReceived); @@ -1316,8 +1316,8 @@ public class AcknowledgementTest extends JMSTestCase { long time1 = consume(cf1, queue1, messageCount); long time2 = consume(cf2, queue2, messageCount); - log.info("BlockOnAcknowledge=false MessageCount=" + messageCount + " TimeToConsume=" + time1); - log.info("BlockOnAcknowledge=true MessageCount=" + messageCount + " TimeToConsume=" + time2); + log.debug("BlockOnAcknowledge=false MessageCount=" + messageCount + " TimeToConsume=" + time1); + log.debug("BlockOnAcknowledge=true MessageCount=" + messageCount + " TimeToConsume=" + time2); Assert.assertTrue(time1 < (time2 / 2)); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java index e7a7910466..990c0e396d 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java @@ -101,12 +101,12 @@ public abstract class ActiveMQServerTestCase { public TestRule watcher = new TestWatcher() { @Override protected void starting(Description description) { - log.info(String.format("#*#*# Starting test: %s()...", description.getMethodName())); + log.debug(String.format("#*#*# Starting test: %s()...", description.getMethodName())); } @Override protected void finished(Description description) { - log.info(String.format("#*#*# Finished test: %s()...", description.getMethodName())); + log.debug(String.format("#*#*# Finished test: %s()...", description.getMethodName())); } @Override diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AutoAckMessageListenerTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AutoAckMessageListenerTest.java index b667c58c3e..a3285bc092 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AutoAckMessageListenerTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/AutoAckMessageListenerTest.java @@ -57,7 +57,7 @@ public class AutoAckMessageListenerTest extends JMSTestCase { consumer.setMessageListener(listener); // create and send messages - log.info("Send and receive two message"); + log.debug("Send and receive two message"); Message messageSent = session.createMessage(); messageSent.setBooleanProperty("last", false); producer.send(messageSent); @@ -67,7 +67,7 @@ public class AutoAckMessageListenerTest extends JMSTestCase { conn.start(); // wait until message is received - log.info("waiting until message has been received by message listener..."); + log.debug("waiting until message has been received by message listener..."); latch.await(10, TimeUnit.SECONDS); // check message listener status @@ -112,20 +112,20 @@ public class AutoAckMessageListenerTest extends JMSTestCase { public void onMessage(Message message) { try { if (message.getBooleanProperty("last") == false) { - log.info("Received first message."); + log.debug("Received first message."); if (message.getJMSRedelivered() == true) { // should not re-receive this one - log.info("Error: received first message twice"); + log.debug("Error: received first message twice"); passed = false; } } else { if (message.getJMSRedelivered() == false) { // received second message for first time - log.info("Received second message. Calling recover()"); + log.debug("Received second message. Calling recover()"); session.recover(); } else { // should be redelivered after recover - log.info("Received second message again as expected"); + log.debug("Received second message again as expected"); passed = true; monitor.countDown(); } diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TransactedSessionTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TransactedSessionTest.java index b7cd5991d3..fad600c96a 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TransactedSessionTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TransactedSessionTest.java @@ -171,10 +171,10 @@ public class TransactedSessionTest extends JMSTestCase { MessageConsumer consumer = sess.createConsumer(ActiveMQServerTestCase.topic1); conn.start(); - log.info("sending message first time"); + log.debug("sending message first time"); TextMessage mSent = sess.createTextMessage("igloo"); producer.send(mSent); - log.info("sent message first time"); + log.debug("sent message first time"); sess.commit(); @@ -183,10 +183,10 @@ public class TransactedSessionTest extends JMSTestCase { sess.commit(); - log.info("sending message again"); + log.debug("sending message again"); mSent.setText("rollback"); producer.send(mSent); - log.info("sent message again"); + log.debug("sent message again"); sess.commit(); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java index 530abf98d9..1b2a60f368 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/selector/SelectorTest.java @@ -74,7 +74,7 @@ public class SelectorTest extends ActiveMQServerTestCase { prod.send(redMessage); prod.send(blueMessage); - log.info("sent message"); + log.debug("sent message"); Message rec = redConsumer.receive(); ProxyAssertSupport.assertEquals(redMessage.getJMSMessageID(), rec.getJMSMessageID()); @@ -84,7 +84,7 @@ public class SelectorTest extends ActiveMQServerTestCase { redConsumer.close(); - log.info("closed first consumer"); + log.debug("closed first consumer"); MessageConsumer universalConsumer = session.createConsumer(queue1); @@ -191,7 +191,7 @@ public class SelectorTest extends ActiveMQServerTestCase { ProxyAssertSupport.assertEquals("john", m.getStringProperty("beatle")); - log.info("Got message " + j); + log.debug("Got message " + j); } Message m = cons1.receiveNoWait(); @@ -902,38 +902,38 @@ public class SelectorTest extends ActiveMQServerTestCase { tm.setText("1"); tm.setStringProperty("PROP1", "VALUE1"); msgProducer.send(tm); - System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]"); + log.debug("Sent message with id [" + tm.getJMSMessageID() + "]"); tm = session.createTextMessage(); tm.setText("2"); tm.setStringProperty("PROP1", "VALUE1"); msgProducer.send(tm); - System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]"); + log.debug("Sent message with id [" + tm.getJMSMessageID() + "]"); tm = session.createTextMessage(); tm.setText("3"); tm.setStringProperty("PROP2", "VALUE2"); msgProducer.send(tm); - System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]"); + log.debug("Sent message with id [" + tm.getJMSMessageID() + "]"); tm = session.createTextMessage(); tm.setText("4"); tm.setStringProperty("PROP2", "VALUE2"); msgProducer.send(tm); - System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]"); + log.debug("Sent message with id [" + tm.getJMSMessageID() + "]"); tm = session.createTextMessage(); tm.setText("5"); tm.setStringProperty("PROP1", "VALUE1"); msgProducer.send(tm); - System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]"); + log.debug("Sent message with id [" + tm.getJMSMessageID() + "]"); tm = session.createTextMessage(); tm.setText("6"); tm.setStringProperty("PROP1", "VALUE1"); tm.setStringProperty("PROP2", "VALUE2"); msgProducer.send(tm); - System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]"); + log.debug("Sent message with id [" + tm.getJMSMessageID() + "]"); msgProducer.close(); msgProducer = null; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/ServerManagement.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/ServerManagement.java index ae41ea6f92..8abefa756a 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/ServerManagement.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/ServerManagement.java @@ -93,14 +93,14 @@ public class ServerManagement { " has not been created or has already been killed, so it cannot be killed"); } else { Server server = ServerManagement.servers.get(i); - ServerManagement.log.info("invoking kill() on server " + i); + ServerManagement.log.debug("invoking kill() on server " + i); try { server.kill(); } catch (Throwable t) { // This is likely to throw an exception since the server dies before the response is received } - ServerManagement.log.info("Waiting for server to die"); + ServerManagement.log.debug("Waiting for server to die"); try { while (true) { @@ -114,7 +114,7 @@ public class ServerManagement { Thread.sleep(300); - ServerManagement.log.info("server " + i + " killed and dead"); + ServerManagement.log.debug("server " + i + " killed and dead"); } }