diff options
| author | Aidan Skinner <aidan@apache.org> | 2009-05-22 16:25:04 +0000 |
|---|---|---|
| committer | Aidan Skinner <aidan@apache.org> | 2009-05-22 16:25:04 +0000 |
| commit | 0873f1ec5c331d35258d3fc30f574aecce32bf29 (patch) | |
| tree | 24ca356daaad8a13acc71e0a0551f8682d836e39 | |
| parent | 1c186f58e663cd6e4217f9761dd9f63e4e15e6b8 (diff) | |
| download | qpid-python-0873f1ec5c331d35258d3fc30f574aecce32bf29.tar.gz | |
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
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java | 10 |
1 files changed, 6 insertions, 4 deletions
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(); |
