run an individual verifier test of a declated cmp field of the class
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
String fieldName = persistentField.getName();
String getMethodName = "get" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
String setMethodName = "set" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
Method getMethod = getMethod(c, getMethodName, null);
if (getMethod != null) {
if (((EjbDescriptor)entity).getLocalClassName() != null) {
if ((((EjbDescriptor)entity).getLocalClassName()).equals(getMethod.getReturnType().getName())) {
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.CmpFieldReturnType.failed",
"Error : cmp-field accessor method [{0}] cannot return local interface [{1}] ",
new Object[] { getMethod.toString(),((EjbDescriptor)entity).getLocalClassName() }));
return false;
} else {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addGoodDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.CmpFieldReturnType.passed",
"cmp-field accessor method [{0}] does not return local interface [{1}]. Test passed.",
new Object[] { getMethod.toString(),((EjbDescriptor)entity).getLocalClassName() }));
return true;
}
} else {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addGoodDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.CmpFieldReturnType.failed2",
"Not Applicable : no local interface found.",
new Object[] {}));
return true;
}
}else {
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.CmpFieldReturnType.failed1",
"Error : cmp-field accessor method [{0}] not found.",
new Object[] {getMethodName}));
return false;
}