Package org.apache.tuscany.spi.deployer

Examples of org.apache.tuscany.spi.deployer.DeploymentContext


    public <I extends Implementation<?>> Component deploy(CompositeComponent parent,
                                                             ComponentDefinition<I> componentDefinition)
        throws LoaderException {
        ScopeContainer moduleScope = new ModuleScopeContainer();
        DeploymentContext deploymentContext = new RootDeploymentContext(null, xmlFactory, moduleScope, null);
        try {
            load(parent, componentDefinition, deploymentContext);
        } catch (LoaderException e) {
            e.addContextName(componentDefinition.getName());
            throw e;
View Full Code Here


            MissingIncludeException mie = new MissingIncludeException();
            mie.setIdentifier(name);
            throw mie;
        }

        DeploymentContext childContext = new ChildDeploymentContext(deploymentContext, cl, url);
        CompositeComponentType composite = loadFromSidefile(parent, url, childContext);

        Include include = new Include();
        include.setName(name);
        include.setScdlLocation(url);
View Full Code Here

        int event = reader.getEventType();
        while (!(event == XMLStreamConstants.START_ELEMENT && reader.getName().equals(name)) && reader.hasNext()) {
            event = reader.nextTag();
        }
        DataObjectLoader loader = new DataObjectLoader(name);
        DeploymentContext context = new RootDeploymentContext(getClass().getClassLoader(), inputFactory, new ModuleScopeContainer(), null);
        ModelDataObject modelObject = (ModelDataObject) loader.load(null, reader, context);
        Assert.assertNotNull(modelObject.getDataObject());
        Assert.assertTrue(modelObject.getDataObject().getString("myAttr").equals("helloworld.HelloWorldImpl"));
    }
View Full Code Here

        // Test the SpringCompositeBuilder
        SpringCompositeBuilder builder = new SpringCompositeBuilder();
        builder.setBuilderRegistry(registry);
        CompositeComponent parent = createNiceMock(CompositeComponent.class);
        DeploymentContext context = createNiceMock(DeploymentContext.class);
        SpringCompositeComponent component =
            (SpringCompositeComponent) builder.build(parent, componentDefinition, context);
        TestBean bean = (TestBean) component.getApplicationContext().getBean("foo");
        assertEquals("call foo", bean.echo("call foo"));
    }
View Full Code Here

        // Test the SpringCompositeBuilder
        SpringCompositeBuilder builder = new SpringCompositeBuilder();
        builder.setWireService(wireService);
        builder.setBuilderRegistry(registry);
        CompositeComponent parent = createNiceMock(CompositeComponent.class);
        DeploymentContext context = createNiceMock(DeploymentContext.class);
        CompositeComponent component = (CompositeComponent) builder.build(parent, componentDefinition, context);
        Service service = component.getService("fooService");
        TestBean bean = (TestBean) service.getServiceInstance();
        assertEquals("call foo", bean.echo("call foo"));
        verify(registry);
View Full Code Here

    public void testFile() throws Exception {
        URL url = getClass().getResource("ipo.xml");
        Document doc = PropertyHelper.loadFromFile(url.toExternalForm(), null);
        assertNotNull(doc);

        DeploymentContext context = EasyMock.createMock(DeploymentContext.class);
        EasyMock.expect(context.getClassLoader()).andReturn(getClass().getClassLoader());
        EasyMock.replay(context);
        doc = PropertyHelper.loadFromFile("org/apache/tuscany/core/property/ipo.xml", context);
        assertNotNull(doc);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.deployer.DeploymentContext

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.