summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2010-09-08 15:41:08 +0000
committerRobert Gemmell <robbie@apache.org>2010-09-08 15:41:08 +0000
commit4d9339fda0491df68b4725a81e712b6c97fc9458 (patch)
treeb1e31b4d6d27b5da1bdef7df4a6d9c9542cea7ff /qpid/java
parent97956f50aefa04dc9a8951e816022b4054ca6296 (diff)
downloadqpid-python-4d9339fda0491df68b4725a81e712b6c97fc9458.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@995103 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java11
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java2
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java2
3 files changed, 14 insertions, 1 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java
index 9c1d302be0..f66ee38139 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AbstractTestLogging.java
+++ b/qpid/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/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
index 66bcc10c50..8fd2c085c3 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
+++ b/qpid/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/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java
index 7ab937b15f..595c0d5f35 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java
+++ b/qpid/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);