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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations