try {
ClassLoader cl = getVerifierContext().getClassLoader();
Class intfCls = Class.forName(descriptor.getMessageListenerType(), false, cl);
Class ejbCls = Class.forName(descriptor.getEjbClassName(), false, cl);
if(!intfCls.isAssignableFrom(ejbCls)) {
Method[] methods = intfCls.getMethods();
for (Method method : methods) {
boolean foundOne = false;
for (Method ejbMethod : ejbCls.getMethods()) {
if(MethodUtils.methodEquals(ejbMethod, method)) {
foundOne = true;
break;
}
}
if(!foundOne) {
addErrorDetails(result, compName);
result.failed(
smh.getLocalString(getClass().getName()+".failed",
"Message bean [ {0} ] neither implements listener " +
"interface [ {1} ] nor implements listener " +
"interface method [ {2} ]",
new Object[] {ejbCls.getSimpleName(), intfCls.getName(), method}));
}
}
}
} 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;