git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1349719 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2012-06-13 10:13:09 +00:00
parent b067a65444
commit 9bf65b4f09
2 changed files with 7 additions and 4 deletions

View File

@ -136,7 +136,6 @@ public class CachedLDAPAuthorizationMap extends DefaultAuthorizationMap implemen
try { try {
context = createContext(); context = createContext();
if (refreshInterval == -1 && !refreshDisabled) { if (refreshInterval == -1 && !refreshDisabled) {
eventContext = ((EventDirContext)context.lookup("")); eventContext = ((EventDirContext)context.lookup(""));

View File

@ -286,12 +286,12 @@ public abstract class AbstractCachedLDAPAuthorizationMapLegacyTest extends Abstr
testRestart(true); testRestart(true);
} }
public void testRestart(boolean sync) throws Exception { public void testRestart(final boolean sync) throws Exception {
map.query();
if (sync) { if (sync) {
// ldap connection can be slow to close // ldap connection can be slow to close
map.setRefreshInterval(1000); map.setRefreshInterval(1000);
} }
map.query();
Set<?> failedACLs = map.getReadACLs(new ActiveMQQueue("FAILED")); Set<?> failedACLs = map.getReadACLs(new ActiveMQQueue("FAILED"));
assertEquals("set size: " + failedACLs, 0, failedACLs.size()); 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() // as we can't rely on ldar server isStarted()
Wait.waitFor(new Wait.Condition() { Wait.waitFor(new Wait.Condition() {
public boolean isSatisified() throws Exception { public boolean isSatisified() throws Exception {
return map.context == null; if (sync) {
return !map.isContextAlive();
} else {
return map.context == null;
}
} }
}); });