Search in sources :

Example 11 with Classes

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

the class WsJMXTest method war.

@Module
@Classes({ AnEjbEndpoint.class, AnPojoEndpoint.class })
public WebApp war() {
    final WebApp webapp = new WebApp().contextRoot("app");
    Servlet servlet = new Servlet();
    servlet.setServletName("toto");
    servlet.setServletClass(AnPojoEndpoint.class.getName());
    ServletMapping servletMapping = new ServletMapping();
    servletMapping.setServletName("pojo");
    servletMapping.getUrlPattern().add("/toto");
    webapp.getServlet().add(servlet);
    webapp.getServletMapping().add(servletMapping);
    return webapp;
}
Also used : ServletMapping(org.apache.openejb.jee.ServletMapping) Servlet(org.apache.openejb.jee.Servlet) WebApp(org.apache.openejb.jee.WebApp) Module(org.apache.openejb.testing.Module) Classes(org.apache.openejb.testing.Classes)

Example 12 with Classes

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

the class CheckedExceptionMapperTest method module.

@Module
@Classes({ ExampleExceptionMapper.class })
public EjbModule module() {
    final SingletonBean bean = new SingletonBean(ExampleRest.class);
    bean.setRestService(true);
    final EjbJar ejbJar = new EjbJar("beans");
    ejbJar.addEnterpriseBean(bean);
    final OpenejbJar openejbJar = new OpenejbJar();
    openejbJar.addEjbDeployment(new EjbDeployment(bean));
    final Properties properties = openejbJar.getEjbDeployment().iterator().next().getProperties();
    properties.setProperty("cxf.jaxrs.providers", "org.apache.openejb.server.cxf.rs.CheckedExceptionMapperTest$ExampleExceptionMapper");
    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) Classes(org.apache.openejb.testing.Classes)

Aggregations

Classes (org.apache.openejb.testing.Classes)12 Module (org.apache.openejb.testing.Module)10 EjbModule (org.apache.openejb.config.EjbModule)5 EjbJar (org.apache.openejb.jee.EjbJar)5 WebApp (org.apache.openejb.jee.WebApp)3 Method (java.lang.reflect.Method)2 Properties (java.util.Properties)2 ActivationConfig (org.apache.openejb.jee.ActivationConfig)2 Empty (org.apache.openejb.jee.Empty)2 MessageDrivenBean (org.apache.openejb.jee.MessageDrivenBean)2 StatelessBean (org.apache.openejb.jee.StatelessBean)2 EjbDeployment (org.apache.openejb.jee.oejb3.EjbDeployment)2 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)2 AnnotationFinder (org.apache.xbean.finder.AnnotationFinder)2 ClassesArchive (org.apache.xbean.finder.archive.ClassesArchive)2 Closeable (java.io.Closeable)1 File (java.io.File)1 IOException (java.io.IOException)1 Field (java.lang.reflect.Field)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1