boolean hasPrivilege)
throws Exception
{
assertEquals(conn.hasPrivilege(Privilege.JMX_WRITE, null), hasPrivilege);
ModifyDNOperation modifyDNOperation =
conn.processModifyDN(DN.decode("cn=Work Queue,cn=config"),
RDN.decode("cn=New RDN for Work Queue"), true,
null);
if (hasPrivilege)
{
// We don't support modify DN operations in the server configuration, but
// at least we need to make sure we're getting past the privilege check.
assertEquals(modifyDNOperation.getResultCode(),
ResultCode.UNWILLING_TO_PERFORM);
}
else
{
assertEquals(modifyDNOperation.getResultCode(),
ResultCode.INSUFFICIENT_ACCESS_RIGHTS);
}
}