Search in sources :

Example 6 with Module

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

the class SessionScoped2Test method getBeans.

@Module
public Beans getBeans() {
    final Beans beans = new Beans();
    beans.addManagedClass(Orange.class);
    beans.addManagedClass(Blue.class);
    beans.addManagedClass(Green.class);
    return beans;
}
Also used : Beans(org.apache.openejb.jee.Beans) Module(org.apache.openejb.testing.Module)

Example 7 with Module

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

the class StatefulDecoratorInjectionTest method getBeans.

@Module
public Beans getBeans() {
    final Beans beans = new Beans();
    beans.addDecorator(OrangeSecurity.class);
    return beans;
}
Also used : Beans(org.apache.openejb.jee.Beans) Module(org.apache.openejb.testing.Module)

Example 8 with Module

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

the class LocalBeanProxySerializationTest method app.

@Module
public StatelessBean app() {
    final StatelessBean bean = new StatelessBean(SampleLocalBean.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)

Example 9 with Module

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

the class ResourcePropertyLeakTest method application.

@Module
public AppModule application() {
    final EjbModule ejbModule = new EjbModule(new EjbJar());
    final AppModule appModule = new AppModule(Thread.currentThread().getContextClassLoader(), null);
    appModule.getEjbModules().add(ejbModule);
    return appModule;
}
Also used : AppModule(org.apache.openejb.config.AppModule) EjbModule(org.apache.openejb.config.EjbModule) EjbJar(org.apache.openejb.jee.EjbJar) EjbModule(org.apache.openejb.config.EjbModule) AppModule(org.apache.openejb.config.AppModule) Module(org.apache.openejb.testing.Module)

Example 10 with Module

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

the class DescriptorDataSourceDefinitionTest method application.

@Module
public EjbJar application() throws Exception {
    final EjbJar ejbJar = new EjbJar();
    final SingletonBean orange = ejbJar.addEnterpriseBean(new SingletonBean(OrangeBean.class));
    orange.getDataSource().add(new org.apache.openejb.jee.DataSource().name("java:comp/env/superDS").className("org.hsqldb.jdbc.JDBCDataSource").user("sa").password("").url("jdbc:hsqldb:mem:superDS"));
    orange.getResourceRef().add(new ResourceRef().lookup("java:comp/env/superDS").injectionTarget(OrangeBean.class, "ds"));
    final StatelessBean yellow = ejbJar.addEnterpriseBean(new StatelessBean(YellowBean.class));
    yellow.getDataSource().add(new org.apache.openejb.jee.DataSource().name("java:comp/env/superMegaDS").className("org.hsqldb.jdbc.JDBCDataSource").user("sa").password("").url("jdbc:hsqldb:mem:superDS"));
    yellow.getResourceRef().add(new ResourceRef().lookup("java:comp/env/superMegaDS").injectionTarget(YellowBean.class, "mega"));
    yellow.getDataSource().add(new org.apache.openejb.jee.DataSource().name("java:comp/env/superGigaDS").className("org.hsqldb.jdbc.JDBCDataSource").user("sa").password("").url("jdbc:hsqldb:mem:superDS"));
    yellow.getResourceRef().add(new ResourceRef().lookup("java:comp/env/superGigaDS").injectionTarget(YellowBean.class, "giga"));
    return ejbJar;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) StatelessBean(org.apache.openejb.jee.StatelessBean) ResourceRef(org.apache.openejb.jee.ResourceRef) EjbJar(org.apache.openejb.jee.EjbJar) DataSource(javax.sql.DataSource) Module(org.apache.openejb.testing.Module)

Aggregations

Module (org.apache.openejb.testing.Module)81 EjbJar (org.apache.openejb.jee.EjbJar)26 StatelessBean (org.apache.openejb.jee.StatelessBean)22 Empty (org.apache.openejb.jee.Empty)18 Persistence (org.apache.openejb.jee.jpa.unit.Persistence)18 PersistenceUnit (org.apache.openejb.jee.jpa.unit.PersistenceUnit)17 EjbModule (org.apache.openejb.config.EjbModule)16 SingletonBean (org.apache.openejb.jee.SingletonBean)16 Beans (org.apache.openejb.jee.Beans)13 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)9 AppModule (org.apache.openejb.config.AppModule)6 Classes (org.apache.openejb.testing.Classes)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