* @return The actual port the LDAP server is listening on.
* @throws Exception Thrown if a failure occurs.
*/
public int setupLdap( int port ) throws Exception {
URL usersUrl = getResourceUrl( "users.ldif" );
ldap = new EmbeddedApacheDirectoryServer( "dc=hadoop,dc=apache,dc=org", null, port );
ldap.start();
ldap.loadLdif( usersUrl );
log.info( "LDAP port = " + port );
return port;
}