Search in sources :

Example 36 with Module

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

the class CdiPasswordCipherTest method resources.

@Module
public Resources resources() {
    final Resource resource = new Resource();
    resource.setClassName(AResource.class.getName());
    resource.setId("the");
    resource.getProperties().setProperty("thePassword", "cipher:cdi:" + AdvancedAlgorithm.class.getName() + ":this");
    final Resources resources = new Resources();
    resources.getResource().add(resource);
    return resources;
}
Also used : Resource(org.apache.openejb.config.sys.Resource) Resources(org.apache.openejb.config.sys.Resources) Module(org.apache.openejb.testing.Module)

Example 37 with Module

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

the class ConnectorProxyNoNoArgConstructorTest method connector.

@Module
public Connector connector() {
    final ConnectionDefinition connectionDefinition = new ConnectionDefinition();
    connectionDefinition.setId("cf");
    connectionDefinition.setConnectionImplClass(MyCon.class.getName());
    connectionDefinition.setConnectionInterface(MyConAPI.class.getName());
    connectionDefinition.setConnectionFactoryImplClass(MyMcf.class.getName());
    connectionDefinition.setConnectionFactoryInterface(ConnectionFactory.class.getName());
    connectionDefinition.setManagedConnectionFactoryClass(MyMcf.class.getName());
    final OutboundResourceAdapter out = new OutboundResourceAdapter();
    out.getConnectionDefinition().add(connectionDefinition);
    final ResourceAdapter ra = new ResourceAdapter();
    ra.setResourceAdapterClass(MyRa.class.getName());
    ra.setOutboundResourceAdapter(out);
    final Connector connector = new Connector();
    connector.setVersion("1.7");
    connector.setResourceAdapter(ra);
    return connector;
}
Also used : Connector(org.apache.openejb.jee.Connector) ConnectionFactory(javax.resource.cci.ConnectionFactory) ManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory) ConnectionDefinition(org.apache.openejb.jee.ConnectionDefinition) OutboundResourceAdapter(org.apache.openejb.jee.OutboundResourceAdapter) ResourceAdapter(org.apache.openejb.jee.ResourceAdapter) OutboundResourceAdapter(org.apache.openejb.jee.OutboundResourceAdapter) Module(org.apache.openejb.testing.Module)

Example 38 with Module

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

the class ConnectorProxyTest method connector.

@Module
public Connector connector() {
    final ConnectionDefinition connectionDefinition = new ConnectionDefinition();
    connectionDefinition.setId("cf");
    connectionDefinition.setConnectionImplClass(MyCon.class.getName());
    connectionDefinition.setConnectionInterface(MyConAPI.class.getName());
    connectionDefinition.setConnectionFactoryImplClass(MyMcf.class.getName());
    connectionDefinition.setConnectionFactoryInterface(ConnectionFactory.class.getName());
    connectionDefinition.setManagedConnectionFactoryClass(MyMcf.class.getName());
    final OutboundResourceAdapter out = new OutboundResourceAdapter();
    out.getConnectionDefinition().add(connectionDefinition);
    final ResourceAdapter ra = new ResourceAdapter();
    ra.setResourceAdapterClass(MyRa.class.getName());
    ra.setOutboundResourceAdapter(out);
    final Connector connector = new Connector();
    connector.setVersion("1.7");
    connector.setResourceAdapter(ra);
    return connector;
}
Also used : Connector(org.apache.openejb.jee.Connector) ConnectionFactory(javax.resource.cci.ConnectionFactory) ManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory) ConnectionDefinition(org.apache.openejb.jee.ConnectionDefinition) OutboundResourceAdapter(org.apache.openejb.jee.OutboundResourceAdapter) ResourceAdapter(org.apache.openejb.jee.ResourceAdapter) OutboundResourceAdapter(org.apache.openejb.jee.OutboundResourceAdapter) Module(org.apache.openejb.testing.Module)

Example 39 with Module

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

the class EntitiesScanningPackageLimitedTest method persistence.

@Module
public Persistence persistence() {
    final org.apache.openejb.jee.jpa.unit.PersistenceUnit unit = new org.apache.openejb.jee.jpa.unit.PersistenceUnit("jpa-global-dsdef-unit");
    unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
    unit.getProperties().setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
    unit.getProperties().setProperty("openejb.jpa.auto-scan", "true");
    unit.getProperties().setProperty("openejb.jpa.auto-scan.package", "com.doesnt.exist");
    final Persistence persistence = new Persistence(unit);
    persistence.setVersion("2.0");
    return persistence;
}
Also used : Persistence(org.apache.openejb.jee.jpa.unit.Persistence) PersistenceUnit(javax.persistence.PersistenceUnit) Module(org.apache.openejb.testing.Module)

Example 40 with Module

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

the class ParseAppCtxXmlTest method module.

@Module
public AppModule module() {
    final AppModule app = new AppModule(ParseAppCtxXmlTest.class.getClassLoader(), "");
    app.getAltDDs().put("app-ctx.xml", ParseAppCtxXmlTest.class.getClassLoader().getResource("complete-app-ctx.xml"));
    app.getEjbModules().add(ejbModule("1"));
    app.getEjbModules().iterator().next().getEjbJar().addEnterpriseBean(new SingletonBean("CalculatorBean", CalculatorConfigured.class.getName()));
    app.getEjbModules().add(ejbModule("2"));
    app.getEjbModules().get(1).getEjbJar().addEnterpriseBean(new SingletonBean("BeanInAModule", CalculatorConfigured2.class.getName()));
    return app;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) AppModule(org.apache.openejb.config.AppModule) EjbModule(org.apache.openejb.config.EjbModule) AppModule(org.apache.openejb.config.AppModule) 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