Package org.apache.tuscany.sca.node

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


    @Test
    public void testSync() {
        try {
            Node node = NodeFactory.newInstance().createNode("sync.composite");
            node.start();
            node.stop();
        } catch (final Exception e) {
            Assert.fail(e.getMessage());
        }
    }
View Full Code Here


    @Test
    public void testAsync() {
        try {
            Node node = NodeFactory.newInstance().createNode("async.composite");
            node.start();
            node.stop();
        } catch (final Exception e) {
            Assert.fail(e.getMessage());
        }
    }
View Full Code Here

        Node client2Node = NodeFactory.newInstance("uri:HazelcastBindingTestCase?bind=127.0.0.1").createNode("client2.composite", new String[]{"target/test-classes"});
        client2Node.start();
        TestService service = client2Node.getService(TestService.class, "TestServiceClient2");
        assertNotNull(service);
        assertEquals("Petra", service.echoString("Petra"));
        client2Node.stop();
    }

    @Test
    public void testEchoString() throws Exception {
        TestService service = clientNode.getService(TestService.class, "TestServiceClient");
View Full Code Here

        factory.setAutoDestroy(false);
        Contribution contribution = new Contribution("c1", new File("target/test-classes").toURI().toString());
        Node node = factory.createNode(new StringReader(composite), contribution);
        testNode2(node);
       
        node.stop();

        int count = 3000;
        long start = System.currentTimeMillis();
        for (int i=0; i<count; i++) {
            node.start();
View Full Code Here

        int count = 3000;
        long start = System.currentTimeMillis();
        for (int i=0; i<count; i++) {
            node.start();
            node.stop();
        }
        long total = System.currentTimeMillis() - start;
        System.out.println(count + " = " + total + " = " + total / (double)count);

        // test it still works
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();

        Assert.assertEquals(0 , logRecords.size());
    }

}
View Full Code Here

    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();
        nf.setAutoDestroy(false);
        node = nf.createNode();
View Full Code Here

        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

                    return;
                }
            }
       
        } finally {
            node.stop();
        }
    }
   
    /**
     * Just walks down the tree (depth first) looking for a directory ending in the 
View Full Code Here

        node1.start();
        node2.start();
        try {
            runClient(node1);
        } finally {
            node2.stop();
            node1.stop();
            factory1.destroy();
        }
    }
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.