|
@@ -1,12 +1,16 @@
|
|
package org.springframework.security.ldap;
|
|
package org.springframework.security.ldap;
|
|
|
|
|
|
|
|
+import static org.junit.Assert.assertNull;
|
|
|
|
+
|
|
|
|
+import javax.naming.directory.DirContext;
|
|
|
|
+
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author Luke Taylor
|
|
* @author Luke Taylor
|
|
* @version $Id$
|
|
* @version $Id$
|
|
*/
|
|
*/
|
|
-public class DefaultSpringSecurityContextSourceTests {
|
|
|
|
|
|
+public class DefaultSpringSecurityContextSourceTests extends AbstractLdapIntegrationTests {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void instantiationSucceeds() {
|
|
public void instantiationSucceeds() {
|
|
@@ -15,7 +19,15 @@ public class DefaultSpringSecurityContextSourceTests {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void supportsSpacesInUrl() {
|
|
public void supportsSpacesInUrl() {
|
|
- new DefaultSpringSecurityContextSource("ldap://myhost:10389/dc=spring%20framework,dc=org");
|
|
|
|
|
|
+ new DefaultSpringSecurityContextSource("ldap://myhost:10389/dc=spring%20framework,dc=org");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void poolingIsntUsedForSingleUser() throws Exception {
|
|
|
|
+ DirContext ctx = getContextSource().getReadWriteContext("uid=Bob,ou=people,dc=springframework,dc=org", "bobspassword");
|
|
|
|
+ //com.sun.jndi.ldap.LdapPoolManager.showStats(System.out);
|
|
|
|
+ assertNull(ctx.getEnvironment().get("com.sun.jndi.ldap.connect.pool"));
|
|
|
|
+ ctx.close();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|