Search in sources :

Example 91 with StatelessBean

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;
}
Also used : StatelessBean(org.apache.openejb.jee.StatelessBean) StatefulBean(org.apache.openejb.jee.StatefulBean) EjbJar(org.apache.openejb.jee.EjbJar)

Example 92 with StatelessBean

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;
}
Also used : AppModule(org.apache.openejb.config.AppModule) EjbModule(org.apache.openejb.config.EjbModule) PersistenceModule(org.apache.openejb.config.PersistenceModule) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) StatelessBean(org.apache.openejb.jee.StatelessBean) EjbJar(org.apache.openejb.jee.EjbJar)

Example 93 with StatelessBean

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;
}
Also used : AppModule(org.apache.openejb.config.AppModule) EjbModule(org.apache.openejb.config.EjbModule) PersistenceModule(org.apache.openejb.config.PersistenceModule) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) StatelessBean(org.apache.openejb.jee.StatelessBean) EjbJar(org.apache.openejb.jee.EjbJar)

Example 94 with StatelessBean

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;
}
Also used : StatelessBean(org.apache.openejb.jee.StatelessBean) EjbJar(org.apache.openejb.jee.EjbJar)

Example 95 with StatelessBean

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;
}
Also used : StatelessBean(org.apache.openejb.jee.StatelessBean) EjbJar(org.apache.openejb.jee.EjbJar)

Aggregations

StatelessBean (org.apache.openejb.jee.StatelessBean)132 EjbJar (org.apache.openejb.jee.EjbJar)120 Assembler (org.apache.openejb.assembler.classic.Assembler)58 ConfigurationFactory (org.apache.openejb.config.ConfigurationFactory)46 EjbModule (org.apache.openejb.config.EjbModule)39 SecurityServiceInfo (org.apache.openejb.assembler.classic.SecurityServiceInfo)33 TransactionServiceInfo (org.apache.openejb.assembler.classic.TransactionServiceInfo)33 InitialContext (javax.naming.InitialContext)31 Properties (java.util.Properties)30 Module (org.apache.openejb.testing.Module)25 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)19 StatelessSessionContainerInfo (org.apache.openejb.assembler.classic.StatelessSessionContainerInfo)18 AppModule (org.apache.openejb.config.AppModule)18 ProxyFactoryInfo (org.apache.openejb.assembler.classic.ProxyFactoryInfo)17 ServerFederation (org.apache.openejb.core.ServerFederation)15 Context (javax.naming.Context)14 ContainerSystem (org.apache.openejb.spi.ContainerSystem)14 LocalInitialContextFactory (org.apache.openejb.core.LocalInitialContextFactory)13 Empty (org.apache.openejb.jee.Empty)13 StatefulBean (org.apache.openejb.jee.StatefulBean)12