use of org.apache.openejb.testing.Module in project tomee by apache.
the class DataSourceDefinitionWithEjbJarXmlTest method initModule.
@Module
public EjbJar initModule() throws Exception {
final EjbJar ejbJar = new EjbJar();
final StatelessBean statelessBean = ejbJar.addEnterpriseBean(new StatelessBean(DataSourceBean.class));
final org.apache.openejb.jee.DataSource ds = new org.apache.openejb.jee.DataSource();
ds.setUser(EXPECTED_USER_NAME);
ds.setName("java:comp/env/" + DATASOURCE_NAME);
ds.setUrl("jdbc:hsqldb:mem:test");
ds.setClassName(DRIVER_CLASS);
statelessBean.getDataSourceMap().put(DATASOURCE_NAME, ds);
return ejbJar;
}
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;
}
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;
}
use of org.apache.openejb.testing.Module in project tomee by apache.
the class MoviesTest method beans.
@Module
public EjbJar beans() {
EjbJar ejbJar = new EjbJar("movie-beans");
ejbJar.addEnterpriseBean(new StatefulBean(MoviesImpl.class));
return ejbJar;
}
use of org.apache.openejb.testing.Module in project tomee by apache.
the class AppComposerConfiguration method unit.
@Module
public static PersistenceUnit unit() {
final PersistenceUnit jpa = new PersistenceUnit("jpa");
jpa.setExcludeUnlistedClasses(true);
return jpa;
}
Aggregations