Set roleReferences = null;
Iterator roleRefsIterator = null;
Set roles = bundleDescriptor.getRoles();
Iterator rolesIterator = roles.iterator();
RoleReference roleReference = null;
Role role = null;
boolean oneFailed = false;
// check to see if there are any undefined roles being referenced
while (ejbIterator.hasNext()) {
ejb = (EjbDescriptor)ejbIterator.next();
roleReferences = ejb.getRoleReferences();
roleRefsIterator = roleReferences.iterator();
if (roleRefsIterator.hasNext()) {
while (roleRefsIterator.hasNext()) {
roleReference = (RoleReference)roleRefsIterator.next();
role = roleReference.getRole();
if (!role.getName().equals("")
&& !bundleDescriptor.getRoles().contains(role) ) {
// print the undefine role
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: The role [ {0} ] for bean [ {1} ] is undefined.",
new Object[] {role.getName(),ejb.getName()}));
if (!oneFailed) {
oneFailed = true;
}
} else {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.passed(smh.getLocalString
(getClass().getName() + ".passed",
"The role [ {0} ] for bean [ {1} ] is defined.",
new Object[] {role.getName(),ejb.getName()}));
}
}
} else {
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",