Package org.apache.aries.blueprint.di

Examples of org.apache.aries.blueprint.di.Repository.create()


    public void testLoadSimpleBeanNested() throws Exception {
        ComponentDefinitionRegistryImpl registry = parse("/test-bean-classes.xml");
        Repository repository = new TestBlueprintContainer(registry)
                .getRepository();

        Object obj = repository.create("simpleBeanNested");
        assertNotNull(obj);
        assertTrue(obj instanceof SimpleBean.Nested);
    }
}
View Full Code Here


    public void testWiring() throws Exception {
        ComponentDefinitionRegistryImpl registry = parse("/test-wiring.xml");
        Repository repository = new TestBlueprintContainer(registry).getRepository();
       
        Object obj1 = repository.create("pojoA");
        assertNotNull(obj1);
        assertTrue(obj1 instanceof PojoA);
        PojoA pojoa = (PojoA) obj1;
        // test singleton scope
        assertTrue(obj1 == repository.create("pojoA"));
View Full Code Here

        Object obj1 = repository.create("pojoA");
        assertNotNull(obj1);
        assertTrue(obj1 instanceof PojoA);
        PojoA pojoa = (PojoA) obj1;
        // test singleton scope
        assertTrue(obj1 == repository.create("pojoA"));
       
        Object obj2 = repository.create("pojoB");
        assertNotNull(obj2);
        assertTrue(obj2 instanceof PojoB);
        PojoB pojob = (PojoB) obj2;
View Full Code Here

        assertTrue(obj1 instanceof PojoA);
        PojoA pojoa = (PojoA) obj1;
        // test singleton scope
        assertTrue(obj1 == repository.create("pojoA"));
       
        Object obj2 = repository.create("pojoB");
        assertNotNull(obj2);
        assertTrue(obj2 instanceof PojoB);
        PojoB pojob = (PojoB) obj2;
       
        assertNotNull(pojoa.getPojob());
View Full Code Here

       
        // test init-method
        assertEquals(true, pojob.getInitCalled());
       
        // test service
        Object obj3 = repository.create("service1");
        assertNotNull(obj3);
        assertTrue(obj3 instanceof ServiceRegistration);   

        ExecutionContext.Holder.setContext((ExecutionContext) repository);
        for(Recipe r : ((ServiceRecipe)repository.getRecipe("service1")).getDependencies()) {
View Full Code Here

          }
        }
        ExecutionContext.Holder.setContext(null);
       
        // tests 'prototype' scope
        Object obj4 = repository.create("pojoC");
        assertNotNull(obj4);
       
        assertTrue(obj4 != repository.create("pojoC"));
       
        repository.destroy();
View Full Code Here

       
        // tests 'prototype' scope
        Object obj4 = repository.create("pojoC");
        assertNotNull(obj4);
       
        assertTrue(obj4 != repository.create("pojoC"));
       
        repository.destroy();
       
        // test destroy-method
        assertEquals(true, pojob.getDestroyCalled());
View Full Code Here

   
    public void testSetterDisambiguation() throws Exception {
        ComponentDefinitionRegistryImpl registry = parse("/test-wiring.xml");
        Repository repository = new TestBlueprintContainer(registry).getRepository();

        AmbiguousPojo pojo = (AmbiguousPojo) repository.create("ambiguousViaInt");
        assertEquals(5, pojo.getSum());
       
        pojo = (AmbiguousPojo) repository.create("ambiguousViaList");
        assertEquals(7, pojo.getSum());
       
View Full Code Here

        Repository repository = new TestBlueprintContainer(registry).getRepository();

        AmbiguousPojo pojo = (AmbiguousPojo) repository.create("ambiguousViaInt");
        assertEquals(5, pojo.getSum());
       
        pojo = (AmbiguousPojo) repository.create("ambiguousViaList");
        assertEquals(7, pojo.getSum());
       
       
    }
   
View Full Code Here

   
    public void testFieldInjection() throws Exception {
      ComponentDefinitionRegistryImpl registry = parse("/test-wiring.xml");
      Repository repository = new TestBlueprintContainer(registry).getRepository();
     
      Object fiTestBean = repository.create("FITestBean");
      assertNotNull(fiTestBean);
      assertTrue(fiTestBean instanceof FITestBean);
     
      FITestBean bean = (FITestBean) fiTestBean;
      // single field injection
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.