From fdba1a9ed5074286fe58ebf9be543bbebea0bb79 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/qpid@778723 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/server/AlertingTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'java/systests/src') diff --git a/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java b/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java index 57d881d88c..5552355416 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java +++ b/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