use of org.apache.openejb.testing.Module in project tomee by apache.
the class QuartzPersistenceForEJBTimersTest method application.
@Module
public AppModule application() {
final EjbModule ejbModule = new EjbModule(new EjbJar());
ejbModule.getEjbJar().addEnterpriseBean(new SingletonBean(MyTimedEjb.class).localBean());
final Properties quartzConfig = new PropertiesBuilder().p("org.apache.openejb.quartz.scheduler.instanceName", "TestScheduler").p("org.apache.openejb.quartz.scheduler.instanceId", "AUTO").p("org.apache.openejb.quartz.threadPool.class", SimpleThreadPool.class.getName()).p("org.apache.openejb.quartz.threadPool.threadCount", "4").p("org.apache.openejb.quartz.threadPool.threadPriority", "5").p("org.apache.openejb.quartz.jobStore.class", JobStoreCMT.class.getName()).p("org.apache.openejb.quartz.jobStore.driverDelegateClass", HSQLDBDelegate.class.getName()).p("org.apache.openejb.quartz.jobStore.dataSource", "QUARTZ").p("org.apache.openejb.quartz.jobStore.nonManagedTXDataSource", "QUARTZ_NOTX").p("org.apache.openejb.quartz.jobStore.tablePrefix", "qrtz_").p("org.apache.openejb.quartz.jobStore.isClustered", "true").p("org.apache.openejb.quartz.jobStore.clusterCheckinInterval", "60000").p("org.apache.openejb.quartz.jobStore.txIsolationLevelSerializable", "true").p("org.apache.openejb.quartz.jobStore.maxMisfiresToHandleAtATime", "100").p("org.apache.openejb.quartz.dataSource.QUARTZ.jndiURL", "openejb:Resource/QuartzPersistenceForEJBTimersDB").p("org.apache.openejb.quartz.dataSource.QUARTZ_NOTX.jndiURL", "openejb:Resource/QuartzPersistenceForEJBTimersDBNoTx").build();
final AppModule appModule = new AppModule(Thread.currentThread().getContextClassLoader(), null);
appModule.getEjbModules().add(ejbModule);
appModule.getProperties().putAll(quartzConfig);
return appModule;
}
use of org.apache.openejb.testing.Module in project tomee by apache.
the class VagueEnvEntriesMatchTest method foo.
@Module
public SingletonBean foo() {
final SingletonBean singletonBean = new SingletonBean(Blue.class);
singletonBean.getEnvEntry().add(new EnvEntry().name("one").type(String.class).value("hello"));
singletonBean.getEnvEntry().add(new EnvEntry().name("two").type(String.class).value("false"));
singletonBean.getEnvEntry().add(new EnvEntry().name(Blue.class.getName() + "/two").type(String.class).value("true"));
return singletonBean;
}
use of org.apache.openejb.testing.Module in project tomee by apache.
the class SecondStatelessInterceptedTest method module.
@Module
public EjbJar module() {
final EjbJar ejbJar = new EjbJar();
final StatelessBean bean = ejbJar.addEnterpriseBean(new StatelessBean(SecondStatelessInterceptedBean.class));
final AssemblyDescriptor assembly = ejbJar.getAssemblyDescriptor();
assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorOne.class)));
assembly.addInterceptorBinding(new InterceptorBinding("*", new Interceptor(DefaultInterceptorTwo.class)));
assembly.addInterceptorBinding(new InterceptorBinding(bean)).setExcludeDefaultInterceptors(true);
return ejbJar;
}
use of org.apache.openejb.testing.Module in project tomee by apache.
the class JTAPuAndBmtTest method persistence.
@Module
public Persistence persistence() {
final PersistenceUnit unit = new PersistenceUnit("foo-unit");
unit.addClass(TheEntity.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;
}
use of org.apache.openejb.testing.Module in project tomee by apache.
the class JTAPuAndBmtTest method app.
@Module
public StatelessBean app() throws Exception {
final StatelessBean bean = new StatelessBean(BmtManager.class);
bean.setLocalBean(new Empty());
return bean;
}
Aggregations