You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2012/06/13 12:13:10 UTC

svn commit: r1349719 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java

Author: dejanb
Date: Wed Jun 13 10:13:09 2012
New Revision: 1349719

URL: http://svn.apache.org/viewvc?rev=1349719&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3845 - sync test case is now fixed as well

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java?rev=1349719&r1=1349718&r2=1349719&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/security/CachedLDAPAuthorizationMap.java Wed Jun 13 10:13:09 2012
@@ -136,7 +136,6 @@ public class CachedLDAPAuthorizationMap 
 
         try {
             context = createContext();
-
             if (refreshInterval == -1 && !refreshDisabled) {
                 eventContext = ((EventDirContext)context.lookup(""));
                 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java?rev=1349719&r1=1349718&r2=1349719&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/security/AbstractCachedLDAPAuthorizationMapLegacyTest.java Wed Jun 13 10:13:09 2012
@@ -286,12 +286,12 @@ public abstract class AbstractCachedLDAP
         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 AbstractCachedLDAP
         // 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;
+                }
             }
         });