use of org.apache.openejb.testing.Module in project tomee by apache.
the class MoviesTest method persistence.
@Module
public PersistenceUnit persistence() {
PersistenceUnit unit = new PersistenceUnit("movie-unit");
unit.setJtaDataSource("movieDatabase");
unit.setNonJtaDataSource("movieDatabaseUnmanaged");
unit.getClazz().add(Movie.class.getName());
unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
return unit;
}
use of org.apache.openejb.testing.Module in project tomee by apache.
the class CustomEndpointConfiguratorTest method module.
@Module
public EjbModule module() {
final EjbModule module = new EjbModule(new EjbJar());
module.setOpenejbJar(new OpenejbJar());
final SingletonBean bean = new SingletonBean(MyWebservice.class);
bean.setLocalBean(new Empty());
final EjbDeployment deployment = new EjbDeployment(bean);
deployment.getProperties().setProperty("openejb.endpoint.configurator", CustomConfigurator.class.getName());
module.getOpenejbJar().addEjbDeployment(deployment);
module.getEjbJar().addEnterpriseBean(bean);
return module;
}
use of org.apache.openejb.testing.Module 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.Module 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;
}
use of org.apache.openejb.testing.Module in project tomee by apache.
the class CustomContextTest method service.
@Module
public static EjbModule service() throws Exception {
final EjbModule module = new EjbModule(new EjbJar(), new OpenejbJar());
final SingletonBean bean = new SingletonBean(CustomContextInjectedBean.class);
bean.setLocalBean(new Empty());
module.getEjbJar().addEnterpriseBean(bean);
final PojoDeployment e = new PojoDeployment();
e.setClassName("jaxrs-application");
e.getProperties().setProperty("cxf.jaxrs.providers", CustomProvider.class.getName());
module.getOpenejbJar().getPojoDeployment().add(e);
return module;
}
Aggregations