Declare local and remote interfaces as public interfaces test.
All enterprise bean local and/or interfaces must be declared as public.
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
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;
}
String assertionClass = "com.sun.enterprise.tools.verifier.tests.ejb.intf.InterfacePublic";
for (String intfName : getInterfaceNames(descriptor)) {
try {
ClassLoader jcl = getVerifierContext().getClassLoader();
Class c = Class.forName(intfName, false, jcl);
// local and remote interface must be defined as public
if (!Modifier.isPublic(c.getModifiers())) {
addErrorDetails(result, compName);
result.failed(smh.getLocalString
(assertionClass + ".failed",
"Error: [ {0} ] is not defined as a public interface.",
new Object[] {intfName}));
}
} catch (ClassNotFoundException e) {
// ignore as it will be caught in EjbArchiveClassesLoadable
logger.log(Level.FINER,e.getMessage(),e);
}
}
if(result.getStatus() != Result.FAILED) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString
(assertionClass + ".passed",
"Valid public interface(s)."));
}
return result;