Package org.apache.tuscany.spi.component

Examples of org.apache.tuscany.spi.component.CompositeComponent.register()


        EasyMock.expect(source.getOutboundWires()).andReturn(wireMap);
        EasyMock.expect(source.isSystem()).andReturn(true).atLeastOnce();
        EasyMock.expect(source.getParent()).andReturn(parent).atLeastOnce();
        EasyMock.replay(source);

        parent.register(source);

        AtomicComponent target = EasyMock.createMock(AtomicComponent.class);
        EasyMock.expect(target.getName()).andReturn("target").atLeastOnce();
        EasyMock.expect(target.getServiceInterfaces()).andReturn(services);
        EasyMock.expect(target.isSystem()).andReturn(false).atLeastOnce();
View Full Code Here


        EasyMock.expect(target.getName()).andReturn("target").atLeastOnce();
        EasyMock.expect(target.getServiceInterfaces()).andReturn(services);
        EasyMock.expect(target.isSystem()).andReturn(false).atLeastOnce();
        EasyMock.replay(target);

        parent.register(target);
        try {
            parent.prepare();
            fail();
        } catch (BuilderConfigException e) {
            //expected
View Full Code Here

        Assert.assertEquals(Scope.COMPOSITE, composite.getScope());
    }

    public void testGetChildren() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.register(new ServiceExtension("foo", null, null, null));
        Assert.assertEquals(1, composite.getChildren().size());
    }

    public void testGetServices() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
View Full Code Here

        Assert.assertEquals(1, composite.getChildren().size());
    }

    public void testGetServices() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.register(new ServiceExtension("foo", null, null, null));
        composite.register(getReference("bar"));
        Assert.assertEquals(1, composite.getServices().size());
    }

    public void testGetService() {
View Full Code Here

    }

    public void testGetServices() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.register(new ServiceExtension("foo", null, null, null));
        composite.register(getReference("bar"));
        Assert.assertEquals(1, composite.getServices().size());
    }

    public void testGetService() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
View Full Code Here

        Assert.assertEquals(1, composite.getServices().size());
    }

    public void testGetService() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.register(new ServiceExtension("foo", null, null, null));
        composite.start();
        assertNotNull(composite.getService("foo"));
    }

    public void testServiceNotFound() {
View Full Code Here

        assertNotNull(composite.getService("foo"));
    }

    public void testServiceNotFound() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.register(new ServiceExtension("foo", null, null, null));
        composite.start();
        try {
            composite.getService("bar");
            fail();
        } catch (ComponentNotFoundException e) {
View Full Code Here

    public void testBoot1Deployment() throws LoaderException {
        URL scdl = BootstrapDeployerTestCase.class.getResource("boot1.scdl");
        implementation.setScdlLocation(scdl);
        CompositeComponent parent = createNiceMock(CompositeComponent.class);
        parent.register(isA(SCAObject.class));
        replay(parent);
        // load the boot1 file using the bootstrap deployer
        componentDefinition.setName("simple");
        Component component = deployer.deploy(parent, componentDefinition);
        assertNotNull(component);
View Full Code Here

    public void testBoot2Deployment() throws LoaderException {
        URL scdl = BootstrapDeployerTestCase.class.getResource("boot2.scdl");
        implementation.setScdlLocation(scdl);
        CompositeComponent parent = createNiceMock(CompositeComponent.class);
        parent.register(isA(SCAObject.class));
        replay(parent);

        // load the boot2 file using the bootstrap deployer
        componentDefinition.setName("newDeployer");
        CompositeComponent component = (CompositeComponent) deployer.deploy(parent, componentDefinition);
View Full Code Here

        EasyMock.expect(component.getServiceInterfaces()).andReturn(interfaces);
        EasyMock.replay(component);

        CompositeComponent composite = new CompositeComponentImpl("foo", null, null, null);
        composite.start();
        composite.register(component);

        AtomicComponent atomicComponent = (AtomicComponent) composite.getSystemChild("source");
        Source source = (Source) atomicComponent.getServiceInstance();
        assertNotNull(source);
        composite.stop();
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.