Search in sources :

Example 1 with BeanD

use of org.apache.aries.blueprint.pojos.BeanD in project aries by apache.

the class ExtPlaceholderTest method testStaticValues.

@Test
public void testStaticValues() throws Exception {
    ComponentDefinitionRegistryImpl registry = parse("/test-staticvalues.xml");
    Repository repository = new TestBlueprintContainer(registry).getRepository();
    Object obj1 = repository.create("beanD");
    assertNotNull(obj1);
    assertTrue(obj1 instanceof BeanD);
    BeanD beanD = (BeanD) obj1;
    assertEquals(ExtNamespaceHandler.BLUEPRINT_EXT_NAMESPACE_V1_5, beanD.getName());
}
Also used : Repository(org.apache.aries.blueprint.di.Repository) BeanD(org.apache.aries.blueprint.pojos.BeanD) ComponentDefinitionRegistryImpl(org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl) Test(org.junit.Test)

Example 2 with BeanD

use of org.apache.aries.blueprint.pojos.BeanD in project aries by apache.

the class WiringTest method testCompoundProperties.

public void testCompoundProperties() throws Exception {
    ComponentDefinitionRegistryImpl registry = parse("/test-wiring.xml");
    Repository repository = new TestBlueprintContainer(registry).getRepository();
    Object obj5 = repository.create("compound");
    assertNotNull(obj5);
    assertTrue(obj5 instanceof PojoB);
    PojoB pojob = (PojoB) obj5;
    assertEquals("hello bean property", pojob.getBean().getName());
    Object obj = repository.create("goodIdRef");
    assertNotNull(obj);
    assertTrue(obj instanceof BeanD);
    BeanD bean = (BeanD) obj;
    assertEquals("pojoA", bean.getName());
}
Also used : Repository(org.apache.aries.blueprint.di.Repository) BlueprintRepository(org.apache.aries.blueprint.container.BlueprintRepository) PojoB(org.apache.aries.blueprint.pojos.PojoB) BeanD(org.apache.aries.blueprint.pojos.BeanD) MyObject(org.apache.aries.blueprint.pojos.PojoGenerics2.MyObject) ComponentDefinitionRegistryImpl(org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl)

Aggregations

Repository (org.apache.aries.blueprint.di.Repository)2 ComponentDefinitionRegistryImpl (org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl)2 BeanD (org.apache.aries.blueprint.pojos.BeanD)2 BlueprintRepository (org.apache.aries.blueprint.container.BlueprintRepository)1 PojoB (org.apache.aries.blueprint.pojos.PojoB)1 MyObject (org.apache.aries.blueprint.pojos.PojoGenerics2.MyObject)1 Test (org.junit.Test)1