Examples of BlueprintRepository


Examples of org.apache.aries.blueprint.container.BlueprintRepository

        assertTrue(obj instanceof Primavera);
        assertEquals("stringToo", ((Primavera) obj).prop);
    }
   
    public void testCircular() throws Exception {
        BlueprintRepository repository = createBlueprintContainer().getRepository();

        // this should pass (we allow circular dependencies for components without init method)
        Object obj1 = repository.create("a");
               
        // test service and listener circular dependencies
        Object obj2 = repository.create("service");
        assertNotNull(obj2);
        assertTrue(obj2 instanceof ServiceRegistration);
       
        Object obj3 = repository.create("listener");
        assertNotNull(obj3);
        assertTrue(obj3 instanceof PojoListener);
       
        assertEquals(obj2, ((PojoListener) obj3).getService() );       
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

       
        assertEquals(obj2, ((PojoListener) obj3).getService() );       
    }
    
    public void testCircularPrototype() throws Exception {
        BlueprintRepository repository = createBlueprintContainer().getRepository();
       
        try {
            repository.create("circularPrototypeDriver");
            fail("Did not throw exception")
        } catch (CircularDependencyException e) {
            // that's what we expect
        }

        try {
            repository.create("circularPrototype");
            fail("Did not throw exception")
        } catch (CircularDependencyException e) {
            // that's what we expect
        }
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

            // that's what we expect
        }
    }
   
    public void testRecursive() throws Exception {
        BlueprintRepository repository = createBlueprintContainer().getRepository();
       
        try {
            repository.create("recursiveConstructor");
            fail("Did not throw exception");          
        } catch (ComponentDefinitionException e) {
            if (e.getCause() instanceof CircularDependencyException) {                         
                // that's what we expect
            } else {
                fail("Did not throw expected exception");
                throw e;
            }
        }
       
        PojoRecursive pojo;
       
        pojo = (PojoRecursive) repository.create("recursiveSetter");
        assertNotNull(pojo);
                          
        pojo = (PojoRecursive) repository.create("recursiveInitMethod");
        assertNotNull(pojo);
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

        pojo = (PojoRecursive) repository.create("recursiveInitMethod");
        assertNotNull(pojo);
    }
   
    public void testCircularBreaking() throws Exception {
        BlueprintRepository repository;
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c1"));
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c2"));
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c3"));
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

        assertTrue(obj instanceof Primavera);
        assertEquals("stringToo", ((Primavera) obj).prop);
    }
   
    public void testCircular() throws Exception {
        BlueprintRepository repository = createBlueprintContainer().getRepository();

        // this should pass (we allow circular dependencies for components without init method)
        Object obj1 = repository.create("a");
               
        // test service and listener circular dependencies
        Object obj2 = repository.create("service");
        assertNotNull(obj2);
        assertTrue(obj2 instanceof ServiceRegistration);
       
        Object obj3 = repository.create("listener");
        assertNotNull(obj3);
        assertTrue(obj3 instanceof PojoListener);
       
        assertEquals(obj2, ((PojoListener) obj3).getService() );       
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

       
        assertEquals(obj2, ((PojoListener) obj3).getService() );       
    }
    
    public void testCircularPrototype() throws Exception {
        BlueprintRepository repository = createBlueprintContainer().getRepository();
       
        try {
            repository.create("circularPrototypeDriver");
            fail("Did not throw exception")
        } catch (CircularDependencyException e) {
            // that's what we expect
        }

        try {
            repository.create("circularPrototype");
            fail("Did not throw exception")
        } catch (CircularDependencyException e) {
            // that's what we expect
        }
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

            // that's what we expect
        }
    }
   
    public void testRecursive() throws Exception {
        BlueprintRepository repository = createBlueprintContainer().getRepository();
       
        try {
            repository.create("recursiveConstructor");
            fail("Did not throw exception");          
        } catch (ComponentDefinitionException e) {
            if (e.getCause() instanceof CircularDependencyException) {                         
                // that's what we expect
            } else {
                fail("Did not throw expected exception");
                throw e;
            }
        }
       
        PojoRecursive pojo;
       
        pojo = (PojoRecursive) repository.create("recursiveSetter");
        assertNotNull(pojo);
                          
        pojo = (PojoRecursive) repository.create("recursiveInitMethod");
        assertNotNull(pojo);
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

        pojo = (PojoRecursive) repository.create("recursiveInitMethod");
        assertNotNull(pojo);
    }
   
    public void testCircularBreaking() throws Exception {
        BlueprintRepository repository;
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c1"));
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c2"));
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c3"));
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

        pojo = (PojoRecursive) repository.create("recursiveInitMethod");
        assertNotNull(pojo);
    }
   
    public void testCircularBreaking() throws Exception {
        BlueprintRepository repository;
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c1"));
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c2"));
       
        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c3"));
    }
View Full Code Here

Examples of org.apache.aries.blueprint.container.BlueprintRepository

        assertTrue(obj instanceof Primavera);
        assertEquals("stringToo", ((Primavera) obj).prop);
    }
   
    public void testCircular() throws Exception {
        BlueprintRepository repository = createBlueprintContainer().getRepository();

        // this should pass (we allow circular dependencies for components without init method)
        Object obj1 = repository.create("a");
               
        // test service and listener circular dependencies
        Object obj2 = repository.create("service");
        assertNotNull(obj2);
        assertTrue(obj2 instanceof ServiceRegistration);
       
        Object obj3 = repository.create("listener");
        assertNotNull(obj3);
        assertTrue(obj3 instanceof PojoListener);
       
        assertEquals(obj2, ((PojoListener) obj3).getService() );       
    }
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.