diff options
| author | Robert Gemmell <robbie@apache.org> | 2010-09-08 15:41:08 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2010-09-08 15:41:08 +0000 |
| commit | 273a36a5951ab881a6778079de36a93e52543223 (patch) | |
| tree | a3e8d78aa319f1dd22888cbc82ce4641e7775774 /java | |
| parent | 22dc237673d9f8e30e0adac31ed8b2d2f54a5495 (diff) | |
| download | qpid-python-273a36a5951ab881a6778079de36a93e52543223.tar.gz | |
QPID-2840: have the tests set a message prefix to facilitate scraping messages from the test output
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@995103 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
3 files changed, 14 insertions, 1 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java b/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java index 9c1d302be0..f66ee38139 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java +++ b/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java @@ -48,6 +48,7 @@ import java.util.List; public class AbstractTestLogging extends QpidBrokerTestCase { public static final long DEFAULT_LOG_WAIT = 2000; + public static final String TEST_LOG_PREFIX = "MESSAGE"; protected LogMonitor _monitor; ServerConfiguration _serverConfiguration; @@ -56,6 +57,8 @@ public class AbstractTestLogging extends QpidBrokerTestCase @Override public void setUp() throws Exception { + setLogMessagePrefix(); + super.setUp(); _monitor = new LogMonitor(_outputFile); @@ -115,6 +118,12 @@ public class AbstractTestLogging extends QpidBrokerTestCase } + protected void setLogMessagePrefix() + { + //set the message prefix to facilitate scraping from the munged test output. + setSystemProperty("qpid.logging.prefix", TEST_LOG_PREFIX); + } + @Override public void tearDown() throws Exception { @@ -324,7 +333,7 @@ public class AbstractTestLogging extends QpidBrokerTestCase */ protected String getLog(String rawLog) { - int start = rawLog.indexOf("MESSAGE"); + int start = rawLog.indexOf(TEST_LOG_PREFIX); return rawLog.substring(start); } diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java index 66bcc10c50..8fd2c085c3 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java @@ -51,6 +51,8 @@ public class BrokerLoggingTest extends AbstractTestLogging public void setUp() throws Exception { + setLogMessagePrefix(); + // We either do this here or have a null check in tearDown. // As when this test is run against profiles other than java it will NPE _monitor = new LogMonitor(_outputFile); diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java index 7ab937b15f..595c0d5f35 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java @@ -47,6 +47,8 @@ public class ManagementLoggingTest extends AbstractTestLogging public void setUp() throws Exception { + setLogMessagePrefix(); + // We either do this here or have a null check in tearDown. // As when this test is run against profiles other than java it will NPE _monitor = new LogMonitor(_outputFile); |
