ArrayList roleValue = new ArrayList();
ObjectName a = new ObjectName(":a=a");
ObjectName b = new ObjectName(":b=b");
roleValue.add(a);
roleValue.add(b);
RoleUnresolved roleUnresolved = new RoleUnresolved("RoleName", roleValue,
RoleStatus.NO_ROLE_WITH_NAME);
// Check the role name
assertEquals("RoleName", roleUnresolved.getRoleName());
// Check the role value
assertEquals(roleValue, roleUnresolved.getRoleValue());
// Check the problem type
assertEquals(RoleStatus.NO_ROLE_WITH_NAME, roleUnresolved.getProblemType());
// Change the role name
roleUnresolved.setRoleName("Changed");
assertEquals("Changed", roleUnresolved.getRoleName());
// Change the role value
ArrayList roleValue2 = new ArrayList();
ObjectName c = new ObjectName(":c=c");
ObjectName d = new ObjectName(":d=d");
roleValue2.add(c);
roleValue2.add(d);
roleUnresolved.setRoleValue(roleValue2);
// Check the new role value
assertEquals(roleValue2, roleUnresolved.getRoleValue());
// Check the problem type
roleUnresolved.setProblemType(RoleStatus.ROLE_NOT_READABLE);
assertEquals(RoleStatus.ROLE_NOT_READABLE, roleUnresolved.getProblemType());
}
catch (MalformedObjectNameException mfone)
{
fail(mfone.toString());
}