MBeanServer server = createMBeanServer();
ObjectName service = createRelationService("test:type=service", server);
createRelationTypeC(service);
createRolesC(server);
RoleResult result = null;
RelationSupport support = null;
try
{
support = new RelationSupport("id", service, server,
"relationTypeC", rolesC);
addRelation(server, service, support, "test:type=support");
result = support.getRoles(new String[] {"roleC1", "roleC2" });
}
catch(Exception e)
{
fail(e.toString());
}
checkResult(result, roleInfosC, rolesC);
try
{
result = support.getRoles(new String[] {"roleC1" });
}
catch(Exception e)
{
fail(e.toString());
}
RoleList resolved = result.getRoles();
assertEquals(1, resolved.size());
assertEquals(0, result.getRolesUnresolved().size());
compare(getRole(rolesC, "roleC1"), (Role) resolved.get(0));
try
{
result = support.getRoles(new String[] {"roleC2" });
}
catch(Exception e)
{
fail(e.toString());
}