From 00a1996273b13d5a74f965f2e00bb1ea37828fd4 Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Wed, 30 Sep 2009 15:54:13 +0000 Subject: Update QTC to allow the setting of debug logging for the external broker process. Update BrokerStartupTest to ensure that these values are set to the default info as the test looks for the existence of DEBUG messages as a sign of failure. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@820315 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/server/BrokerStartupTest.java | 7 +++++++ .../org/apache/qpid/test/utils/QpidTestCase.java | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'qpid/java') diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java index 52120019f5..adb24ac9d0 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java @@ -88,6 +88,13 @@ public class BrokerStartupTest extends AbstractTestLogging Logger.getLogger("qpid.protocol").setLevel(Level.WARN); Logger.getLogger("org.apache.qpid").setLevel(Level.WARN); + // Set the broker to use info level logging, which is the qpid-server + // default. Rather than debug which is the test default. + setSystemProperty("amqj.server.logging.level","info"); + // Set the logging defaults to info for this test. + setSystemProperty("amqj.logging.level","info"); + setSystemProperty("root.logging.level","info"); + startBroker(); assertEquals("Log4j could not load desired configruation.", diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java index d2e0f60ec6..78c34f3f5e 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java @@ -467,6 +467,15 @@ public class QpidTestCase extends TestCase env.put("QPID_PNAME", "-DPNAME=QPBRKR -DTNAME=\"" + _testName + "\""); env.put("QPID_WORK", System.getProperty("QPID_WORK")); + + // Use the environment variable to set amqj.logging.level for the broker + // The value used is a 'server' value in the test configuration to + // allow a differentiation between the client and broker logging levels. + if (System.getProperty("amqj.server.logging.level") != null) + { + setBrokerEnvironment("AMQJ_LOGGING_LEVEL", System.getProperty("amqj.server.logging.level")); + } + // Add all the environment settings the test requested if (!_env.isEmpty()) { @@ -476,6 +485,18 @@ public class QpidTestCase extends TestCase } } + + // Add default test logging levels that are used by the log4j-test + if (System.getProperty("amqj.protocol.logging.level") != null) + { + setSystemProperty("amqj.protocol.logging.level", System.getProperty("amqj.protocol.logging.level")); + } + if (System.getProperty("root.logging.level") != null) + { + setSystemProperty("root.logging.level", System.getProperty("root.logging.level")); + } + + String QPID_OPTS = " "; // Add all the specified system properties to QPID_OPTS if (!_setProperties.isEmpty()) -- cgit v1.2.1