Updated Branches: refs/heads/trunk b588d6cb9 -> 8320e66b5
Fixes https://issues.apache.org/jira/browse/AMQ-4704 Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/8320e66b Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/8320e66b Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/8320e66b Branch: refs/heads/trunk Commit: 8320e66b5de42ce797708699bfffa6bb6c1b3fa1 Parents: b588d6c Author: Timothy Bish <[email protected]> Authored: Tue Sep 3 11:50:52 2013 -0400 Committer: Timothy Bish <[email protected]> Committed: Tue Sep 3 11:50:52 2013 -0400 ---------------------------------------------------------------------- .../org/apache/activemq/broker/BrokerService.java | 2 +- .../activemq/transport/stomp/StompTestSupport.java | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/8320e66b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java index 666c4bd..0e75154 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -2738,7 +2738,7 @@ public class BrokerService implements Service { * @return the schedulerSupport */ public boolean isSchedulerSupport() { - return this.schedulerSupport; + return this.schedulerSupport && (isPersistent() || jobSchedulerStore != null); } /** http://git-wip-us.apache.org/repos/asf/activemq/blob/8320e66b/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java ---------------------------------------------------------------------- diff --git a/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java b/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java index ad816a6..5d6183b 100644 --- a/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java +++ b/activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/StompTestSupport.java @@ -38,10 +38,11 @@ import org.apache.activemq.broker.jmx.QueueViewMBean; import org.apache.activemq.filter.DestinationMapEntry; import org.apache.activemq.security.AuthenticationUser; import org.apache.activemq.security.AuthorizationEntry; -import org.apache.activemq.security.AuthorizationMap; import org.apache.activemq.security.AuthorizationPlugin; import org.apache.activemq.security.DefaultAuthorizationMap; import org.apache.activemq.security.SimpleAuthenticationPlugin; +import org.apache.activemq.security.TempDestinationAuthorizationEntry; +import org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl; import org.apache.activemq.transport.stomp.util.ResourceLoadingSslContext; import org.apache.activemq.transport.stomp.util.XStreamBrokerContext; import org.junit.After; @@ -162,6 +163,12 @@ public class StompTestSupport { brokerService.setAdvisorySupport(false); brokerService.setSchedulerSupport(true); brokerService.setPopulateJMSXUserID(true); + brokerService.setSchedulerSupport(true); + + JobSchedulerStoreImpl jobStore = new JobSchedulerStoreImpl(); + jobStore.setDirectory(new File("activemq-data")); + + brokerService.setJobSchedulerStore(jobStore); } protected BrokerPlugin configureAuthentication() throws Exception { @@ -222,7 +229,13 @@ public class StompTestSupport { entry.setAdmin("guests,users"); authorizationEntries.add(entry); - AuthorizationMap authorizationMap = new DefaultAuthorizationMap(authorizationEntries); + TempDestinationAuthorizationEntry tempEntry = new TempDestinationAuthorizationEntry(); + tempEntry.setRead("admins"); + tempEntry.setWrite("admins"); + tempEntry.setAdmin("admins"); + + DefaultAuthorizationMap authorizationMap = new DefaultAuthorizationMap(authorizationEntries); + authorizationMap.setTempDestinationAuthorizationEntry(tempEntry); AuthorizationPlugin authorizationPlugin = new AuthorizationPlugin(authorizationMap); return authorizationPlugin;
