Search in sources :

Example 76 with StatelessBean

use of org.apache.openejb.jee.StatelessBean 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 77 with StatelessBean

use of org.apache.openejb.jee.StatelessBean in project tomee by apache.

the class AbstractInjectionTest method app.

@Module
public EjbModule app() throws Exception {
    final StatelessBean bean = new StatelessBean(AppJpaDAO.class);
    bean.setLocalBean(new Empty());
    final StatelessBean test = new StatelessBean(AppCDI.class);
    bean.setLocalBean(new Empty());
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(bean);
    ejbJar.addEnterpriseBean(test);
    final Beans beans = new Beans();
    beans.addManagedClass(PlcBaseDAO.class);
    beans.addManagedClass(PlcBaseJpaDAO.class);
    beans.addManagedClass(AppCDI.class);
    beans.addManagedClass(AppJpaDAO.class);
    final EjbModule jar = new EjbModule(ejbJar);
    jar.setBeans(beans);
    return jar;
}
Also used : Empty(org.apache.openejb.jee.Empty) Beans(org.apache.openejb.jee.Beans) StatelessBean(org.apache.openejb.jee.StatelessBean) EjbModule(org.apache.openejb.config.EjbModule) EjbJar(org.apache.openejb.jee.EjbJar) EjbModule(org.apache.openejb.config.EjbModule) Module(org.apache.openejb.testing.Module)

Example 78 with StatelessBean

use of org.apache.openejb.jee.StatelessBean in project tomee by apache.

the class SimpleCdiTest method setUp.

@Before
public void setUp() throws Exception {
    final ConfigurationFactory config = new ConfigurationFactory();
    final Assembler assembler = new Assembler();
    assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
    assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new StatelessBean(Echo.class));
    final Beans beans = new Beans();
    beans.addInterceptor(EchoInterceptor.class);
    beans.addDecorator(EchoDecorator.class);
    beans.addManagedClass(SimpleModel.class);
    beans.addManagedClass(ProducesEjbInjector.class);
    final EjbModule module = new EjbModule(ejbJar);
    module.setBeans(beans);
    assembler.createApplication(config.configureApplication(module));
    final Properties properties = new Properties(System.getProperties());
    properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, InitContextFactory.class.getName());
    ctx = new InitialContext(properties);
}
Also used : Beans(org.apache.openejb.jee.Beans) TransactionServiceInfo(org.apache.openejb.assembler.classic.TransactionServiceInfo) StatelessBean(org.apache.openejb.jee.StatelessBean) ConfigurationFactory(org.apache.openejb.config.ConfigurationFactory) EjbModule(org.apache.openejb.config.EjbModule) InitContextFactory(org.apache.openejb.core.ivm.naming.InitContextFactory) Assembler(org.apache.openejb.assembler.classic.Assembler) Properties(java.util.Properties) SecurityServiceInfo(org.apache.openejb.assembler.classic.SecurityServiceInfo) InitialContext(javax.naming.InitialContext) EjbJar(org.apache.openejb.jee.EjbJar) Before(org.junit.Before)

Example 79 with StatelessBean

use of org.apache.openejb.jee.StatelessBean in project tomee by apache.

the class BeanValidationTest method app.

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

use of org.apache.openejb.jee.StatelessBean in project tomee by apache.

the class AbstractCDIInjectionTest method app.

@Module
public EjbModule app() throws Exception {
    final StatelessBean bean = new StatelessBean(AppJpaDAO.class);
    bean.setLocalBean(new Empty());
    final StatelessBean test = new StatelessBean(AppCDI.class);
    bean.setLocalBean(new Empty());
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(bean);
    ejbJar.addEnterpriseBean(test);
    final Beans beans = new Beans();
    beans.addManagedClass(PlcBaseDAO.class);
    beans.addManagedClass(PlcBaseJpaDAO.class);
    final EjbModule jar = new EjbModule(ejbJar);
    jar.setBeans(beans);
    return jar;
}
Also used : Empty(org.apache.openejb.jee.Empty) Beans(org.apache.openejb.jee.Beans) StatelessBean(org.apache.openejb.jee.StatelessBean) EjbModule(org.apache.openejb.config.EjbModule) EjbJar(org.apache.openejb.jee.EjbJar) EjbModule(org.apache.openejb.config.EjbModule) Module(org.apache.openejb.testing.Module)

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