context.logout();
}
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
MutableServerStartupConfiguration startup = new MutableServerStartupConfiguration();
// put some mandatory JNDI properties here
startup.setWorkingDirectory(new File("target/ldap"));
startup.setAllowAnonymousAccess(true);
startup.setLdapPort(9389);
startup.setEnableNetworking(true);
startup.setHost(InetAddress.getByName("localhost"));
Properties env = new Properties();
env.putAll(startup.toJndiEnvironment());
env.put(Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName());
env.put(Context.PROVIDER_URL, "ou=system");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, PRINCIPAL);
env.put(Context.SECURITY_CREDENTIALS, CREDENTIALS);