Search in sources :

Example 56 with Module

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

the class AppComposerAsJUnitRuleTest method persistence.

@Module
public Persistence persistence() {
    final PersistenceUnit unit = new PersistenceUnit("foo-unit");
    unit.addClass(EntityToValidate.class);
    unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
    unit.getProperties().setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
    unit.setExcludeUnlistedClasses(true);
    final Persistence persistence = new Persistence(unit);
    persistence.setVersion("2.0");
    return persistence;
}
Also used : Persistence(org.apache.openejb.jee.jpa.unit.Persistence) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) Module(org.apache.openejb.testing.Module)

Example 57 with Module

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

the class DataSourceInitialSizeAdjustingTest method persistence.

@Module
public Persistence persistence() throws Exception {
    final PersistenceUnit unit = new PersistenceUnit("foo-unit");
    unit.setJtaDataSource("DataSourceInitialSizeAdjustingTest");
    return new Persistence(unit);
}
Also used : Persistence(org.apache.openejb.jee.jpa.unit.Persistence) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) Module(org.apache.openejb.testing.Module)

Example 58 with Module

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

the class ResourceLocalEmInjectionTest method app.

@Module
public StatelessBean app() throws Exception {
    final StatelessBean bean = new StatelessBean(PersistManager.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 59 with Module

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

the class AliasesTest method persistence1.

@Module
public Persistence persistence1() throws Exception {
    final PersistenceUnit unit = new PersistenceUnit("AliasesTest-unit-1");
    unit.setJtaDataSource("aliased-1");
    return new Persistence(unit);
}
Also used : Persistence(org.apache.openejb.jee.jpa.unit.Persistence) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) Module(org.apache.openejb.testing.Module)

Example 60 with Module

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

the class AliasesTest method persistence0.

@Module
public Persistence persistence0() throws Exception {
    final PersistenceUnit unit = new PersistenceUnit("AliasesTest-unit-0");
    unit.setJtaDataSource("aliased-2");
    return new Persistence(unit);
}
Also used : Persistence(org.apache.openejb.jee.jpa.unit.Persistence) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) 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