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