Search in sources :

Example 86 with Module

use of org.apache.openejb.testing.Module in project tomee by apache.

the class GreetingServiceTest method app.

@Module
public EjbModule app() {
    final SingletonBean bean = (SingletonBean) new SingletonBean(GreetingService.class).localBean();
    bean.setRestService(true);
    // now create an ejbjar and an openejb-jar to hold the provider config
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(bean);
    final OpenejbJar openejbJar = new OpenejbJar();
    openejbJar.addEjbDeployment(new EjbDeployment(ejbJar.getEnterpriseBeans()[0]));
    final Properties properties = openejbJar.getEjbDeployment().iterator().next().getProperties();
    properties.setProperty("cxf.jaxrs.providers", IllegalArgumentExceptionMapper.class.getName());
    // link all and return this module
    final EjbModule module = new EjbModule(ejbJar);
    module.setOpenejbJar(openejbJar);
    return module;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) OpenejbJar(org.apache.openejb.jee.oejb3.OpenejbJar) EjbModule(org.apache.openejb.config.EjbModule) EjbDeployment(org.apache.openejb.jee.oejb3.EjbDeployment) Properties(java.util.Properties) EjbJar(org.apache.openejb.jee.EjbJar) EjbModule(org.apache.openejb.config.EjbModule) Module(org.apache.openejb.testing.Module)

Aggregations

Module (org.apache.openejb.testing.Module)86 EjbJar (org.apache.openejb.jee.EjbJar)30 StatelessBean (org.apache.openejb.jee.StatelessBean)25 Empty (org.apache.openejb.jee.Empty)19 EjbModule (org.apache.openejb.config.EjbModule)18 Persistence (org.apache.openejb.jee.jpa.unit.Persistence)18 PersistenceUnit (org.apache.openejb.jee.jpa.unit.PersistenceUnit)17 SingletonBean (org.apache.openejb.jee.SingletonBean)16 Beans (org.apache.openejb.jee.Beans)13 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)9 Classes (org.apache.openejb.testing.Classes)9 AppModule (org.apache.openejb.config.AppModule)6 PojoDeployment (org.apache.openejb.jee.oejb3.PojoDeployment)5 Properties (java.util.Properties)4 WebModule (org.apache.openejb.config.WebModule)4 Resources (org.apache.openejb.config.sys.Resources)4 Service (org.apache.openejb.config.sys.Service)4 AssemblyDescriptor (org.apache.openejb.jee.AssemblyDescriptor)4 Interceptor (org.apache.openejb.jee.Interceptor)4 InterceptorBinding (org.apache.openejb.jee.InterceptorBinding)4