From 0873f1ec5c331d35258d3fc30f574aecce32bf29 Mon Sep 17 00:00:00 2001 From: Aidan Skinner Date: Fri, 22 May 2009 16:25:04 +0000 Subject: Use alert level in the config file, don't try to set one (since that won't always work. *sigh*). Need a test-config really. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@777601 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/server/AlertingTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'qpid/java') 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 3befc8d327..57d881d88c 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 @@ -46,6 +46,7 @@ public class AlertingTest extends QpidTestCase private MessageConsumer _consumer; // Never read, but does need to be here to create the destination. private File _logfile; private XMLConfiguration _configuration; + private int _numMessages; public void setUp() throws Exception { @@ -63,12 +64,13 @@ public class AlertingTest extends QpidTestCase } _configuration.setProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".store.class", storeClass.getName()); - _configuration.setProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount", 2); + _numMessages = 5000; File tmpFile = File.createTempFile("configFile", "test"); tmpFile.deleteOnExit(); _configuration.save(tmpFile); _configFile = tmpFile; + if (_outputFile != null) { @@ -82,7 +84,7 @@ public class AlertingTest extends QpidTestCase appender.setFile(_logfile.getAbsolutePath()); appender.setImmediateFlush(true); Logger.getRootLogger().addAppender(appender); - _logfile.deleteOnExit(); + //_logfile.deleteOnExit(); } // Then we do the normal setup stuff like starting the broker, getting a connection etc. @@ -123,14 +125,14 @@ public class AlertingTest extends QpidTestCase public void testAlertingReallyWorks() throws Exception { // Send 5 messages, make sure that the alert was fired properly. - sendMessage(_session, _destination, 4); + sendMessage(_session, _destination, _numMessages + 1); boolean found = wasAlertFired(); assertTrue("no alert generated in "+_logfile.getAbsolutePath(), found); } public void testAlertingReallyWorksWithRestart() throws Exception { - sendMessage(_session, _destination, 4); + sendMessage(_session, _destination, _numMessages + 1); stopBroker(); (new FileOutputStream(_logfile)).getChannel().truncate(0); startBroker(); -- cgit v1.2.1