From 1149da6137e1f40912d18eed3f9bbd2dfc5cfa8b Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 28 Aug 2006 20:10:34 +0000 Subject: [PATCH] Changed test server details. --- .../PasswordPolicyResponseControlTests.java | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/sandbox/src/test/java/org/acegisecurity/ldap/ppolicy/PasswordPolicyResponseControlTests.java b/sandbox/src/test/java/org/acegisecurity/ldap/ppolicy/PasswordPolicyResponseControlTests.java index ac9e2ff667..2e4c3ecb50 100644 --- a/sandbox/src/test/java/org/acegisecurity/ldap/ppolicy/PasswordPolicyResponseControlTests.java +++ b/sandbox/src/test/java/org/acegisecurity/ldap/ppolicy/PasswordPolicyResponseControlTests.java @@ -21,12 +21,9 @@ import javax.naming.Context; import javax.naming.NamingException; import javax.naming.ldap.InitialLdapContext; import javax.naming.ldap.Control; +import javax.naming.ldap.LdapContext; import java.util.Hashtable; -import org.acegisecurity.ldap.ppolicy.OracleIDPasswordPolicyControl; -import org.acegisecurity.ldap.ppolicy.PasswordPolicyResponseControl; - - /** * Tests for PasswordPolicyResponse. * @@ -42,27 +39,30 @@ public class PasswordPolicyResponseControlTests extends TestCase { // public void testAgainstServer() throws Exception { // Hashtable env = new Hashtable(); // env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); -// env.put(Context.PROVIDER_URL, "ldap://myip/"); +// env.put(Context.PROVIDER_URL, "ldap://gorille:389/"); // env.put(Context.SECURITY_AUTHENTICATION, "simple"); -// env.put(Context.SECURITY_PRINCIPAL, "cn=orcladmin,cn=Users"); -// env.put(Context.SECURITY_CREDENTIALS, "password"); +// env.put(Context.SECURITY_PRINCIPAL, "cn=manager,dc=acegisecurity,dc=org"); +// env.put(Context.SECURITY_CREDENTIALS, "acegisecurity"); +// env.put(LdapContext.CONTROL_FACTORIES, PasswordPolicyControlFactory.class.getName()); // // InitialLdapContext ctx = new InitialLdapContext(env, null); // -// Control[] rctls = { new OracleIDPasswordPolicyControl()}; +// Control[] rctls = { new PasswordPolicyControl(false) }; +// +// ctx.setRequestControls(rctls); // // try { -//// ctx.addToEnvironment(LdapContext.CONTROL_FACTORIES, PasswordPolicyControlFactory.class.getName()); -// ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, "cn=jerrymouse,cn=Users" ); -// ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, "wheresthecheese"); -// ctx.reconnect(rctls); +// ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, "uid=bob,ou=people,dc=acegisecurity,dc=org" ); +// ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, "bobspassword"); +// Object o = ctx.lookup(""); +// +// System.out.println(o); +// // } catch(NamingException ne) { -// ne.printStackTrace(); // // Ok. +// System.err.println(ne); // } // -// Control[] controls = ctx.getResponseControls(); -// // PasswordPolicyResponseControl ctrl = getPPolicyResponseCtl(ctx); // System.out.println(ctrl); // @@ -71,6 +71,7 @@ public class PasswordPolicyResponseControlTests extends TestCase { // //com.sun.jndi.ldap.LdapPoolManager.showStats(System.out); // } + private PasswordPolicyResponseControl getPPolicyResponseCtl(InitialLdapContext ctx) throws NamingException { Control[] ctrls = ctx.getResponseControls();