git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1361138 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2012-07-13 10:20:46 +00:00
parent 1cd533078a
commit a5bb9bd1d7
1 changed files with 6 additions and 0 deletions

View File

@ -92,8 +92,11 @@ public class AMQ3903Test {
final TemporaryQueue queue = session.createTemporaryQueue(); final TemporaryQueue queue = session.createTemporaryQueue();
final Topic advisoryTopic = AdvisorySupport.getFastProducerAdvisoryTopic((ActiveMQDestination) queue); final Topic advisoryTopic = AdvisorySupport.getFastProducerAdvisoryTopic((ActiveMQDestination) queue);
final Topic advisoryWhenFullTopic = AdvisorySupport.getFullAdvisoryTopic((ActiveMQDestination) queue);
MessageConsumer advisoryConsumer = session.createConsumer(advisoryTopic); MessageConsumer advisoryConsumer = session.createConsumer(advisoryTopic);
MessageConsumer advisoryWhenFullConsumer = session.createConsumer(advisoryWhenFullTopic);
MessageProducer producer = session.createProducer(genericProducer ? null : queue); MessageProducer producer = session.createProducer(genericProducer ? null : queue);
try { try {
@ -113,6 +116,8 @@ public class AMQ3903Test {
Message advCmsg = advisoryConsumer.receive(4000); Message advCmsg = advisoryConsumer.receive(4000);
assertNotNull(advCmsg); assertNotNull(advCmsg);
advCmsg = advisoryWhenFullConsumer.receive(4000);
assertNotNull(advCmsg);
connection.close(); connection.close();
LOG.debug("Connection closed, destinations should now become inactive."); LOG.debug("Connection closed, destinations should now become inactive.");
@ -125,6 +130,7 @@ public class AMQ3903Test {
PolicyEntry entry = new PolicyEntry(); PolicyEntry entry = new PolicyEntry();
entry.setAdvisoryForFastProducers(true); entry.setAdvisoryForFastProducers(true);
entry.setAdvisoryWhenFull(true);
entry.setMemoryLimit(10000); entry.setMemoryLimit(10000);
PolicyMap map = new PolicyMap(); PolicyMap map = new PolicyMap();
map.setDefaultEntry(entry); map.setDefaultEntry(entry);