local interfaces extend the EJBLocalObject interface and remote interfaces
extend the EJBObject interface test.
All enterprise beans remote interfaces must extend the EJBObject interface
and/or local interfaces must extend the EJBLocalObject interface.
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
String str = null;
if (!(descriptor instanceof EjbSessionDescriptor) &&
!(descriptor instanceof EjbEntityDescriptor)) {
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.homeintf.HomeMethodTest.notApplicable1",
"Test apply only to session or entity beans."));
return result;
}
if(getInterfaceName(descriptor) == null || "".equals(getInterfaceName(descriptor))) {
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.intf.InterfaceTest.notApplicable",
"Not Applicable because, EJB [ {0} ] does not have {1} Interface.",
new Object[] {descriptor.getEjbClassName(), getInterfaceType()}));
return result;
}
try {
ClassLoader jcl = getVerifierContext().getClassLoader();
Class c = Class.forName(getClassName(descriptor), false, jcl);
str = getSuperInterface();
if (isImplementorOf(c, str)) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString
(getClass().getName() + ".passed",
"[ {0} ] " + getInterfaceType() +" interface properly extends the" + str + " interface.",
new Object[] {getClassName(descriptor)}));
} else {
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"Error: [ {0} ] does not properly extend the EJBObject interface. "+
" All enterprise bean" + getInterfaceType() + " interfaces must extend the" + str + " interface."+
" [ {1} ] is not a valid "+ getInterfaceType() + "interface within bean [ {2} ]",
new Object[] {getClassName(descriptor),getClassName(descriptor),descriptor.getName()}));
}
} catch (ClassNotFoundException e) {
Verifier.debug(e);
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(getClass().getName() + ".failedException",
"Error: [ {0} ] class not found.",
new Object[] {getClassName(descriptor)}));
}
return result;