RootDeploymentDescriptor rootDescriptor = getRootDescriptor(descriptor);
Result result = getInitializedResult();
addErrorDetails(result,
getVerifierContext().getComponentNameConstructor());
result.setStatus(Result.PASSED); //default status is PASSED
if(rootDescriptor.getPersistenceUnitsDescriptors().size() == 0)
result.setStatus(Result.NOT_APPLICABLE);
for(PersistenceUnitsDescriptor pus : rootDescriptor.getPersistenceUnitsDescriptors()) {
if (pus.getPersistenceUnitDescriptors().size() == 0) {
result.failed(
smh.getLocalString(
className + ".failed",
"persistence.xml in persistence unit root [ {0} ] has no persistence units.",
new Object[]{pus.getPuRoot()}));
}
}
return result;