Package org.apache.tuscany.sca.node

Examples of org.apache.tuscany.sca.node.Node.start()


    List<?> start(final String name, final String cloc, final String dcuri) {
        if(nodes.containsKey(name))
            return emptyList();
        final Node node = dcuri != null? nf.createNode(dcuri, new Contribution(cloc, cloc)) : nf.createNode(new Contribution(cloc, cloc));
        nodes.put(name, new Nodeconf(name, cloc, dcuri, node));
        node.start();
        return emptyList();
    }

    List<?> stop(final String name) {
        final Nodeconf ninfo = nodes.get(name);
View Full Code Here


    @Test
    public void testCalculator() throws Exception {
       
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "./target/classes"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        assertEquals(calculator.add(3, 2), 5.0, 0);
        assertEquals(calculator.subtract(3, 2), 1.0, 0);
View Full Code Here

        Properties props = new Properties();
        props.setProperty(RuntimeProperties.QUIET_LOGGING, "true");
        NodeFactory nf = NodeFactory.newInstance(props);
        Node node = nf.createNode();
        node.start();
        node.stop();
       
       
        // This doesn't actually check the logging yet, need to figure out a
        // way to get the log output so for now has to be run manually
View Full Code Here

    @Test
    public void testAutoDestroy() throws Exception {
        NodeFactory nf = NodeFactory.newInstance();
        Node node = nf.createNode();
        node.start();
        Assert.assertTrue(((NodeFactoryImpl)nf).inited);
        node.stop();
        Assert.assertFalse(((NodeFactoryImpl)nf).inited);
       
        nf = NodeFactory.newInstance();
View Full Code Here

        Assert.assertFalse(((NodeFactoryImpl)nf).inited);
       
        nf = NodeFactory.newInstance();
        nf.setAutoDestroy(false);
        node = nf.createNode();
        node.start();
        Assert.assertTrue(((NodeFactoryImpl)nf).inited);
        node.stop();
        Assert.assertTrue(((NodeFactoryImpl)nf).inited);
       
    }
View Full Code Here

     * Using the Tuscany Node API to load a contribution.
     * Using the Tuscany Node API to get a local service proxy
     */
    public void launchBindingWSCalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
        double result = calculator.add(3, 2);
View Full Code Here

        launcher.launchImplementationJavaCalculator();        
    }
   
    public void launchImplementationJavaCalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-java/calculator-contribution/target/sample-implementation-java-calculator-contribution.jar"));
        node.start();
       
        node.stop();
    }
   
}
View Full Code Here

     * Using the Tuscany Node API to load a contribution.
     * Using the Tuscany Node API to get a local service proxy
     */
    public void launchBindingSCACalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-jsonrpc/calculator-contribution/target/sample-binding-jsonrpc-calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
        double result = calculator.add(3, 2);
View Full Code Here

     * Using the Tuscany Node API to load a contribution.
     * Using the Tuscany Node API to get a local service proxy
     */
    public void launchBindingSCACalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
        double result = calculator.add(3, 2);
View Full Code Here

     * Using the Tuscany Node API to load a contribution.
     * Using the Tuscany Node API to get a local service proxy
     */
    public void launchImplementationScriptCalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-script/calculator-contribution/target/sample-implementation-script-calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
        double result = calculator.add(3, 2);
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.