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;
}
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;
}
Aggregations