in src/main/java/org/apache/openejb/cts/UnboundIdLdapRunner.java [37:70]
public void run() {
System.out.println(String.format("Starting LDAP server with file %s and port %s", ldifFile, port));
InMemoryDirectoryServer ldapServer = null;
try {
final InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=net");
final InMemoryListenerConfig listenerConfig = new InMemoryListenerConfig(
"LdapForSecurityAPI",
null,
port,
null,
null,
null);
config.setListenerConfigs(listenerConfig);
ldapServer = new InMemoryDirectoryServer(config);
ldapServer.importFromLDIF(true, new LDIFReader(ldifFile));
ldapServer.startListening();
} catch (final Exception ex) {
throw new IllegalStateException(ex);
}
while (true) {
try {
Thread.sleep(SLEEP_INTERVAL);
} catch (final InterruptedException e) {
break;
}
}
System.out.println("Embedded ldap thread stopping");
}