InterceptorMethodTestpublic abstract class InterceptorMethodTest extends com.sun.enterprise.tools.verifier.tests.ejb.EjbTest Base class for all interceptor method tests. |
Fields Summary |
---|
com.sun.enterprise.tools.verifier.Result | result | com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor | compName |
Methods Summary |
---|
public com.sun.enterprise.tools.verifier.Result | check(com.sun.enterprise.deployment.EjbDescriptor descriptor)
result = getInitializedResult();
compName = getVerifierContext().getComponentNameConstructor();
testInterceptorMethods(
descriptor.getAroundInvokeDescriptors(), "AroundInvoke", true);
testInterceptorMethods(
descriptor.getPreDestroyDescriptors(), "PreDestroy", true);
testInterceptorMethods(
descriptor.getPostConstructDescriptors(), "PostConstruct", true);
if(descriptor instanceof EjbSessionDescriptor) {
EjbSessionDescriptor sessionDescriptor = (EjbSessionDescriptor)descriptor;
testInterceptorMethods(
sessionDescriptor.getPrePassivateDescriptors(), "PrePassivate", true);
testInterceptorMethods(
sessionDescriptor.getPostActivateDescriptors(), "PostActivate", true);
}
descriptor.getInterceptorClasses();
for (EjbInterceptor interceptor : descriptor.getInterceptorClasses()) {
testInterceptorMethods(
interceptor.getAroundInvokeDescriptors(), "AroundInvoke", false);
testInterceptorMethods(
interceptor.getPreDestroyDescriptors(), "PreDestroy", false);
testInterceptorMethods(
interceptor.getPostConstructDescriptors(), "PostConstruct", false);
testInterceptorMethods(
interceptor.getCallbackDescriptors(
LifecycleCallbackDescriptor.CallbackType.PRE_PASSIVATE), "PrePassivate", false);
testInterceptorMethods(
interceptor.getCallbackDescriptors(
LifecycleCallbackDescriptor.CallbackType.POST_ACTIVATE), "PostActivate", false);
}
if(result.getStatus() != Result.FAILED) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.ejb30.InterceptorMethodTest.passed",
"Valid Interceptor methods."));
}
return result;
| protected void | logFailure(java.lang.String methodName, java.lang.reflect.Method method)
result.getFaultLocation().setFaultyClassAndMethod(method);
addErrorDetails(result, compName);
result.failed(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.ejb.ejb30.InterceptorMethodTest.failed",
"Wrong {0} interceptor method [ {1} ]",
new Object[] {methodName, method}));
| abstract void | testInterceptorMethods(java.util.Set callbackDescs, java.lang.String callbackMethodName, java.lang.Boolean isBeanMethod)
|
|