* @throws Exception Thrown if a failure occurs.
*/
public int setupLdap( int port ) throws Exception {
URL usersUrl = getResourceUrl( "users.ldif" );
ldapTransport = new TcpTransport( port );
ldap = new SimpleLdapDirectoryServer( "dc=hadoop,dc=apache,dc=org", new File( usersUrl.toURI() ), ldapTransport );
ldap.start();
log.info( "LDAP port = " + port );
return port;
}