public static void setupLdap() throws Exception {
URL usersUrl = getResourceUrl( "users.ldif" );
int port = findFreePort();
ldapTransport = new TcpTransport( port );
ldap = new SimpleLdapDirectoryServer( "dc=hadoop,dc=apache,dc=org", new File( usersUrl.toURI() ), ldapTransport );
ldap.start();
LOG.info( "LDAP port = " + ldapTransport.getPort() );
}