Package org.apache.aries.blueprint.parser

Examples of org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl


        assertEquals("pojoA", bean.getName());
    }

    public void testIdRefs() throws Exception {
        ComponentDefinitionRegistryImpl registry = parse("/test-bad-id-ref.xml");

        try {
            new TestBlueprintContainer(registry).getRepository();
            fail("Did not throw exception");
        } catch (RuntimeException e) {
View Full Code Here


    }
   
    public void testDependencies() throws Exception {
        CallbackTracker.clear();

        ComponentDefinitionRegistryImpl registry = parse("/test-depends-on.xml");
        Repository repository = new TestBlueprintContainer(registry).getRepository();
        Map instances = repository.createAll(Arrays.asList("c", "d", "e"), ProxyUtils.asList(Object.class));
       
        List<Callback> callback = CallbackTracker.getCallbacks();
        assertEquals(3, callback.size());
View Full Code Here

        assertEquals(Callback.DESTROY, callback.getType());
        assertEquals(obj, callback.getObject());
    }
   
    public void testConstructor() throws Exception {
        ComponentDefinitionRegistryImpl registry = parse("/test-constructor.xml");
        Repository repository = new TestBlueprintContainer(registry).getRepository();

        Object obj1 = repository.create("pojoA");
        assertNotNull(obj1);
        assertTrue(obj1 instanceof PojoA);
View Full Code Here

       assertTrue(obj instanceof Multiple);
       assertEquals(map, ((Multiple)obj).getProperties());
   }

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

        List<Integer> expectedList = new ArrayList<Integer>();
        expectedList.add(new Integer(10));
        expectedList.add(new Integer(20));
View Full Code Here

        repository = createBlueprintContainer().getRepository();       
        assertNotNull(repository.create("c3"));
    }
   
    private TestBlueprintContainer createBlueprintContainer() throws Exception {
        ComponentDefinitionRegistryImpl registry = parse("/test-circular.xml");
        return new TestBlueprintContainer(registry);
    }
View Full Code Here

    NamespaceHandlerSet nshandlers = _namespaceHandlerRegistry.getNamespaceHandlers(nsuris, clientBundle);
    try {
        if (validate) {
          parser.validate( nshandlers.getSchema());
        }
        cdr = new ComponentDefinitionRegistryImpl();
        parser.populate(nshandlers, cdr);
    } finally {
        nshandlers.destroy();
    }
   
View Full Code Here

        this.extenderBundle = extenderBundle;
        this.eventDispatcher = eventDispatcher;
        this.handlers = handlers;
        this.pathList = pathList;
        this.converter = new AggregateConverter(this);
        this.componentDefinitionRegistry = new ComponentDefinitionRegistryImpl();
        this.executors = executors;
        this.processors = new ArrayList<Processor>();
        if (System.getSecurityManager() != null) {
            this.accessControlContext = createAccessControlContext();
        }
View Full Code Here

import org.osgi.service.blueprint.container.ComponentDefinitionException;

public class WiringTest extends AbstractBlueprintTest {

    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);
View Full Code Here

        // test destroy-method
        assertEquals(true, pojob.getDestroyCalled());
    }
   
    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());
       
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);
View Full Code Here

TOP

Related Classes of org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl

Copyright © 2018 www.massapicom. 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.