Package org.apache.tuscany.sca

Examples of org.apache.tuscany.sca.TuscanyRuntime.stop()


        Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
        } finally {
            node.stop();
        }
        runtime.stop();
    }
}
View Full Code Here


    public void execute() throws MojoExecutionException, MojoFailureException {
        if (id.length() < 1) {
            // if id is set to "" then stop all runtimes
            for (String id : TuscanyStartMojo.runtimes.keySet()) {
                TuscanyRuntime runtime = TuscanyStartMojo.runtimes.get(id);
                runtime.stop();
                getLog().info("stopped Tuscany runtime " + id);
            }
            TuscanyStartMojo.runtimes.clear();
        } else {
            TuscanyRuntime runtime = TuscanyStartMojo.runtimes.remove(id);
View Full Code Here

        } else {
            TuscanyRuntime runtime = TuscanyStartMojo.runtimes.remove(id);
            if (runtime == null) {
                getLog().info("No started runtime found for ID " + id);
            } else {
                runtime.stop();
                getLog().info("stopped Tuscany runtime " + id);
            }
        }
    }
}
View Full Code Here

        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"));
    } finally { runtime.stop(); }
    }

}
View Full Code Here

        // test that the service has started and can be invoked
        testService(node, contribution.getClassLoader());

        node.stop();
        tuscanyRuntime.stop();
    }

    private void testService(Node node, ClassLoader classLoader) throws ClassNotFoundException, NoSuchServiceException, NoSuchDomainException, IllegalArgumentException, InvocationTargetException, IllegalAccessException {
        Class<?> interfaze = classLoader.loadClass("sample.Helloworld");
        Object clientProxy = node.getService(interfaze, "testComponent/Helloworld");
View Full Code Here

        ContributionDescription cd = ((NodeImpl)nodeB).getInstalledContribution("export");
        Assert.assertEquals(1, cd.getJavaExports().size());
        Assert.assertEquals("sample", cd.getJavaExports().get(0));
        } finally {
            runtime.stop();
        }
    }
   
    @Test
    public void deployables() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
View Full Code Here

            nodeA.validateContribution("import");
            nodeA.startComposite("import", "helloworld.composite");
            Map<String, List<String>> scs = nodeB.getStartedCompositeURIs();
            Assert.assertEquals(1, scs.size());           
        }finally {
            runtime.stop();
        }

    }

    @Test
View Full Code Here

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

    } finally {
        runtime.stop();
    }
    }

    @Test
    public void addDeploymentCompositeTest() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, XMLStreamException {
View Full Code Here

        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"));
    } finally { runtime.stop(); }
    }

}
View Full Code Here

    public void distributedDomain() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
        TuscanyRuntime runtime = TuscanyRuntime.newInstance();
        try {
        Node node = runtime.createNode("uri:DomainCompositeTestCase");
        testIt(node);
        } finally { runtime.stop(); }
    }

    private void testIt(Node node) throws ContributionReadException, ActivationException, ValidationException {
        node.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null);
        node.startComposite("helloworld", "helloworld.composite");
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.