Search in sources :

Example 46 with Module

use of org.apache.openejb.testing.Module in project tomee by apache.

the class LocalReferenceSerializationTest method app.

@Module
public EjbJar app() {
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new StatelessBean(OrangeLocalBean.class));
    ejbJar.addEnterpriseBean(new StatelessBean(RedBean.class));
    ejbJar.addEnterpriseBean(new StatelessBean(GreenBean.class));
    return ejbJar;
}
Also used : StatelessBean(org.apache.openejb.jee.StatelessBean) EjbJar(org.apache.openejb.jee.EjbJar) Module(org.apache.openejb.testing.Module)

Example 47 with Module

use of org.apache.openejb.testing.Module in project tomee by apache.

the class PassivationWithEmTest method bean.

@Module
public EjbJar bean() {
    final EjbJar ejbJar = new EjbJar(getClass().getSimpleName());
    ejbJar.addEnterpriseBean(new StatefulBean("PassivationWithEm", PassivationWithEm.class));
    ejbJar.addEnterpriseBean(new StatefulBean("PassivationWithEmExtended", PassivationWithEmExtended.class));
    return ejbJar;
}
Also used : StatefulBean(org.apache.openejb.jee.StatefulBean) EjbJar(org.apache.openejb.jee.EjbJar) Module(org.apache.openejb.testing.Module)

Example 48 with Module

use of org.apache.openejb.testing.Module in project tomee by apache.

the class InterfaceTransactionTest method module.

@Module
public EjbJar module() throws Exception {
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new StatelessBean(OrangeBean.class));
    final Method remoteMethod = new Method("OrangeBean", "isInTransaction").withInterface(MethodIntf.REMOTE);
    final Method localMethod = new Method("OrangeBean", "isInTransaction").withInterface(MethodIntf.LOCAL);
    final List<ContainerTransaction> transactions = ejbJar.getAssemblyDescriptor().getContainerTransaction();
    transactions.add(new ContainerTransaction(TransAttribute.REQUIRED, remoteMethod));
    transactions.add(new ContainerTransaction(TransAttribute.SUPPORTS, localMethod));
    return ejbJar;
}
Also used : StatelessBean(org.apache.openejb.jee.StatelessBean) ContainerTransaction(org.apache.openejb.jee.ContainerTransaction) Method(org.apache.openejb.jee.Method) EjbJar(org.apache.openejb.jee.EjbJar) Module(org.apache.openejb.testing.Module)

Example 49 with Module

use of org.apache.openejb.testing.Module in project tomee by apache.

the class StatelessContainerTest method app.

@Module
public StatelessBean app() throws Exception {
    final StatelessBean bean = new StatelessBean(WidgetBean.class);
    bean.addBusinessLocal(Widget.class.getName());
    bean.addBusinessRemote(RemoteWidget.class.getName());
    bean.addPostConstruct("init");
    bean.addPreDestroy("destroy");
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : Empty(org.apache.openejb.jee.Empty) StatelessBean(org.apache.openejb.jee.StatelessBean) Module(org.apache.openejb.testing.Module)

Example 50 with Module

use of org.apache.openejb.testing.Module in project tomee by apache.

the class EjbTimerImplSerializableTest method bean.

@Module
public StatelessBean bean() {
    final StatelessBean bean = new StatelessBean(EJBWithTimer.class);
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : Empty(org.apache.openejb.jee.Empty) StatelessBean(org.apache.openejb.jee.StatelessBean) Module(org.apache.openejb.testing.Module)

Aggregations

Module (org.apache.openejb.testing.Module)86 EjbJar (org.apache.openejb.jee.EjbJar)30 StatelessBean (org.apache.openejb.jee.StatelessBean)25 Empty (org.apache.openejb.jee.Empty)19 EjbModule (org.apache.openejb.config.EjbModule)18 Persistence (org.apache.openejb.jee.jpa.unit.Persistence)18 PersistenceUnit (org.apache.openejb.jee.jpa.unit.PersistenceUnit)17 SingletonBean (org.apache.openejb.jee.SingletonBean)16 Beans (org.apache.openejb.jee.Beans)13 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)9 Classes (org.apache.openejb.testing.Classes)9 AppModule (org.apache.openejb.config.AppModule)6 PojoDeployment (org.apache.openejb.jee.oejb3.PojoDeployment)5 Properties (java.util.Properties)4 WebModule (org.apache.openejb.config.WebModule)4 Resources (org.apache.openejb.config.sys.Resources)4 Service (org.apache.openejb.config.sys.Service)4 AssemblyDescriptor (org.apache.openejb.jee.AssemblyDescriptor)4 Interceptor (org.apache.openejb.jee.Interceptor)4 InterceptorBinding (org.apache.openejb.jee.InterceptorBinding)4