summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan Skinner <aidan@apache.org>2009-05-26 14:41:05 +0000
committerAidan Skinner <aidan@apache.org>2009-05-26 14:41:05 +0000
commitcff7f8e8b36ee19947171a36a304eaa98dcccf8a (patch)
tree17dfde7c706f6b7bfee347d0444ce0ed580e6c1f
parent51e4486d1ec5f1a1da44d580cbc2a90bdca16d00 (diff)
downloadqpid-python-cff7f8e8b36ee19947171a36a304eaa98dcccf8a.tar.gz
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
-rw-r--r--qpid/java/broker/etc/config-systests.xml2
-rw-r--r--qpid/java/broker/etc/virtualhosts-systests.xml124
-rw-r--r--qpid/java/default.testprofile2
-rw-r--r--qpid/java/java.testprofile2
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java11
5 files changed, 134 insertions, 7 deletions
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 @@
<auto_register>true</auto_register>
</queue>
- <virtualhosts>${conf}/virtualhosts.xml</virtualhosts>
+ <virtualhosts>${conf}/virtualhosts-systests.xml</virtualhosts>
</broker>
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 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<virtualhosts>
+ <default>test</default>
+ <virtualhost>
+ <name>localhost</name>
+ <localhost>
+ <exchanges>
+ <exchange>
+ <type>direct</type>
+ <name>test.direct</name>
+ <durable>true</durable>
+ </exchange>
+ <exchange>
+ <type>topic</type>
+ <name>test.topic</name>
+ </exchange>
+ </exchanges>
+ <queues>
+ <exchange>amq.direct</exchange>
+ <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
+ <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
+ <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
+ <maximumMessageCount>50</maximumMessageCount> <!-- 50 messages -->
+
+ <queue>
+ <name>queue</name>
+ </queue>
+ <queue>
+ <name>ping</name>
+ </queue>
+ <queue>
+ <name>test-queue</name>
+ <test-queue>
+ <exchange>test.direct</exchange>
+ <durable>true</durable>
+ </test-queue>
+ </queue>
+ <queue>
+ <name>test-ping</name>
+ <test-ping>
+ <exchange>test.direct</exchange>
+ </test-ping>
+ </queue>
+
+ </queues>
+ </localhost>
+ </virtualhost>
+
+
+ <virtualhost>
+ <name>development</name>
+ <development>
+ <queues>
+ <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
+ <maximumMessageCount>50</maximumMessageCount>
+ <queue>
+ <name>queue</name>
+ <queue>
+ <exchange>amq.direct</exchange>
+ <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
+ <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
+ <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
+ </queue>
+ </queue>
+ <queue>
+ <name>ping</name>
+ <ping>
+ <exchange>amq.direct</exchange>
+ <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
+ <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
+ <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
+ </ping>
+ </queue>
+ </queues>
+ </development>
+ </virtualhost>
+ <virtualhost>
+ <name>test</name>
+ <test>
+ <queues>
+ <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
+ <maximumMessageCount>50</maximumMessageCount>
+ <queue>
+ <name>queue</name>
+ <queue>
+ <exchange>amq.direct</exchange>
+ <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
+ <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
+ <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
+ </queue>
+ </queue>
+ <queue>
+ <name>ping</name>
+ <ping>
+ <exchange>amq.direct</exchange>
+ <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
+ <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
+ <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
+ </ping>
+ </queue>
+ </queues>
+ </test>
+ </virtualhost>
+</virtualhosts>
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;