try {
ClassLoader cl = getVerifierContext().getClassLoader();
Class ejbCls = Class.forName(descriptor.getEjbClassName(), false, cl);
Set<EjbDescriptor> descrptors =
descriptor.getEjbBundleDescriptor().getEjbs();
for (EjbDescriptor ejbDescriptor : descrptors) {
if(!(ejbDescriptor instanceof EjbMessageBeanDescriptor))
continue;
if(descriptor.getEjbClassName().equals(ejbDescriptor.getEjbClassName()))
continue;
Class mdbCls = null;
try {
mdbCls = Class.forName(ejbDescriptor.getEjbClassName(), false, cl);
} catch (ClassNotFoundException e) {
continue; // ignore as this error will be caught by other tests
}
if(mdbCls.isAssignableFrom(ejbCls)) {
addErrorDetails(result, compName);
result.failed(
smh.getLocalString(getClass().getName()+".failed",
"Message bean [ {0} ] inherits other message bean [ {1} ]",
new Object[] {ejbCls.getName(), mdbCls.getName()}));
}
}
} catch (ClassNotFoundException e) {
//ignore as this error will be caught by other tests
logger.fine(descriptor.getEjbClassName() + " Not found");
}
if(result.getStatus() != Result.FAILED) {
addGoodDetails(result, compName);
result.passed(
smh.getLocalString(getClass().getName()+".passed",
"Valid Message bean [ {0} ]",
new Object[] {descriptor.getEjbClassName()}));
}
return result;