Container-managed persistent fields test, iterates over all declared
cmp fields and invoke the runIndividualCmpFieldTest nethod
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
Class c = loadEjbClass(descriptor, result);
if (c!=null) {
Descriptor persistentField;
boolean oneFailed = false;
Set persistentFields = descriptor.getPersistenceDescriptor().getCMPFields();
Iterator iterator = persistentFields.iterator();
if (iterator.hasNext()) {
while (iterator.hasNext()) {
persistentField = (Descriptor)iterator.next();
boolean status = runIndividualCmpFieldTest(descriptor, persistentField, c, result);
if (!status)
oneFailed=true;
}
if (oneFailed) {
result.setStatus(Result.FAILED);
} else {
result.setStatus(Result.PASSED);
}
}
else {
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.entity.cmp2.CmpFieldTest.notApplicable",
"Not Applicable : The EJB has no CMP fields declared",
new Object[] {}));
}
}
return result;