Examples of TuscanyRuntime


Examples of org.apache.tuscany.sca.TuscanyRuntime

    private Composer composer;

    @Before
    public void startClient() throws Exception {
        try {
            TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
            node = tuscanyRuntime.createNode("myDomain");
           
            node.installContribution("contrib1", "src/main/resources/recursive", null, null);
            node.startComposite("contrib1", "Outer.composite");
            node.startComposite("contrib1", "Client.composite");
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

    private Composer composer;

    @Before
    public void startClient() throws Exception {
        try {
            TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
            node = tuscanyRuntime.createNode("myDomain");
           
            node.installContribution("contrib1", "src/main/resources/recursive", null, null);
           
            node.startComposite("contrib1", "Inner.composite");
            node.startComposite("contrib1", "Outer.composite");
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

    @Test
    public void testNoExceptionNoMessageShutdown() throws Exception{
       
        StatusImpl.statusString = "";
       
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();

        // create a Tuscany node
        node = tuscanyRuntime.createNode();
       
        // install a contribution
        node.installContribution("HelloworldContrib", "target/classes", null, null);
       
        // start a composite
        node.startComposite("HelloworldContrib", "lifecycle.composite");
       
        // we don't send any messages in this case and just shut down directly
       
        // stop a composite
        node.stopComposite("HelloworldContrib", "lifecycle.composite");
       
        // uninstall a constribution
        node.uninstallContribution("HelloworldContrib");
       
        // stop a Tuscany node
        node.stop();
       
        // stop the runtime
        tuscanyRuntime.stop();
       
        // see what happened
        System.out.println(StatusImpl.statusString);
        Assert.assertEquals("Service binding start - Endpoint:  URI = HelloworldService#service-binding(Helloworld/lifecycle)\n" +
                            "Implementation start - HelloworldServiceTestImpl\n" +
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

     * should be thrown.
     */   
    @Test
    public void testNoExceptionMessageShutdown() throws Exception{
       
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();

        // create a Tuscany node
        node = tuscanyRuntime.createNode();
       
        // install a contribution
        node.installContribution("HelloworldContrib", "target/classes", null, null);
       
        // start a composite
        node.startComposite("HelloworldContrib", "lifecycle.composite");
       
        // send a message to each client
        Helloworld hwCE = node.getService(Helloworld.class, "HelloworldClientCE");
        System.out.println(hwCE.sayHello("name"));
        Helloworld hwC = node.getService(Helloworld.class, "HelloworldClientC");
        System.out.println(hwC.sayHello("name"));
        Helloworld hwS = node.getService(Helloworld.class, "HelloworldClientC");
        System.out.println(hwS.sayHello("name"));       
       
        // stop a composite
        node.stopComposite("HelloworldContrib", "lifecycle.composite");
       
        // uninstall a constribution
        node.uninstallContribution("HelloworldContrib");
       
        // stop a Tuscany node
        node.stop();
       
        // stop the runtime
        tuscanyRuntime.stop();
       
        // see what happened
        System.out.println(StatusImpl.statusString);
        Assert.assertEquals("Service binding start - Endpoint:  URI = HelloworldService#service-binding(Helloworld/lifecycle)\n" +
                            "Implementation start - HelloworldServiceTestImpl\n" +
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

    @Test
    public void testConstructorExceptionShutdownCE() throws Exception{
       
        HelloworldClientImplCE.throwTestExceptionOnConstruction = true;
       
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();

        // create a Tuscany node
        node = tuscanyRuntime.createNode();
       
        // install a contribution
        node.installContribution("HelloworldContrib", "target/classes", null, null);
       
        // start a composite
        try {
            node.startComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it's thrown from the HelloworldClientImpl @Init method
            StatusImpl.appendStatus("Exception caught on node.startComposite", "LifecycleTestCase.testConstructorExceptionShutdownCE");
        }
       
        // don't need to send a message as eager init ensures that
        // the component instance is created at start time
       
        // stop a composite
        try {
            // not required in this test as the exception during EagerInit will cause the stop        
            //node.stopComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it will complain about the composite not being started
            StatusImpl.appendStatus("Exception caught on node.stopComposite", "LifecycleTestCase.testConstructorExceptionShutdownCE");
        }           
       
        // uninstall a constribution
        node.uninstallContribution("HelloworldContrib");
       
        // stop a Tuscany node
        node.stop();
       
        // stop the runtime
        tuscanyRuntime.stop();
       
        HelloworldClientImplCE.throwTestExceptionOnConstruction = false;
       
        // see what happened
        System.out.println(StatusImpl.statusString);
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

    @Test
    public void testConstructorExceptionShutdownC() throws Exception{
       
        HelloworldClientImplC.throwTestExceptionOnConstruction = true;
       
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();

        // create a Tuscany node
        node = tuscanyRuntime.createNode();
       
        // install a contribution
        node.installContribution("HelloworldContrib", "target/classes", null, null);
       
        // start a composite
        try {
            node.startComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it's thrown from the HelloworldClientImpl @Init method
            StatusImpl.appendStatus("Exception caught on node.startComposite", "LifecycleTestCase.testConstructorExceptionShutdownC");
        }
       
        // send a message to the appropriate client
        try {
            Helloworld hwCE = node.getService(Helloworld.class, "HelloworldClientC");
            System.out.println(hwCE.sayHello("name"));
        } catch (Exception exception) {
            // the component throws an error on construction
            StatusImpl.appendStatus("Exception caught on sayHello()", "LifecycleTestCase.testConstructorExceptionShutdownC");
        }
       
        // stop a composite
        try {
            node.stopComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it will complain about the composite not being started
            StatusImpl.appendStatus("Exception caught on node.stopComposite", "LifecycleTestCase.testConstructorExceptionShutdownC");
        }           
       
        // uninstall a constribution
        node.uninstallContribution("HelloworldContrib");
       
        // stop a Tuscany node
        node.stop();
       
        // stop the runtime
        tuscanyRuntime.stop();
       
        HelloworldClientImplC.throwTestExceptionOnConstruction = false;       
       
        // see what happened
        System.out.println(StatusImpl.statusString);
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

    @Test
    public void testConstructorExceptionShutdownS() throws Exception{
       
        HelloworldClientImplS.throwTestExceptionOnConstruction = true;
       
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();

        // create a Tuscany node
        node = tuscanyRuntime.createNode();
       
        // install a contribution
        node.installContribution("HelloworldContrib", "target/classes", null, null);
       
        // start a composite
        try {
            node.startComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it's thrown from the HelloworldClientImpl @Init method
            StatusImpl.appendStatus("Exception caught on node.startComposite", "LifecycleTestCase.testConstructorExceptionShutdownS");
        }
       
        // send a message to the appropriate client
        try {
            Helloworld hwCE = node.getService(Helloworld.class, "HelloworldClientS");
            System.out.println(hwCE.sayHello("name"));
        } catch (Exception exception) {
            // the component throws an error on construction
            StatusImpl.appendStatus("Exception caught on sayHello()", "LifecycleTestCase.testConstructorExceptionShutdownS");
        }       
       
        // stop a composite
        try {
            node.stopComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it will complain about the composite not being started
            StatusImpl.appendStatus("Exception caught on node.stopComposite", "LifecycleTestCase.testConstructorExceptionShutdownS");
        }           
       
        // uninstall a constribution
        node.uninstallContribution("HelloworldContrib");
       
        // stop a Tuscany node
        node.stop();
       
        // stop the runtime
        tuscanyRuntime.stop();
       
        HelloworldClientImplS.throwTestExceptionOnConstruction = false;
       
        // see what happened
        System.out.println(StatusImpl.statusString);
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

    @Test
    public void testInitExceptionShutdownCE() throws Exception{
       
        HelloworldClientImplCE.throwTestExceptionOnInit = true;
       
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();

        // create a Tuscany node
        node = tuscanyRuntime.createNode();
       
        // install a contribution
        node.installContribution("HelloworldContrib", "target/classes", null, null);
       
        // start a composite
        try {
            node.startComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it's thrown from the HelloworldClientImpl @Init method
            StatusImpl.appendStatus("Exception caught on node.startComposite", "LifecycleTestCase.testInitExceptionShutdownCE");
        }
       
        // don't need to send a message as eager init ensures that
        // the component instance is created and inited at start time       
       
        // stop a composite
        try {
            // not required in this test as the exception during EagerInit will cause the stop            
            //node.stopComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it will complain about the composite not being started
            StatusImpl.appendStatus("Exception caught on node.stopComposite", "LifecycleTestCase.testInitExceptionShutdownCE");
        }           
       
        // uninstall a constribution
        node.uninstallContribution("HelloworldContrib");
       
        // stop a Tuscany node
        node.stop();
       
        // stop the runtime
        tuscanyRuntime.stop();
       
        HelloworldClientImplCE.throwTestExceptionOnInit = false;       
       
        // see what happened
        System.out.println(StatusImpl.statusString);
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

    @Test
    public void testInitExceptionShutdownC() throws Exception{
       
        HelloworldClientImplC.throwTestExceptionOnInit = true;
       
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();

        // create a Tuscany node
        node = tuscanyRuntime.createNode();
       
        // install a contribution
        node.installContribution("HelloworldContrib", "target/classes", null, null);
       
        // start a composite
        try {
            node.startComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it's thrown from the HelloworldClientImpl @Init method
            StatusImpl.appendStatus("Exception caught on node.startComposite", "LifecycleTestCase.testInitExceptionShutdownC");
        }
       
        // send a message to the appropriate client
        try {
            Helloworld hwCE = node.getService(Helloworld.class, "HelloworldClientC");
            System.out.println(hwCE.sayHello("name"));
        } catch (Exception exception) {
            // the component throws an error on init
            StatusImpl.appendStatus("Exception caught on sayHello()", "LifecycleTestCase.testInitExceptionShutdownC");
        }       
       
        // stop a composite
        try {
            node.stopComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it will complain about the composite not being started
            StatusImpl.appendStatus("Exception caught on node.stopComposite", "LifecycleTestCase.testInitExceptionShutdownC");
        }           
       
        // uninstall a constribution
        node.uninstallContribution("HelloworldContrib");
       
        // stop a Tuscany node
        node.stop();
       
        // stop the runtime
        tuscanyRuntime.stop();
       
        HelloworldClientImplC.throwTestExceptionOnInit = false;       
       
        // see what happened
        System.out.println(StatusImpl.statusString);
View Full Code Here

Examples of org.apache.tuscany.sca.TuscanyRuntime

    @Test
    public void testInitExceptionShutdownS() throws Exception{
       
        HelloworldClientImplS.throwTestExceptionOnInit = true;
       
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();

        // create a Tuscany node
        node = tuscanyRuntime.createNode();
       
        // install a contribution
        node.installContribution("HelloworldContrib", "target/classes", null, null);
       
        // start a composite
        try {
            node.startComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it's thrown from the HelloworldClientImpl @Init method
            StatusImpl.appendStatus("Exception caught on node.startComposite", "LifecycleTestCase.testInitExceptionShutdownS");
        }
       
        // send a message to the appropriate client
        try {
            Helloworld hwCE = node.getService(Helloworld.class, "HelloworldClientS");
            System.out.println(hwCE.sayHello("name"));
        } catch (Exception exception) {
            // the component throws an error on init
            StatusImpl.appendStatus("Exception caught on sayHello()", "LifecycleTestCase.testInitExceptionShutdownS");
        }        
       
        // stop a composite
        try {
            node.stopComposite("HelloworldContrib", "lifecycle.composite");
        } catch (Exception exception) {
            // it will complain about the composite not being started
            StatusImpl.appendStatus("Exception caught on node.stopComposite", "LifecycleTestCase.testInitExceptionShutdownS");
        }           
       
        // uninstall a constribution
        node.uninstallContribution("HelloworldContrib");
       
        // stop a Tuscany node
        node.stop();
       
        // stop the runtime
        tuscanyRuntime.stop();
       
        HelloworldClientImplS.throwTestExceptionOnInit = false;       
       
        // see what happened
        System.out.println(StatusImpl.statusString);
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.