Fix AutoDeleteJmsQueueTest

This commit is contained in:
jbertram 2016-05-04 15:26:59 -05:00
parent 89a0ffe1b2
commit 500a734d04
3 changed files with 27 additions and 3 deletions

View File

@ -483,7 +483,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
public void runException() throws Exception {
checkBindings(bindings);
if (internalCreateQueue(queueName, selectorString, durable)) {
if (internalCreateQueue(queueName, selectorString, durable, autoCreated)) {
ActiveMQDestination destination = queues.get(queueName);
if (destination == null) {
@ -1047,6 +1047,13 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
private synchronized boolean internalCreateQueue(final String queueName,
final String selectorString,
final boolean durable) throws Exception {
return internalCreateQueue(queueName, selectorString, durable, false);
}
private synchronized boolean internalCreateQueue(final String queueName,
final String selectorString,
final boolean durable,
final boolean autoCreated) throws Exception {
if (queues.get(queueName) != null) {
return false;
}
@ -1060,7 +1067,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
coreFilterString = SelectorTranslator.convertToActiveMQFilterString(selectorString);
}
Queue queue = server.deployQueue(SimpleString.toSimpleString(activeMQQueue.getAddress()), SimpleString.toSimpleString(activeMQQueue.getAddress()), SimpleString.toSimpleString(coreFilterString), durable, false);
Queue queue = server.deployQueue(SimpleString.toSimpleString(activeMQQueue.getAddress()), SimpleString.toSimpleString(activeMQQueue.getAddress()), SimpleString.toSimpleString(coreFilterString), durable, false, autoCreated);
queues.put(queueName, activeMQQueue);

View File

@ -254,6 +254,13 @@ public interface ActiveMQServer extends ActiveMQComponent {
boolean durable,
boolean temporary) throws Exception;
Queue deployQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temporary,
boolean autoCreated) throws Exception;
Queue locateQueue(SimpleString queueName);
BindingQueryResult bindingQuery(SimpleString address) throws Exception;

View File

@ -1406,6 +1406,16 @@ public class ActiveMQServerImpl implements ActiveMQServer {
final SimpleString filterString,
final boolean durable,
final boolean temporary) throws Exception {
return deployQueue(address, resourceName, filterString, durable, temporary, false);
}
@Override
public Queue deployQueue(final SimpleString address,
final SimpleString resourceName,
final SimpleString filterString,
final boolean durable,
final boolean temporary,
final boolean autoCreated) throws Exception {
if (resourceName.toString().toLowerCase().startsWith("jms.topic")) {
ActiveMQServerLogger.LOGGER.deployTopic(resourceName);
@ -1414,7 +1424,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
ActiveMQServerLogger.LOGGER.deployQueue(resourceName);
}
return createQueue(address, resourceName, filterString, null, durable, temporary, true, false, false);
return createQueue(address, resourceName, filterString, null, durable, temporary, true, false, autoCreated);
}
@Override