@Test
public void testAncestorReferral() throws Exception
{
LOG.debug( "" );
LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
LDAPConstraints constraints = new LDAPConstraints();
conn.setConstraints( constraints );
// referrals failure
LDAPResponseListener listener = null;
LDAPResponse response = null;
listener = conn.rename( "ou=Computers,uid=akarasuluref,ou=users,ou=system", "ou=Machines", true, null,
constraints );
response = listener.getResponse();
assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system",
response.getReferrals()[0] );
assertEquals( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
assertEquals( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
conn.disconnect();
}