|
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertNull;
|
|
|
import javax.naming.directory.DirContext;
|
|
|
|
|
|
import org.junit.Test;
|
|
|
+import org.springframework.security.BadCredentialsException;
|
|
|
|
|
|
/**
|
|
|
* @author Luke Taylor
|
|
@@ -30,4 +31,16 @@ public class DefaultSpringSecurityContextSourceTests extends AbstractLdapIntegra
|
|
|
ctx.close();
|
|
|
}
|
|
|
|
|
|
+ @Test(expected=BadCredentialsException.class)
|
|
|
+ public void poolingIsntUsedForSingleUser2() throws Exception {
|
|
|
+ DirContext ctx = getContextSource().getReadWriteContext("uid=Bob,ou=people,dc=springframework,dc=org", "bobspassword");
|
|
|
+ com.sun.jndi.ldap.LdapPoolManager.showStats(System.out);
|
|
|
+ ctx.close();
|
|
|
+ com.sun.jndi.ldap.LdapPoolManager.showStats(System.out);
|
|
|
+ // Now get it gain, with wrong password
|
|
|
+ ctx = getContextSource().getReadWriteContext("uid=Bob,ou=people,dc=springframework,dc=org", "wrongpassword");
|
|
|
+ com.sun.jndi.ldap.LdapPoolManager.showStats(System.out);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|