The Application role-name element contains the name of a security role.
Result result = getInitializedResult();
if (!descriptor.getRoles().isEmpty()) {
boolean oneFailed = false;
boolean foundIt = false;
// get the security role name's in this app
Set sc = descriptor.getRoles();
Iterator itr = sc.iterator();
while (itr.hasNext()) {
foundIt = false;
Role role = (Role) itr.next();
String roleName = role.getName();
if (roleName.length() > 0) {
foundIt = true;
} else {
foundIt = false;
}
if (foundIt) {
result.addGoodDetails(smh.getLocalString
(getClass().getName() + ".passed",
"The security role name [ {0} ] found within application [ {1} ]",
new Object[] {roleName, descriptor.getName()}));
} else {
if (!oneFailed) {
oneFailed = true;
}
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: The security role name [ {0} ] not found within application [ {1} ]",
new Object[] {roleName, descriptor.getName()}));
}
}
if (oneFailed) {
result.setStatus(Result.FAILED);
} else {
result.setStatus(Result.PASSED);
}
} else {
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"There are no role-name elements within the application [ {0} ]",
new Object[] {descriptor.getName()}));
}
return result;