From 9bf65b4f097bf0a89a91e484bbf9d879474e55bb Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Wed, 13 Jun 2012 10:13:09 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-3845 - sync test case is now fixed as well git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1349719 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/security/CachedLDAPAuthorizationMap.java | 1 - .../AbstractCachedLDAPAuthorizationMapLegacyTest.java | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java b/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java index 440746ded2..e2e13da705 100644 --- a/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java +++ b/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java @@ -136,7 +136,6 @@ public class CachedLDAPAuthorizationMap extends DefaultAuthorizationMap implemen try { context = createContext(); - if (refreshInterval == -1 && !refreshDisabled) { eventContext = ((EventDirContext)context.lookup("")); diff --git a/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java b/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java index aea13208fc..be65eebb32 100755 --- a/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java @@ -286,12 +286,12 @@ public abstract class AbstractCachedLDAPAuthorizationMapLegacyTest extends Abstr testRestart(true); } - public void testRestart(boolean sync) throws Exception { - map.query(); + public void testRestart(final boolean sync) throws Exception { if (sync) { // ldap connection can be slow to close map.setRefreshInterval(1000); } + map.query(); Set failedACLs = map.getReadACLs(new ActiveMQQueue("FAILED")); assertEquals("set size: " + failedACLs, 0, failedACLs.size()); @@ -305,7 +305,11 @@ public abstract class AbstractCachedLDAPAuthorizationMapLegacyTest extends Abstr // as we can't rely on ldar server isStarted() Wait.waitFor(new Wait.Condition() { public boolean isSatisified() throws Exception { - return map.context == null; + if (sync) { + return !map.isContextAlive(); + } else { + return map.context == null; + } } });