NO-JIRA Removing logs from jms-tests
This commit is contained in:
parent
0abb06322c
commit
796a75c66d
|
@ -782,7 +782,7 @@ public class AcknowledgementTest extends JMSTestCase {
|
||||||
messageReceived = (TextMessage) consumer.receiveNoWait();
|
messageReceived = (TextMessage) consumer.receiveNoWait();
|
||||||
|
|
||||||
if (messageReceived != null) {
|
if (messageReceived != null) {
|
||||||
System.out.println("Message received " + messageReceived.getText());
|
log.debug("Message received " + messageReceived.getText());
|
||||||
}
|
}
|
||||||
Assert.assertNull(messageReceived);
|
Assert.assertNull(messageReceived);
|
||||||
|
|
||||||
|
@ -1316,8 +1316,8 @@ public class AcknowledgementTest extends JMSTestCase {
|
||||||
long time1 = consume(cf1, queue1, messageCount);
|
long time1 = consume(cf1, queue1, messageCount);
|
||||||
long time2 = consume(cf2, queue2, messageCount);
|
long time2 = consume(cf2, queue2, messageCount);
|
||||||
|
|
||||||
log.info("BlockOnAcknowledge=false MessageCount=" + messageCount + " TimeToConsume=" + time1);
|
log.debug("BlockOnAcknowledge=false MessageCount=" + messageCount + " TimeToConsume=" + time1);
|
||||||
log.info("BlockOnAcknowledge=true MessageCount=" + messageCount + " TimeToConsume=" + time2);
|
log.debug("BlockOnAcknowledge=true MessageCount=" + messageCount + " TimeToConsume=" + time2);
|
||||||
|
|
||||||
Assert.assertTrue(time1 < (time2 / 2));
|
Assert.assertTrue(time1 < (time2 / 2));
|
||||||
|
|
||||||
|
|
|
@ -101,12 +101,12 @@ public abstract class ActiveMQServerTestCase {
|
||||||
public TestRule watcher = new TestWatcher() {
|
public TestRule watcher = new TestWatcher() {
|
||||||
@Override
|
@Override
|
||||||
protected void starting(Description description) {
|
protected void starting(Description description) {
|
||||||
log.info(String.format("#*#*# Starting test: %s()...", description.getMethodName()));
|
log.debug(String.format("#*#*# Starting test: %s()...", description.getMethodName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void finished(Description description) {
|
protected void finished(Description description) {
|
||||||
log.info(String.format("#*#*# Finished test: %s()...", description.getMethodName()));
|
log.debug(String.format("#*#*# Finished test: %s()...", description.getMethodName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class AutoAckMessageListenerTest extends JMSTestCase {
|
||||||
consumer.setMessageListener(listener);
|
consumer.setMessageListener(listener);
|
||||||
|
|
||||||
// create and send messages
|
// create and send messages
|
||||||
log.info("Send and receive two message");
|
log.debug("Send and receive two message");
|
||||||
Message messageSent = session.createMessage();
|
Message messageSent = session.createMessage();
|
||||||
messageSent.setBooleanProperty("last", false);
|
messageSent.setBooleanProperty("last", false);
|
||||||
producer.send(messageSent);
|
producer.send(messageSent);
|
||||||
|
@ -67,7 +67,7 @@ public class AutoAckMessageListenerTest extends JMSTestCase {
|
||||||
conn.start();
|
conn.start();
|
||||||
|
|
||||||
// wait until message is received
|
// 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);
|
latch.await(10, TimeUnit.SECONDS);
|
||||||
|
|
||||||
// check message listener status
|
// check message listener status
|
||||||
|
@ -112,20 +112,20 @@ public class AutoAckMessageListenerTest extends JMSTestCase {
|
||||||
public void onMessage(Message message) {
|
public void onMessage(Message message) {
|
||||||
try {
|
try {
|
||||||
if (message.getBooleanProperty("last") == false) {
|
if (message.getBooleanProperty("last") == false) {
|
||||||
log.info("Received first message.");
|
log.debug("Received first message.");
|
||||||
if (message.getJMSRedelivered() == true) {
|
if (message.getJMSRedelivered() == true) {
|
||||||
// should not re-receive this one
|
// should not re-receive this one
|
||||||
log.info("Error: received first message twice");
|
log.debug("Error: received first message twice");
|
||||||
passed = false;
|
passed = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (message.getJMSRedelivered() == false) {
|
if (message.getJMSRedelivered() == false) {
|
||||||
// received second message for first time
|
// received second message for first time
|
||||||
log.info("Received second message. Calling recover()");
|
log.debug("Received second message. Calling recover()");
|
||||||
session.recover();
|
session.recover();
|
||||||
} else {
|
} else {
|
||||||
// should be redelivered after recover
|
// should be redelivered after recover
|
||||||
log.info("Received second message again as expected");
|
log.debug("Received second message again as expected");
|
||||||
passed = true;
|
passed = true;
|
||||||
monitor.countDown();
|
monitor.countDown();
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,10 +171,10 @@ public class TransactedSessionTest extends JMSTestCase {
|
||||||
MessageConsumer consumer = sess.createConsumer(ActiveMQServerTestCase.topic1);
|
MessageConsumer consumer = sess.createConsumer(ActiveMQServerTestCase.topic1);
|
||||||
conn.start();
|
conn.start();
|
||||||
|
|
||||||
log.info("sending message first time");
|
log.debug("sending message first time");
|
||||||
TextMessage mSent = sess.createTextMessage("igloo");
|
TextMessage mSent = sess.createTextMessage("igloo");
|
||||||
producer.send(mSent);
|
producer.send(mSent);
|
||||||
log.info("sent message first time");
|
log.debug("sent message first time");
|
||||||
|
|
||||||
sess.commit();
|
sess.commit();
|
||||||
|
|
||||||
|
@ -183,10 +183,10 @@ public class TransactedSessionTest extends JMSTestCase {
|
||||||
|
|
||||||
sess.commit();
|
sess.commit();
|
||||||
|
|
||||||
log.info("sending message again");
|
log.debug("sending message again");
|
||||||
mSent.setText("rollback");
|
mSent.setText("rollback");
|
||||||
producer.send(mSent);
|
producer.send(mSent);
|
||||||
log.info("sent message again");
|
log.debug("sent message again");
|
||||||
|
|
||||||
sess.commit();
|
sess.commit();
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class SelectorTest extends ActiveMQServerTestCase {
|
||||||
prod.send(redMessage);
|
prod.send(redMessage);
|
||||||
prod.send(blueMessage);
|
prod.send(blueMessage);
|
||||||
|
|
||||||
log.info("sent message");
|
log.debug("sent message");
|
||||||
|
|
||||||
Message rec = redConsumer.receive();
|
Message rec = redConsumer.receive();
|
||||||
ProxyAssertSupport.assertEquals(redMessage.getJMSMessageID(), rec.getJMSMessageID());
|
ProxyAssertSupport.assertEquals(redMessage.getJMSMessageID(), rec.getJMSMessageID());
|
||||||
|
@ -84,7 +84,7 @@ public class SelectorTest extends ActiveMQServerTestCase {
|
||||||
|
|
||||||
redConsumer.close();
|
redConsumer.close();
|
||||||
|
|
||||||
log.info("closed first consumer");
|
log.debug("closed first consumer");
|
||||||
|
|
||||||
MessageConsumer universalConsumer = session.createConsumer(queue1);
|
MessageConsumer universalConsumer = session.createConsumer(queue1);
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ public class SelectorTest extends ActiveMQServerTestCase {
|
||||||
|
|
||||||
ProxyAssertSupport.assertEquals("john", m.getStringProperty("beatle"));
|
ProxyAssertSupport.assertEquals("john", m.getStringProperty("beatle"));
|
||||||
|
|
||||||
log.info("Got message " + j);
|
log.debug("Got message " + j);
|
||||||
}
|
}
|
||||||
|
|
||||||
Message m = cons1.receiveNoWait();
|
Message m = cons1.receiveNoWait();
|
||||||
|
@ -902,38 +902,38 @@ public class SelectorTest extends ActiveMQServerTestCase {
|
||||||
tm.setText("1");
|
tm.setText("1");
|
||||||
tm.setStringProperty("PROP1", "VALUE1");
|
tm.setStringProperty("PROP1", "VALUE1");
|
||||||
msgProducer.send(tm);
|
msgProducer.send(tm);
|
||||||
System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]");
|
log.debug("Sent message with id [" + tm.getJMSMessageID() + "]");
|
||||||
|
|
||||||
tm = session.createTextMessage();
|
tm = session.createTextMessage();
|
||||||
tm.setText("2");
|
tm.setText("2");
|
||||||
tm.setStringProperty("PROP1", "VALUE1");
|
tm.setStringProperty("PROP1", "VALUE1");
|
||||||
msgProducer.send(tm);
|
msgProducer.send(tm);
|
||||||
System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]");
|
log.debug("Sent message with id [" + tm.getJMSMessageID() + "]");
|
||||||
|
|
||||||
tm = session.createTextMessage();
|
tm = session.createTextMessage();
|
||||||
tm.setText("3");
|
tm.setText("3");
|
||||||
tm.setStringProperty("PROP2", "VALUE2");
|
tm.setStringProperty("PROP2", "VALUE2");
|
||||||
msgProducer.send(tm);
|
msgProducer.send(tm);
|
||||||
System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]");
|
log.debug("Sent message with id [" + tm.getJMSMessageID() + "]");
|
||||||
|
|
||||||
tm = session.createTextMessage();
|
tm = session.createTextMessage();
|
||||||
tm.setText("4");
|
tm.setText("4");
|
||||||
tm.setStringProperty("PROP2", "VALUE2");
|
tm.setStringProperty("PROP2", "VALUE2");
|
||||||
msgProducer.send(tm);
|
msgProducer.send(tm);
|
||||||
System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]");
|
log.debug("Sent message with id [" + tm.getJMSMessageID() + "]");
|
||||||
|
|
||||||
tm = session.createTextMessage();
|
tm = session.createTextMessage();
|
||||||
tm.setText("5");
|
tm.setText("5");
|
||||||
tm.setStringProperty("PROP1", "VALUE1");
|
tm.setStringProperty("PROP1", "VALUE1");
|
||||||
msgProducer.send(tm);
|
msgProducer.send(tm);
|
||||||
System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]");
|
log.debug("Sent message with id [" + tm.getJMSMessageID() + "]");
|
||||||
|
|
||||||
tm = session.createTextMessage();
|
tm = session.createTextMessage();
|
||||||
tm.setText("6");
|
tm.setText("6");
|
||||||
tm.setStringProperty("PROP1", "VALUE1");
|
tm.setStringProperty("PROP1", "VALUE1");
|
||||||
tm.setStringProperty("PROP2", "VALUE2");
|
tm.setStringProperty("PROP2", "VALUE2");
|
||||||
msgProducer.send(tm);
|
msgProducer.send(tm);
|
||||||
System.out.println("Sent message with id [" + tm.getJMSMessageID() + "]");
|
log.debug("Sent message with id [" + tm.getJMSMessageID() + "]");
|
||||||
msgProducer.close();
|
msgProducer.close();
|
||||||
msgProducer = null;
|
msgProducer = null;
|
||||||
|
|
||||||
|
|
|
@ -93,14 +93,14 @@ public class ServerManagement {
|
||||||
" has not been created or has already been killed, so it cannot be killed");
|
" has not been created or has already been killed, so it cannot be killed");
|
||||||
} else {
|
} else {
|
||||||
Server server = ServerManagement.servers.get(i);
|
Server server = ServerManagement.servers.get(i);
|
||||||
ServerManagement.log.info("invoking kill() on server " + i);
|
ServerManagement.log.debug("invoking kill() on server " + i);
|
||||||
try {
|
try {
|
||||||
server.kill();
|
server.kill();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
// This is likely to throw an exception since the server dies before the response is received
|
// 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 {
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -114,7 +114,7 @@ public class ServerManagement {
|
||||||
|
|
||||||
Thread.sleep(300);
|
Thread.sleep(300);
|
||||||
|
|
||||||
ServerManagement.log.info("server " + i + " killed and dead");
|
ServerManagement.log.debug("server " + i + " killed and dead");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue