use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckInvalidAnnotatedInterfacesTest method noAttributes.
@Keys({ @Key("ann.local.noAttributes"), @Key("ann.remote.noAttributes") })
public EjbJar noAttributes() {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooBeanLocal.class));
ejbJar.addEnterpriseBean(new StatelessBean(FooBeanRemote.class));
return ejbJar;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckInvalidAroundTimeoutTest method testInvalidAroundTimeoutReturnValue.
@Keys({ @Key(value = "aroundInvoke.badReturnType", count = 2), @Key(value = "aroundInvoke.mustThrowException", count = 2) })
public EjbJar testInvalidAroundTimeoutReturnValue() throws Exception {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean("TestInvalidAroundTimeoutReturnValueBean", TestInvalidAroundTimeoutReturnValueBean.class));
ejbJar.addInterceptor(new Interceptor(TestInvalidAroundTimeoutReturnValueInterceptor.class));
return ejbJar;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckInvalidAsynchronousAnnotationsTest method ejbJarWithStatelessBean.
private static EjbJar ejbJarWithStatelessBean(final Class<?> beanClass) {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(beanClass));
return ejbJar;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckInvalidCallbacksTest method test2.
@Keys(@Key(value = "callback.sessionbean.invalidusage", count = 6))
public EjbJar test2() {
System.setProperty("openejb.validation.output.level", "VERBOSE");
final EjbJar ejbJar = new EjbJar();
final StatelessBean sun = ejbJar.addEnterpriseBean(new StatelessBean("SunStateless", Sun.class));
sun.setLocalHome(SunLocalHome.class.getName());
sun.setLocal(SunLocal.class.getName());
final StatefulBean meteor = ejbJar.addEnterpriseBean(new StatefulBean("MeteorStateful", Meteor.class));
meteor.setLocal(SunLocal.class.getName());
meteor.setLocalHome(SunLocalHome.class.getName());
return ejbJar;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckInvalidInterceptorTest method test.
@Keys({ @Key(value = "interceptor.callback.badReturnType", count = 2), @Key(value = "interceptor.callback.invalidArguments", count = 2), @Key(value = "aroundInvoke.badReturnType", count = 2), @Key(value = "aroundInvoke.invalidArguments", count = 2), @Key("interceptor.callback.missing"), @Key("aroundInvoke.missing"), @Key("interceptorBinding.noSuchEjbName"), @Key("interceptorBinding.ejbNameRequiredWithMethod"), @Key("interceptor.callback.missing.possibleTypo") })
public EjbJar test() throws Exception {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooBean.class));
final Interceptor interceptor = ejbJar.addInterceptor(new org.apache.openejb.jee.Interceptor(CallbackMissingInterceptor.class));
interceptor.addAroundInvoke("wrongMethod");
interceptor.addPostConstruct("foo");
interceptor.addPostConstruct("wrongMethod");
final List<InterceptorBinding> interceptorBindings = ejbJar.getAssemblyDescriptor().getInterceptorBinding();
final InterceptorBinding binding = new InterceptorBinding("wrongEjbName");
// binding.setMethod(new NamedMethod("wrongMethod"));
interceptorBindings.add(binding);
final InterceptorBinding binding1 = new InterceptorBinding();
binding1.setMethod(new NamedMethod("aMethod"));
interceptorBindings.add(binding1);
return ejbJar;
}
Aggregations