Examples of startComposite()


Examples of org.apache.tuscany.sca.Node.startComposite()

    public void implCompositeTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException, FileNotFoundException {
        Node node = TuscanyRuntime.newInstance().createNode("localTest");
        String curi = node.installContribution("src/test/resources/sample-helloworld.jar");
        String compositeURI = node.addDeploymentComposite(curi, new FileReader("src/test/resources/compositeImpl.composite"));

        node.startComposite(curi, compositeURI);
       
        List<String> xs = ((NodeImpl)node).updateUsingComposites(curi, "helloworld.composite");
        Assert.assertEquals(1, xs.size());
        Assert.assertEquals("sample-helloworld/compositeImpl.composite", xs.get(0));
    }
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

    @Test
    public void nestedTest1() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException, FileNotFoundException {
        Node node = TuscanyRuntime.newInstance().createNode("NestedTest");
        String curi = node.installContribution("src/test/resources/helloworld2.jar");

        node.startComposite(curi, "compositeImpl.composite");

        String compositeURI = node.addDeploymentComposite(curi, new FileReader("src/test/resources/nested.composite"));
        node.startComposite(curi, compositeURI);
       
        List<String> xs = ((NodeImpl)node).updateUsingComposites(curi, "helloworld.composite");
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

        String curi = node.installContribution("src/test/resources/helloworld2.jar");

        node.startComposite(curi, "compositeImpl.composite");

        String compositeURI = node.addDeploymentComposite(curi, new FileReader("src/test/resources/nested.composite"));
        node.startComposite(curi, compositeURI);
       
        List<String> xs = ((NodeImpl)node).updateUsingComposites(curi, "helloworld.composite");
        Assert.assertEquals(2, xs.size());
        Assert.assertTrue(xs.contains("helloworld2/compositeImpl.composite"));
        Assert.assertTrue(xs.contains("helloworld2/nested.composite"));
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

    public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
        TuscanyRuntime runtime = TuscanyRuntime.newInstance();
        try {
        Node node1 = runtime.createNode("uri:TwoNodesTestCase?multicast=off&bind=127.0.0.1:44331");
        node1.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null);
        node1.startComposite("helloworld", "helloworld.composite");

        Node node2 = TuscanyRuntime.newInstance().createNode("uri:TwoNodesTestCase?multicast=off&bind=127.0.0.1:44332&wka=127.0.0.1:44331");

        Helloworld helloworldService = node2.getService(Helloworld.class, "HelloworldComponent");
        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

        } catch (ValidationException e) {
            // expected
        }
        node.installContribution("src/test/resources/export.jar");
        node.validateContribution("import");
        node.startComposite("import", "helloworld.composite");
        Map<String, List<String>> scs = node.getStartedCompositeURIs();
        Assert.assertEquals(1, scs.size());           
    }

    @Test
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

    public void startTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
        Node node = TuscanyRuntime.newInstance().createNode("ImportTestCase");
        node.installContribution("src/test/resources/sample-helloworld.jar");
        Assert.assertEquals(0, node.getStartedCompositeURIs().size());

        node.startComposite("sample-helloworld", "helloworld.composite");
        Assert.assertEquals(1, node.getStartedCompositeURIs().size());
        Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
       
        node.stopComposite("sample-helloworld", "helloworld.composite");
//        Assert.assertEquals(0, node.getStartedComposites().size());
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

        Assert.assertEquals(1, node.getStartedCompositeURIs().size());
        Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
       
        node.stopComposite("sample-helloworld", "helloworld.composite");
//        Assert.assertEquals(0, node.getStartedComposites().size());
        node.startComposite("sample-helloworld", "helloworld.composite");
        Assert.assertEquals(1, node.getStartedCompositeURIs().size());
        Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));
        node.stopComposite("sample-helloworld", "helloworld.composite");
    }
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

       
        node.stopComposite("sample-helloworld", "helloworld.composite");
        Assert.assertEquals(0, node.getStartedCompositeURIs().size());
        Assert.assertEquals(0, node2.getStartedCompositeURIs().size());

        node2.startComposite("sample-helloworld", "helloworld.composite");
        Assert.assertEquals(1, node.getStartedCompositeURIs().size());
        Assert.assertEquals("helloworld.composite", node.getStartedCompositeURIs().get("sample-helloworld").get(0));

        Assert.assertEquals(1, node2.getStartedCompositeURIs().size());
        Assert.assertEquals("helloworld.composite", node2.getStartedCompositeURIs().get("sample-helloworld").get(0));
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

                + "      <implementation.java class=\"sample.HelloworldImpl\"/>"
                + "   </component>"
                + "</composite>";
        String compositeURI = node.addDeploymentComposite(curi, new StringReader(compositeXML));

        node.startComposite(curi, compositeURI);
        Assert.assertEquals(1, node.getStartedCompositeURIs().size());
       
        Composite dc = node.getDomainComposite();
        Assert.assertEquals(1, dc.getIncludes().size());
        Composite runningComposite = dc.getIncludes().get(0);
View Full Code Here

Examples of org.apache.tuscany.sca.Node.startComposite()

        }

        List<String> nodes = node1.getNodeNames();
        nodes.remove(node1.getLocalNodeName());
        String remoteNode = nodes.get(0);
        node1.startComposite(curi, "Helloworld.composite", remoteNode);

// TUSCANY-3870: this next invoke doesn't work:       
//        Assert.assertEquals("Hello Amelia", node1.getService(HelloworldService.class, "HelloworldComponent").sayHello("Amelia"));
    }
}
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.