Search in sources :

Example 71 with Module

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

the class DataSourceDefinitionGlobalJPATest method persistence.

@Module
public Persistence persistence() {
    final org.apache.openejb.jee.jpa.unit.PersistenceUnit unit = new org.apache.openejb.jee.jpa.unit.PersistenceUnit("jpa-global-dsdef-unit");
    unit.addClass(IdEntity.class);
    unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
    unit.getProperties().setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
    unit.setJtaDataSource("java:app/foo");
    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(javax.persistence.PersistenceUnit) Module(org.apache.openejb.testing.Module)

Example 72 with Module

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

the class ImportSqlScriptTest method app.

@Module
public SingletonBean app() throws Exception {
    final SingletonBean bean = new SingletonBean(Persister.class);
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) Empty(org.apache.openejb.jee.Empty) Module(org.apache.openejb.testing.Module)

Example 73 with Module

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

the class ImportSqlScriptTest method persistence.

@Module
public Persistence persistence() {
    final PersistenceUnit unit = new PersistenceUnit("ImportSqlScriptTest");
    unit.addClass(Something.class);
    unit.setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
    unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
    unit.setProperty("openjpa.Log", "DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE");
    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 74 with Module

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

the class BeanValidationCustomProviderTest method app.

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

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

the class BeanValidationTest 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)

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