run an individual verifier test of a declated cmr field of the class
boolean foundIt = false;
CMRFieldInfo info = null;
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
try {
info = role.getCMRFieldInfo();
}catch (Exception e) {
addErrorDetails(result, compName);
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed1",
"Error: No Local interfaces defined for EJB [ {0} ]",
new Object[] {descriptor.getName()}));
return false;
}
if (role.getPartner().getIsMany()) {
// must be one the collection interface
if (info.type.getName().equals("java.util.Collection") ||
info.type.getName().equals("java.util.Set")) {
foundIt = true;
}
} else {
EjbBundleDescriptor bundle = ((EjbDescriptor) descriptor).getEjbBundleDescriptor();
if(((EjbDescriptor) descriptor).getLocalClassName() != null &&
!"".equals(((EjbDescriptor) descriptor).getLocalClassName())) {
if (isValidInterface(info.type, bundle.getEjbs())) {
foundIt = true;
}
}
else {
if ((role.getRelationshipDescriptor()).getIsBidirectional()) {
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Invalid type assigned for container managed relationship [ {0} ] in bean [ {1} ]",
new Object[] {info.name , descriptor.getName()}));
return false;
}
else foundIt = true;
}
}
if (foundIt) {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addGoodDetails(smh.getLocalString
(getClass().getName() + ".passed",
"Valid type assigned for container managed relationship [ {0} ] in bean [ {1} ]",
new Object[] {info.name , descriptor.getName()}));
} else {
result.addErrorDetails(smh.getLocalString
(getClass().getName() + ".failed",
"Error: Invalid type assigned for container managed relationship [ {0} ] in bean [ {1} ]",
new Object[] {info.name , descriptor.getName()}));
}
return foundIt;