Package org.apache.tuscany.sca.node

Examples of org.apache.tuscany.sca.node.Contribution


    @BeforeClass
    public static void setUp() throws Exception {
        final NodeFactory nf = NodeFactory.newInstance();
        String here = SampleNativeJMSAsyncTestCase.class.getProtectionDomain().getCodeSource().getLocation().toString();
        // Create the node using the pattern "name of composite file to start" / Contribution to use
        node = nf.createNode("testnativejmsasync.composite", new Contribution("test", here));
        node.start();
    }
View Full Code Here


    }

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

   
    @BeforeClass
    public static void setUp() throws Exception {
        // Start test composite on a Tuscany node
        final NodeFactory nf = NodeFactory.newInstance();
        node = nf.createNode("test.composite", new Contribution("test", here()));
        node.start();
       
        // Mock up a test Web service on http://localhost:8086/wsupper
        jetty = new JettyServer((ExtensionPointRegistry)nf.getExtensionPointRegistry());
        jetty.start();
View Full Code Here

    public void startServer() throws Exception {
        try {

            NodeFactory factory = NodeFactory.newInstance();
            String contribution = ContributionLocationHelper.getContributionLocation(OrderService_Service.class);
            node = factory.createNode("orderws.composite", new Contribution("order", contribution)).start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    
    }
View Full Code Here

public class CalculatorTestCase {

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

     * @throws java.lang.Exception
     */
    @BeforeClass
    protected void setUp() throws Exception {
      String location = ContributionLocationHelper.getContributionLocation("helloworld/helloworld.composite");
    node = NodeFactory.newInstance().createNode("CallBackApiTest.composite", new Contribution("c1", location));
    node.start();
    }
View Full Code Here

    @BeforeClass
    public static void init() throws Exception {
        try {
            String contribution = ContributionLocationHelper.getContributionLocation(CustomerServiceTestCase.class);
            node = NodeFactory.newInstance().createNode("customer.composite", new Contribution("customer", contribution));
            node.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            + " </composite>";

    @Test
    public void testNodeWithCompositeContent() {
        NodeFactory factory = new NodeFactoryImpl();
        Contribution contribution = new Contribution("c1", new File("target/test-classes").toURI().toString());
        Node node = factory.createNode(new StringReader(composite), contribution);
        testNode2(node);
    }
View Full Code Here

    }

    @Test
    public void testNodeWithRelativeCompositeURI() {
        NodeFactory factory = new NodeFactoryImpl();
        Contribution contribution = new Contribution("c1", new File("target/test-classes").toURI().toString());
        String compositeURI = "HelloWorld.composite";
        Node node = factory.createNode(compositeURI, contribution);
        testNode(node);
    }
View Full Code Here

    @SuppressWarnings("deprecation")
    @Test
    public void testNodeWithAbsoluteCompositeURI() throws MalformedURLException {
        NodeFactory factory = new NodeFactoryImpl();
        Contribution contribution = new Contribution("c1", new File("target/test-classes").toURL().toString());
        String compositeURI = new File("target/test-classes/HelloWorld.composite").toURL().toString();
        Node node = factory.createNode(compositeURI, contribution);
        testNode(node);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.node.Contribution

Copyright © 2018 www.massapicom. 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.