Add more logging to aid in failing test diagnosis.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1483838 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2013-05-17 14:59:08 +00:00
parent 620523a597
commit d2d41805c5
4 changed files with 8 additions and 19 deletions

View File

@ -332,7 +332,7 @@ public abstract class AbstractMQTTTest extends AutoFailTestSupport {
} }
protected void addMQTTConnector(String config) throws Exception { protected void addMQTTConnector(String config) throws Exception {
mqttConnector= brokerService.addConnector(getProtocolScheme()+"://localhost:0" + config); mqttConnector = brokerService.addConnector(getProtocolScheme()+"://localhost:0?trace=true&" + config);
} }
protected void initializeConnection(MQTTClientProvider provider) throws Exception { protected void initializeConnection(MQTTClientProvider provider) throws Exception {

View File

@ -32,7 +32,7 @@ public class MQTTNioTest extends MQTTTest {
@Test @Test
public void testPingOnMQTTNIO() throws Exception { public void testPingOnMQTTNIO() throws Exception {
addMQTTConnector("?maxInactivityDuration=-1"); addMQTTConnector("maxInactivityDuration=-1");
brokerService.start(); brokerService.start();
MQTT mqtt = createMQTTConnection(); MQTT mqtt = createMQTTConnection();
mqtt.setKeepAlive((short)2); mqtt.setKeepAlive((short)2);

View File

@ -51,7 +51,7 @@ public class MQTTTest extends AbstractMQTTTest {
@Test(timeout=300000) @Test(timeout=300000)
public void testTurnOffInactivityMonitor()throws Exception{ public void testTurnOffInactivityMonitor()throws Exception{
addMQTTConnector("?transport.useInactivityMonitor=false"); addMQTTConnector("transport.useInactivityMonitor=false");
brokerService.start(); brokerService.start();
MQTT mqtt = createMQTTConnection(); MQTT mqtt = createMQTTConnection();
mqtt.setKeepAlive((short)2); mqtt.setKeepAlive((short)2);
@ -72,7 +72,7 @@ public class MQTTTest extends AbstractMQTTTest {
@Test(timeout=30000) @Test(timeout=30000)
public void testDefaultKeepAliveWhenClientSpecifiesZero() throws Exception { public void testDefaultKeepAliveWhenClientSpecifiesZero() throws Exception {
// default keep alive in milliseconds // default keep alive in milliseconds
addMQTTConnector("?transport.defaultKeepAlive=2000"); addMQTTConnector("transport.defaultKeepAlive=2000");
brokerService.start(); brokerService.start();
MQTT mqtt = createMQTTConnection(); MQTT mqtt = createMQTTConnection();
mqtt.setKeepAlive((short)0); mqtt.setKeepAlive((short)0);
@ -120,11 +120,6 @@ public class MQTTTest extends AbstractMQTTTest {
addMQTTConnector(""); addMQTTConnector("");
} }
@Override
protected void addMQTTConnector(String config) throws Exception {
mqttConnector = brokerService.addConnector(getProtocolScheme()+"://localhost:0" + config);
}
@Override @Override
protected MQTTClientProvider getMQTTClientProvider() { protected MQTTClientProvider getMQTTClientProvider() {
return new FuseMQQTTClientProvider(); return new FuseMQQTTClientProvider();
@ -145,12 +140,12 @@ public class MQTTTest extends AbstractMQTTTest {
return new Tracer(){ return new Tracer(){
@Override @Override
public void onReceive(MQTTFrame frame) { public void onReceive(MQTTFrame frame) {
LOG.info("recv: "+frame); LOG.info("Client Received:\n"+frame);
} }
@Override @Override
public void onSend(MQTTFrame frame) { public void onSend(MQTTFrame frame) {
LOG.info("send: " + frame); LOG.info("Client Sent:\n" + frame);
} }
@Override @Override

View File

@ -20,18 +20,12 @@
# #
log4j.rootLogger=INFO, out, stdout log4j.rootLogger=INFO, out, stdout
#log4j.logger.org.apache.activemq.network.DemandForwardingBridgeSupport=DEBUG log4j.logger.org.apache.activemq.transport.mqtt=TRACE
#log4j.logger.org.apache.activemq.transport.failover=TRACE
log4j.logger.org.apache.activemq.transport.mqtt=DEBUG
#log4j.logger.org.apache.activemq.store.jdbc=TRACE
#log4j.logger.org.apache.activemq.broker.region.cursors.AbstractStoreCursor=DEBUG
#log4j.logger.org.apache.activemq.store.jdbc.JDBCMessageStore=DEBUG
# CONSOLE appender not used by default # CONSOLE appender not used by default
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %m%n log4j.appender.stdout.layout.ConversionPattern=%d | %-5p | %-30.30c{1} | %m%n
#log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] - %-5p %-30.30c{1} - %-10.10X{activemq.broker} %-20.20X{activemq.connector} %-10.10X{activemq.destination} - %m%n
# File appender # File appender
log4j.appender.out=org.apache.log4j.FileAppender log4j.appender.out=org.apache.log4j.FileAppender