Package org.apache.tuscany.sca.node

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


    private static Node node;

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


    @BeforeClass
    public static void startServer() throws Exception {
        try {

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

    private static Node serviceNode;
    private static Node clientNode;

    @Test
    public void testCalculator() throws Exception {
        NodeFactory factory = NodeFactory.newInstance();
        serviceNode = factory.createNode(new Contribution("service", getJar("../helloworld-service/target")));
        serviceNode.start();
        clientNode = factory.createNode(new Contribution("client", getJar("../helloworld-client/target")));
        clientNode.start();

        Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
        assertNotNull(service);
        assertEquals("Hello Petra", service.sayHello("Petra"));

        Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
        assertNotNull(client);
        assertEquals("Hi Hello Petra", client.sayHello("Petra"));

        serviceNode.stop();

        client = clientNode.getService(Helloworld.class, "HelloworldClient");
        assertNotNull(client);

        try {
            client.sayHello("Petra");
            fail();
        } catch (Exception e) {
            // expected
            // TODO: better exception than NPE
        }
       
        serviceNode = factory.createNode(new Contribution("service", getJar("../helloworld-service/target")));
        serviceNode.start();

        client = clientNode.getService(Helloworld.class, "HelloworldClient");
        assertNotNull(client);
        assertEquals("Hi Hello Petra", client.sayHello("Petra"));
View Full Code Here

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
                           "false");
        NodeFactory factory = NodeFactory.getInstance();
        NodeConfiguration configuration1 =
            factory.createNodeConfiguration().setURI("serviceNode")
                .addContribution("service", getJar("../helloworld-service/target"));
        serviceNode = factory.createNode(configuration1).start();

        NodeConfiguration configuration2 =
            factory.createNodeConfiguration().setURI("clientNode")
                .addContribution("client", getJar("../helloworld-client/target"));
        clientNode = factory.createNode(configuration2).start();
    }
View Full Code Here

    private static Node serviceNode;

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        NodeFactory factory = NodeFactory.newInstance();

        serviceNode = factory.createNode(new File("service-c-config.xml").toURI().toURL());
        serviceNode.start();    
    }
View Full Code Here

    private static Node sericeNode;

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        NodeFactory factory = NodeFactory.newInstance();

        sericeNode = factory.createNode(new File("service-a-config.xml").toURI().toURL());
       
        try {
            sericeNode.start();
        } catch (Exception ex){
            ex.printStackTrace();
View Full Code Here

    private static Node serviceNode;

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        NodeFactory factory = NodeFactory.newInstance();

        serviceNode = factory.createNode(new File("service-b-config.xml").toURI().toURL());
        serviceNode.start();    
    }
View Full Code Here

    public static void setUpBeforeClass() throws Exception {
        runner = new TestCaseRunner(ServiceNode.class);
        runner.beforeClass();
        System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
                           "false");
        NodeFactory factory = NodeFactory.newInstance();
        NodeConfiguration conf =
            factory.createNodeConfiguration().setURI("clientNode").
                addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8085/sca https://localhost:9085/sca")
                .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8086/ws")
                .addContribution("client", new File("../helloworld-client/target/classes").toURI().toString());
        clientNode = factory.createNode(conf).start();
        Thread.sleep(1000);
    }
View Full Code Here

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
                           "false");
        NodeFactory factory = NodeFactory.newInstance();
        NodeConfiguration conf =
            factory.createNodeConfiguration().setURI("serviceNode")
                .addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8087/sca")
                .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8088/ws")
                .addContribution("service", new File("../helloworld-service/target/classes").toURI().toString());
        serviceNode = factory.createNode(conf).start();
    }
View Full Code Here

            currentTCCL = Thread.currentThread().getContextClassLoader();
            Thread.currentThread().setContextClassLoader(classLoader);
        }

        try {
            NodeFactory factory = NodeFactory.getInstance();
            NodeExtension node = factory.loadNode(configuration);
            TuscanyCompositeEntityBuilder builder = new TuscanyCompositeEntityBuilder(node.getDomainComposite());
            CompositeEntity compositeEntity = builder.buildCompositeEntity();
            DiagramGenerator generator = new DiagramGenerator(compositeEntity, false, baseURL);
            Document doc = generator.buildSVGDocument();
            return extractSvg(doc);
View Full Code Here

TOP

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

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.