* are sent back to the client with a non-success result code.
*/
@Test
public void testThrowOnReferralWithJndi() throws Exception
{
LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
// delete success
ctx.destroySubcontext( "ou=computers,uid=akarasulu,ou=users,ou=system" );
try
{
ctx.lookup( "ou=computers,uid=akarasulu,ou=users,ou=system" );
fail( "Should never get here." );
}
catch ( NameNotFoundException e )
{
}
// referrals failure on delete
try
{
ctx.destroySubcontext( "uid=akarasuluref,ou=users,ou=system" );
fail( "Should never get here" );
}
catch ( ReferralException e )
{
// seems JNDI only returns the first referral URL and not all so we test for it
assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", e.getReferralInfo() );
}
ctx.close();
}