use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class MistakenResourceRefUsageTest method wrongUsage.
@Keys({ @Key(value = "resourceRef.onEntityManagerFactory", count = 2), @Key(value = "resourceRef.onEntityManager", count = 2), @Key(value = "resourceAnnotation.onClassWithNoName", count = 2) })
public EjbJar wrongUsage() throws OpenEJBException {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooStateless.class));
ejbJar.addEnterpriseBean(new StatefulBean(FooStateful.class));
return ejbJar;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckPersistenceContextUsageTest method vagueMatches.
@Keys({ @Key(value = "persistenceContextRef.vagueMatches") })
public AppModule vagueMatches() {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooStatelessTwo.class));
final EjbModule ejbModule = new EjbModule(ejbJar);
final AppModule appModule = new AppModule(ejbModule.getClassLoader(), ejbModule.getJarLocation());
appModule.getEjbModules().add(ejbModule);
final PersistenceUnit pu = new PersistenceUnit("fooUnit");
final org.apache.openejb.jee.jpa.unit.Persistence p = new org.apache.openejb.jee.jpa.unit.Persistence(pu);
final PersistenceModule pm = new PersistenceModule("foo", p);
appModule.getPersistenceModules().add(pm);
final PersistenceUnit pu1 = new PersistenceUnit("fooUnit");
final org.apache.openejb.jee.jpa.unit.Persistence p1 = new org.apache.openejb.jee.jpa.unit.Persistence(pu1);
final PersistenceModule pm1 = new PersistenceModule("foo1", p1);
appModule.addPersistenceModule(pm1);
return appModule;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckPersistenceContextUsageTest method noUnitName.
@Keys({ @Key(value = "persistenceContextRef.noUnitName"), @Key(value = "persistenceContextRef.noMatches") })
public AppModule noUnitName() {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooStatelessOne.class));
final EjbModule ejbModule = new EjbModule(ejbJar);
final AppModule appModule = new AppModule(ejbModule.getClassLoader(), ejbModule.getJarLocation());
appModule.getEjbModules().add(ejbModule);
final PersistenceUnit pu = new PersistenceUnit("fooUnit");
final PersistenceUnit pu1 = new PersistenceUnit("fooUnit1");
final PersistenceUnit pu2 = new PersistenceUnit("fooUnit");
final org.apache.openejb.jee.jpa.unit.Persistence p = new org.apache.openejb.jee.jpa.unit.Persistence(pu, pu1, pu2);
final PersistenceModule pm = new PersistenceModule("foo", p);
appModule.addPersistenceModule(pm);
return appModule;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckPersistenceContextUsageTest method wrongUsage.
@Keys({ @Key(value = "persistenceContextExtented.nonStateful"), @Key(value = "persistenceContextRef.noPersistenceUnits", count = 3), @Key(value = "persistenceContextAnnotation.onClassWithNoName"), @Key(value = "persistenceContextAnnotation.onEntityManagerFactory"), @Key(value = "persistenceContextAnnotation.onNonEntityManager") })
public EjbJar wrongUsage() throws OpenEJBException {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(FooStateless.class));
return ejbJar;
}
use of org.apache.openejb.jee.StatelessBean in project tomee by apache.
the class CheckTowManyInterfaceTest method testSLSBwithUserTransaction.
@Keys(@Key("too.many.interfaces"))
public EjbJar testSLSBwithUserTransaction() throws Exception {
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(new StatelessBean(TwoManyInterface.class));
return ejbJar;
}
Aggregations