Search in sources :

Example 6 with Resources

use of org.apache.openejb.config.sys.Resources 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 7 with Resources

use of org.apache.openejb.config.sys.Resources in project tomee by apache.

the class AppContainerTest method resources.

@org.apache.openejb.testing.Module
public Resources resources() {
    final Resources resources = new Resources();
    final Container container = new Container();
    container.setId("theMine");
    container.setType("SINGLETON");
    container.setClassName("org.apache.openejb.config.AppContainerTest$MySingletonContainer");
    resources.getContainer().add(container);
    return resources;
}
Also used : SingletonContainer(org.apache.openejb.core.singleton.SingletonContainer) Container(org.apache.openejb.config.sys.Container) Resources(org.apache.openejb.config.sys.Resources)

Example 8 with Resources

use of org.apache.openejb.config.sys.Resources in project tomee by apache.

the class ReadDescriptorsTest method testClassNotAvailable.

@Test
public void testClassNotAvailable() {
    final Resource resource = new Resource();
    resource.setClassName("not.a.real.Class");
    final Resources resources = new Resources();
    resources.add(resource);
    final Resources checkedResources = ReadDescriptors.check(resources);
    final Resource res = checkedResources.getResource().get(0);
    Assert.assertEquals("true", res.getProperties().getProperty("Lazy"));
    Assert.assertEquals("true", res.getProperties().getProperty("UseAppClassLoader"));
    Assert.assertEquals("true", res.getProperties().getProperty("InitializeAfterDeployment"));
}
Also used : Resource(org.apache.openejb.config.sys.Resource) Resources(org.apache.openejb.config.sys.Resources) Test(org.junit.Test)

Example 9 with Resources

use of org.apache.openejb.config.sys.Resources in project tomee by apache.

the class ReadDescriptorsTest method testClassAvailable.

@Test
public void testClassAvailable() {
    final Resource resource = new Resource();
    resource.setClassName("org.apache.openejb.config.ReadDescriptorsTest");
    final Resources resources = new Resources();
    resources.add(resource);
    final Resources checkedResources = ReadDescriptors.check(resources);
    final Resource res = checkedResources.getResource().get(0);
    Assert.assertNull(res.getProperties().getProperty("Lazy"));
    Assert.assertNull(res.getProperties().getProperty("UseAppClassLoader"));
    Assert.assertNull(res.getProperties().getProperty("InitializeAfterDeployment"));
}
Also used : Resource(org.apache.openejb.config.sys.Resource) Resources(org.apache.openejb.config.sys.Resources) Test(org.junit.Test)

Example 10 with Resources

use of org.apache.openejb.config.sys.Resources in project tomee by apache.

the class ReadDescriptorsTest method testClassAndTypeAvailable.

@Test
public void testClassAndTypeAvailable() {
    final Resource resource = new Resource();
    resource.setClassName("org.apache.openejb.config.ReadDescriptorsTest");
    final Resources resources = new Resources();
    resources.add(resource);
    final Resources checkedResources = ReadDescriptors.check(resources);
    final Resource res = checkedResources.getResource().get(0);
    Assert.assertNull(res.getProperties().getProperty("Lazy"));
    Assert.assertNull(res.getProperties().getProperty("UseAppClassLoader"));
    Assert.assertNull(res.getProperties().getProperty("InitializeAfterDeployment"));
}
Also used : Resource(org.apache.openejb.config.sys.Resource) Resources(org.apache.openejb.config.sys.Resources) Test(org.junit.Test)

Aggregations

Resources (org.apache.openejb.config.sys.Resources)13 EjbModule (org.apache.openejb.config.EjbModule)6 EjbJar (org.apache.openejb.jee.EjbJar)6 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)6 Resource (org.apache.openejb.config.sys.Resource)5 Service (org.apache.openejb.config.sys.Service)5 Properties (java.util.Properties)4 EnterpriseBean (org.apache.openejb.jee.EnterpriseBean)4 SingletonBean (org.apache.openejb.jee.SingletonBean)4 PojoDeployment (org.apache.openejb.jee.oejb3.PojoDeployment)4 Module (org.apache.openejb.testing.Module)4 Test (org.junit.Test)3 File (java.io.File)2 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 JAXBElementProvider (org.apache.cxf.jaxrs.provider.JAXBElementProvider)2 Application (org.apache.openejb.jee.Application)2