diff options
| author | Aidan Skinner <aidan@apache.org> | 2008-08-21 13:53:28 +0000 |
|---|---|---|
| committer | Aidan Skinner <aidan@apache.org> | 2008-08-21 13:53:28 +0000 |
| commit | a4d8ef3830256d748134b60247da34ae6368bf20 (patch) | |
| tree | f32361757a818d696d7e8c7cdad4e12a89d00ea8 /java/broker/src/test | |
| parent | eaa4edf9e8a4639aea35fe741830036e10122393 (diff) | |
| download | qpid-python-a4d8ef3830256d748134b60247da34ae6368bf20.tar.gz | |
QPID-1167: reset queue notification lists when creating queues. Pull out defaults centrally.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@687764 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src/test')
| -rw-r--r-- | java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java b/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java index 5eafc18378..0ada9cefee 100644 --- a/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java +++ b/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java @@ -40,6 +40,7 @@ import org.apache.qpid.framing.ContentHeaderBody; import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.framing.abstraction.MessagePublishInfo; import org.apache.qpid.framing.abstraction.ContentChunk; +import org.apache.commons.configuration.CompositeConfiguration; import org.apache.mina.common.ByteBuffer; import javax.management.Notification; @@ -47,6 +48,7 @@ import javax.management.Notification; import java.util.ArrayList; import java.util.LinkedList; import java.util.Collections; +import java.util.Set; /** This class tests all the alerts an AMQQueue can throw based on threshold values of different parameters */ public class AMQQueueAlertTest extends TestCase @@ -251,6 +253,26 @@ public class AMQQueueAlertTest extends TestCase assertEquals(new Long(0), new Long(_queueMBean.getQueueDepth())); } + public void testAlertConfiguration() throws AMQException + { + // Setup configuration + CompositeConfiguration config = new CompositeConfiguration(); + config.setProperty("maximumMessageSize", new Long(23)); + config.setProperty("maximumMessageCount", new Long(24)); + config.setProperty("maximumQueueDepth", new Long(25)); + config.setProperty("maximumMessageAge", new Long(26)); + + // Create queue and set config + _queue = getNewQueue(); + _queue.configure(config); + + // Check alerts and notifications + Set<NotificationCheck> checks = _queue.getNotificationChecks(); + assertNotNull("No checks found", checks); + assertFalse("Checks should not be empty", checks.isEmpty()); + assertEquals("Wrong number of checks", 4, checks.size()); + } + protected IncomingMessage message(final boolean immediate, long size) throws AMQException { MessagePublishInfo publish = new MessagePublishInfo() |
