You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ai...@apache.org on 2009/05/22 18:25:05 UTC

svn commit: r777601 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java

Author: aidan
Date: Fri May 22 16:25:04 2009
New Revision: 777601

URL: http://svn.apache.org/viewvc?rev=777601&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java?rev=777601&r1=777600&r2=777601&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/AlertingTest.java Fri May 22 16:25:04 2009
@@ -46,6 +46,7 @@
     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 @@
         }
         
         _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 @@
             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 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();



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org