Package org.apache.tuscany.sca

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


    }

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

        String compositeXML =
            "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\""
                + "     xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.1\""
                + "     targetNamespace=\"http://test/composite\""
View Full Code Here


    }

    @Test
    public void invalidCompositeStartTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException {
        Node node = TuscanyRuntime.newInstance().createNode("invalidCompositeStartTest");
        String curi = node.installContribution("src/test/resources/helloworld-invalidComposite.jar");
        Assert.assertEquals(1, node.getInstalledContributionURIs().size());
        Assert.assertEquals(0, node.getStartedCompositeURIs().size());
        ContributionDescription cd = node.getInstalledContribution(curi);
        Assert.assertEquals(1, cd.getDeployables().size());
       
View Full Code Here

    }

    @Test
    public void stopAndUnistallTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException {
        Node node = TuscanyRuntime.newInstance().createNode("stopAndUnistallTest");
        node.installContribution("src/test/resources/import.jar");
        node.installContribution("src/test/resources/export.jar");
        String compositeXML =
            "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\""
                + "     xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.1\""
                + "     targetNamespace=\"http://test/composite\""
View Full Code Here

    @Test
    public void stopAndUnistallTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException {
        Node node = TuscanyRuntime.newInstance().createNode("stopAndUnistallTest");
        node.installContribution("src/test/resources/import.jar");
        node.installContribution("src/test/resources/export.jar");
        String compositeXML =
            "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200912\""
                + "     xmlns:tuscany=\"http://tuscany.apache.org/xmlns/sca/1.1\""
                + "     targetNamespace=\"http://test/composite\""
                + "     name=\"TestComposite\">"
View Full Code Here

public class ContributionClassLoaderTestCase {

    @Test
    public void testInstallDeployable() throws ContributionReadException, ValidationException, ActivationException {
        Node node = TuscanyRuntime.newInstance().createNode();
        String curi = node.installContribution("src/test/resources/sample-helloworld.jar");
        Contribution contribution = node.getContribution(curi);
        Assert.assertNull(contribution.getClassLoader());
        node.validateContribution(curi);
        ClassLoader cl1 = contribution.getClassLoader();
        Assert.assertNotNull(cl1);
View Full Code Here

public class UsedCompositesTestCase {

    @Test
    public void includeTest1() 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/include.composite"));

        node.startComposite(curi, compositeURI);
       
        List<String> xs = ((NodeImpl)node).updateUsingComposites(curi, "helloworld.composite");
View Full Code Here

        Assert.assertEquals("sample-helloworld/include.composite", xs.get(0));
    }
    @Test
    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");
View Full Code Here

    }

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

    @Test
    public void testArtifacts() throws ContributionReadException, ValidationException {

        Node node = TuscanyRuntime.newInstance().createNode();
        String curi = node.installContribution("src/test/resources/sample-helloworld.jar");
        node.validateContribution(curi);

        Contribution contribution = node.getContribution(curi);
        Composite composite = contribution.getArtifactModel("helloworld.composite");
        Component component = composite.getComponents().get(0);
View Full Code Here

    @Test
    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");
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.