Package org.apache.tuscany.sca.node

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


     * This method tests that an exception is thrown when a method with arguments is
     * annotated with "@Init".
     */
    @Test
    public void atInitMethodWithArgs() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        try {
            SCANode node = nodeFactory.createSCANode(new File("src/main/resources/err4/HelloWorldErr4.composite").toURL().toString(),
                    new SCAContribution("TestContribution",
                                        new File("src/main/resources/err4").toURL().toString()));
            Assert.fail();
            node.stop();
        } catch(ServiceRuntimeException e) {
View Full Code Here


    private CalculatorService calculatorService;
    private SCANode node;

    @Override
    protected void setUp() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = nodeFactory.createSCANode(new File("src/test/resources/Calculator.composite").toURL().toString(),
                                         new SCAContribution("TestContribution",
                                                             new File("src/test/resources").toURL().toString()));
        node.start();
        calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
    }
View Full Code Here

        testNode(node);
    }

    @Test
    public void testNodeWithClassLoader() {
        SCANodeFactory factory = new NodeFactoryImpl();
        String compositeURI = "HelloWorld.composite";
        SCANode node = factory.createSCANodeFromClassLoader(compositeURI, HelloWorld.class.getClassLoader());
        testNode(node);
    }
View Full Code Here

        testNode(node);
    }

    @Test
    public void testNodeWithClassLoaderAndNullComposite() {
        SCANodeFactory factory = new NodeFactoryImpl();
        SCANode node = factory.createSCANodeFromClassLoader(null, HelloWorld.class.getClassLoader());
        testNode(node);
    }
View Full Code Here

    private CalculatorService calculatorService;
    private SCANode node;

    @Override
    protected void setUp() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = nodeFactory.createSCANode(new File("src/main/resources/ComponentReferenceTargetNotFound/Calculator.composite").toURL().toString(),
                             new SCAContribution("TestContribution",
                                                 new File("src/main/resources/ComponentReferenceTargetNotFound").toURL().toString()));
       
        try {
            node.start();
View Full Code Here

    private CalculatorService calculatorService;
    private SCANode node;

    @Override
    protected void setUp() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = nodeFactory.createSCANode(new File("src/main/resources/DuplicatePropertyName/Calculator.composite").toURL().toString(),
                             new SCAContribution("TestContribution",
                                                 new File("src/main/resources/DuplicatePropertyName").toURL().toString()));
        node.start();
        calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
    }
View Full Code Here

    private CalculatorService calculatorService;
    private SCANode node;

    @Override
    protected void setUp() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = nodeFactory.createSCANode(new File("src/main/resources/MultipleBindingsForService/Calculator.composite").toURL().toString(),
                             new SCAContribution("TestContribution",
                                                 new File("src/main/resources/MultipleBindingsForService").toURL().toString()));
        node.start();
        calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
    }
View Full Code Here

    private CalculatorService calculatorService;
    private SCANode node;

    @Override
    protected void setUp() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceIncompatibleComponentInterface/Calculator.composite").toURL().toString(),
                             new SCAContribution("TestContribution",
                                                 new File("src/main/resources/ReferenceIncompatibleComponentInterface").toURL().toString()));
        node.start();
        calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
    }
View Full Code Here

* and locate and invoke a SCA component
*/
public class CalculatorClient {
    public static void main(String[] args) throws Exception {       
       
        SCANodeFactory factory = SCANodeFactory.newInstance();
        SCANode node = factory.createSCANode(new File("src/main/resources/context/imports/Calculator.composite").toURL().toString(),
                new SCAContribution("TestContribution", new File("src/main/resources/context/imports/").toURL().toString()));
        node.start();       
             
        CalculatorService calculatorService =
            ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
View Full Code Here

* and locate and invoke a SCA component
*/
public class CalculatorClient {
    public static void main(String[] args) throws Exception {       
       
        SCANodeFactory factory = SCANodeFactory.newInstance();
        SCANode node = factory.createSCANode(new File("src/main/resources/context/access/Calculator.composite").toURL().toString(),
                new SCAContribution("TestContribution", new File("src/main/resources/context/access/").toURL().toString()));
        node.start();
       
        // Code: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
View Full Code Here

TOP

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

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.