Package org.apache.aries.blueprint.parser

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


          Assert.fail("Expected exception");
      } catch (ComponentDefinitionException cde) {}
    }
   
    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);
View Full Code Here


        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"));
       
        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

        assertEquals(stringValue, ((Multiple)obj).getString());
        assertEquals(integerValue, ((Multiple)obj).getInteger());       
    }

    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

        };
        return parse(name, handlers);
    }

    protected ComponentDefinitionRegistryImpl parse(String name, NamespaceHandlerSet handlers) throws Exception {
        ComponentDefinitionRegistryImpl registry = new ComponentDefinitionRegistryImpl();
        Parser parser = new Parser();
        parser.parse(Collections.singletonList(getClass().getResource(name)));
        parser.populate(handlers, registry);
        return registry;
    }
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 = BlueprintDomainCombiner.createAccessControlContext(bundleContext);
        }
View Full Code Here

      parser.parse(blueprintToParse);
      return getCDR(parser);
    }
   
    private ComponentDefinitionRegistry getCDR(Parser parser) {
      ComponentDefinitionRegistry cdr = new ComponentDefinitionRegistryImpl();
      parser.populate(DUMMY_HANDLER_SET, cdr);
      return cdr;     
    }
View Full Code Here

       
        Set<URI> nsuris = p.getNamespaces();
        NamespaceHandlerSet nshandlers = nhri.getNamespaceHandlers(nsuris, b);
        p.validate(nshandlers.getSchema());
       
        ComponentDefinitionRegistry cdr = new ComponentDefinitionRegistryImpl();
        cdr.registerComponentDefinition(new PassThroughMetadataImpl("blueprintBundle", b));
        p.populate(nshandlers, cdr);
       
        return cdr;
    }
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.