From cff7f8e8b36ee19947171a36a304eaa98dcccf8a Mon Sep 17 00:00:00 2001 From: Aidan Skinner Date: Tue, 26 May 2009 14:41:05 +0000 Subject: Don't delete derby.log. Use virtualhost-systests.xml for testing purpouses. Minor code cleanup in AlertingTest. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@778723 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/java/broker/etc/config-systests.xml | 2 +- qpid/java/broker/etc/virtualhosts-systests.xml | 124 +++++++++++++++++++++ qpid/java/default.testprofile | 2 +- qpid/java/java.testprofile | 2 +- .../java/org/apache/qpid/server/AlertingTest.java | 11 +- 5 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 qpid/java/broker/etc/virtualhosts-systests.xml diff --git a/qpid/java/broker/etc/config-systests.xml b/qpid/java/broker/etc/config-systests.xml index 03543642cc..6aac952fe9 100644 --- a/qpid/java/broker/etc/config-systests.xml +++ b/qpid/java/broker/etc/config-systests.xml @@ -132,7 +132,7 @@ true - ${conf}/virtualhosts.xml + ${conf}/virtualhosts-systests.xml diff --git a/qpid/java/broker/etc/virtualhosts-systests.xml b/qpid/java/broker/etc/virtualhosts-systests.xml new file mode 100644 index 0000000000..4f23f55579 --- /dev/null +++ b/qpid/java/broker/etc/virtualhosts-systests.xml @@ -0,0 +1,124 @@ + + + + test + + localhost + + + + direct + test.direct + true + + + topic + test.topic + + + + amq.direct + 4235264 + 2117632 + 600000 + 50 + + + queue + + + ping + + + test-queue + + test.direct + true + + + + test-ping + + test.direct + + + + + + + + + + development + + + 30000 + 50 + + queue + + amq.direct + 4235264 + 2117632 + 600000 + + + + ping + + amq.direct + 4235264 + 2117632 + 600000 + + + + + + + test + + + 30000 + 50 + + queue + + amq.direct + 4235264 + 2117632 + 600000 + + + + ping + + amq.direct + 4235264 + 2117632 + 600000 + + + + + + diff --git a/qpid/java/default.testprofile b/qpid/java/default.testprofile index 647b1cb177..982a331842 100644 --- a/qpid/java/default.testprofile +++ b/qpid/java/default.testprofile @@ -1,6 +1,6 @@ broker.version=0-8 broker=vm -broker.clean=${project.root}/clean-dir ${build.data} ${project.root}/derbyDB ${project.root}/derby.log +broker.clean=${project.root}/clean-dir ${build.data} ${project.root}/derbyDB broker.ready=Listening on TCP port java.naming.provider.url=${project.root}/test-provider.properties diff --git a/qpid/java/java.testprofile b/qpid/java/java.testprofile index 16d831d02d..d1ec1a0e41 100644 --- a/qpid/java/java.testprofile +++ b/qpid/java/java.testprofile @@ -1,6 +1,6 @@ broker.language=java broker=${project.root}/build/bin/qpid-server -p @PORT -m @MPORT -c @CONFIG_FILE -l ${project.root}/log4j-test.xml -broker.clean=${project.root}/clean-dir ${build.data} ${project.root}/derbyDB ${project.root}/derby.log +broker.clean=${project.root}/clean-dir ${build.data} ${project.root}/derbyDB broker.ready=Qpid Broker Ready test.excludesfile=${project.root}/ExcludeList ${project.root}/XAExcludeList ${project.root}/08ExcludeList-nonvm diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java index 57d881d88c..5552355416 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java @@ -55,16 +55,21 @@ public class AlertingTest extends QpidTestCase _configuration = new XMLConfiguration(_configFile); _configuration.setProperty("management.enabled", "false"); Class storeClass = DerbyMessageStore.class; + Class bdb = null; try { - Class bdb = Class.forName("org.apache.qpid.store.berkleydb.BDBMessageStore"); + bdb = Class.forName("org.apache.qpid.store.berkleydb.BDBMessageStore"); } catch (ClassNotFoundException e) { // No BDB store, we'll use Derby instead. } + if (bdb != null) + { + storeClass = bdb; + } _configuration.setProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".store.class", storeClass.getName()); - _numMessages = 5000; + _numMessages = 50; File tmpFile = File.createTempFile("configFile", "test"); tmpFile.deleteOnExit(); @@ -105,14 +110,12 @@ public class AlertingTest extends QpidTestCase // just in case the logfile takes a while to flush. BufferedReader reader = new BufferedReader(new FileReader(_logfile)); boolean found = false; - int lineCount = 0; long endtime = System.currentTimeMillis()+5000; while (!found && System.currentTimeMillis() < endtime) { while (reader.ready()) { String line = reader.readLine(); - lineCount++; if (line.contains("MESSAGE_COUNT_ALERT")) { found = true; -- cgit v1.2.1