Search in sources :

Example 66 with Module

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

the class FeatureTest method app.

@Module
public EjbModule app() {
    final StatelessBean bean = (StatelessBean) new StatelessBean(MySecondRestClass.class).localBean();
    bean.setRestService(true);
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(bean);
    final OpenejbJar openejbJar = new OpenejbJar();
    final PojoDeployment e = new PojoDeployment();
    openejbJar.getPojoDeployment().add(e);
    e.setClassName("jaxrs-application");
    final Properties properties = e.getProperties();
    properties.setProperty(CxfRsHttpListener.CXF_JAXRS_PREFIX + CxfUtil.FEATURES, "my-feature");
    final EjbModule module = new EjbModule(ejbJar);
    module.setOpenejbJar(openejbJar);
    final Resources resources = new Resources();
    final Service feature = new Service("my-feature", null);
    feature.setClassName(MyFeature.class.getName());
    resources.getService().add(feature);
    module.initResources(resources);
    return module;
}
Also used : OpenejbJar(org.apache.openejb.jee.oejb3.OpenejbJar) StatelessBean(org.apache.openejb.jee.StatelessBean) EjbModule(org.apache.openejb.config.EjbModule) Service(org.apache.openejb.config.sys.Service) PojoDeployment(org.apache.openejb.jee.oejb3.PojoDeployment) Resources(org.apache.openejb.config.sys.Resources) Properties(java.util.Properties) EjbJar(org.apache.openejb.jee.EjbJar) EjbModule(org.apache.openejb.config.EjbModule) Module(org.apache.openejb.testing.Module)

Example 67 with Module

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

the class RsInjectionTest method service.

@Module
public static SingletonBean service() throws Exception {
    final SingletonBean bean = new SingletonBean(RsInjection.class);
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) Empty(org.apache.openejb.jee.Empty) Module(org.apache.openejb.testing.Module)

Example 68 with Module

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

the class RsInterceptorInjectionTest method service.

@Module
public static SingletonBean service() throws Exception {
    final SingletonBean bean = new SingletonBean(RsInjection.class);
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) Empty(org.apache.openejb.jee.Empty) Module(org.apache.openejb.testing.Module)

Example 69 with Module

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

the class SimplePojoTest method war.

@Module
@Classes(cdi = true, value = { MyFirstRestClass.class })
public WebModule war() {
    final WebModule webModule = new WebModule(new WebApp(), "/foo", Thread.currentThread().getContextClassLoader(), "", "foo");
    webModule.getRestClasses().add(MyFirstRestClass.class.getName());
    return webModule;
}
Also used : MyFirstRestClass(org.apache.openejb.server.cxf.rs.beans.MyFirstRestClass) WebModule(org.apache.openejb.config.WebModule) WebApp(org.apache.openejb.jee.WebApp) WebModule(org.apache.openejb.config.WebModule) Module(org.apache.openejb.testing.Module) Classes(org.apache.openejb.testing.Classes)

Example 70 with Module

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

the class AppExceptionTest method jar.

@Module
public EjbJar jar() {
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(new SingletonBean(Ejb.class).localBean());
    return ejbJar;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) EjbJar(org.apache.openejb.jee.EjbJar) 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