use of org.apache.knox.gateway.security.ldap.SimpleLdapDirectoryServer in project knox by apache.
the class GatewayHealthFuncTest method setupLdap.
public static void setupLdap() throws Exception {
String basedir = System.getProperty("basedir");
if (basedir == null) {
basedir = new File(".").getCanonicalPath();
}
final Path path = FileSystems.getDefault().getPath(basedir, "/src/test/resources/users.ldif");
ldapTransport = new TcpTransport(0);
ldap = new SimpleLdapDirectoryServer("dc=hadoop,dc=apache,dc=org", path.toFile(), ldapTransport);
ldap.start();
LOG.info("LDAP port = " + ldapTransport.getPort());
}
use of org.apache.knox.gateway.security.ldap.SimpleLdapDirectoryServer in project knox by apache.
the class GatewayTestDriver method setupLdap.
public int setupLdap(int port, File ldifConfig) throws Exception {
ldapTransport = new TcpTransport(port);
ldap = new SimpleLdapDirectoryServer("dc=hadoop,dc=apache,dc=org", ldifConfig, ldapTransport);
ldap.start();
log.info("LDAP port = " + ldapTransport.getAcceptor().getLocalAddress().getPort());
return port;
}
Aggregations