public void testOnReferral() throws Exception
{
LdapConnection conn = getWiredConnection( getLdapServer() );
// comparison success
CompareRequest compareRequest = new CompareRequestImpl();
compareRequest.setName( new Dn( "uid=akarasulu,ou=users,ou=system" ) );
compareRequest.setAttributeId( "uid" );
compareRequest.setAssertionValue( "akarasulu" );
ManageDsaIT manageDSAIT = new ManageDsaITImpl();
manageDSAIT.setCritical( false );
compareRequest.addControl( manageDSAIT );
CompareResponse compareResponse = conn.compare( compareRequest );
assertEquals( ResultCodeEnum.COMPARE_TRUE, compareResponse.getLdapResult().getResultCode() );
// referrals failure
compareRequest = new CompareRequestImpl();
compareRequest.setName( new Dn( "uid=akarasuluREF,ou=users,ou=system" ) );
compareRequest.setAttributeId( "uid" );
compareRequest.setAssertionValue( "akarasulu" );
compareResponse = conn.compare( compareRequest );
assertEquals( ResultCodeEnum.REFERRAL, compareResponse.getLdapResult().getResultCode() );
assertTrue( compareResponse.getLdapResult().getReferral().getLdapUrls()