throws LDIFException, LDAPException, IOException {
final InMemoryListenerConfig listenerConfig = InMemoryListenerConfig.createLDAPConfig("default", port);
final InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(new DN(baseDN));
config.setListenerConfigs(listenerConfig);
config.addAdditionalBindCredentials(authDN, authPassword);
final InMemoryDirectoryServer server = new InMemoryDirectoryServer(config);
server.add(new Entry(baseDN, new Attribute("objectclass", "domain", "top")));
server.startListening();
for (final String ldifFile : ldifFiles) {
loadData(server, ldifFile);
}
return server;
}