Package helloWorld

Examples of helloWorld.HelloWorld


*/
public class HelloWorldFacadeTest {

    @Test
    public void testHelloWorldFacade(){
        HelloWorld facadeHelloWorld = HelloWorldFacade.instance().facadeHelloWorld();
        assertThat(facadeHelloWorld.helloWorld(),is("Hello Facade!"));
    }
View Full Code Here


*/
public class CompositeHelloWorldTest {

    @Test
    public void testCompositeHelloWorld(){
        HelloWorld emptyCompositeHelloWorld = new CompositeHelloWorld();
        assertThat(emptyCompositeHelloWorld.helloWorld(),isEmptyString());
        HelloWorld compositeHelloWorld = new CompositeHelloWorld(new CompositeHelloWorld.DefaultHelloWorld());
        assertThat(compositeHelloWorld.helloWorld(),is("Hello Composite!"));
    }
View Full Code Here

       
        // 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
View Full Code Here

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

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

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

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

            // it's thrown from the HelloworldClientImpl @Destroy method
            StatusImpl.appendStatus("Exception caught on node.startComposite", "LifecycleTestCase.testDestroyExceptionShutdownC");
        }
       
        // send a message to the appropriate client
        Helloworld hwCE = node.getService(Helloworld.class, "HelloworldClientC");
        System.out.println(hwCE.sayHello("name"))
        // don't need to catch exception here as the component instance won't
        // be destroyed until shutdown
       
        // stop a composite
        try {
View Full Code Here

            StatusImpl.appendStatus("Exception caught on node.startComposite", "LifecycleTestCase.testDestroyExceptionShutdownS");
        }
       
        // send a message to the appropriate client
        try {
            Helloworld hwCE = node.getService(Helloworld.class, "HelloworldClientS");
            System.out.println(hwCE.sayHello("name"));
        } catch (Exception exception) {
            // exception will be thrown when component instance is discarded
            // after the message has been processed
        }             
       
View Full Code Here

       
        // start a composite
        node.startComposite("HelloworldContrib", "lifecycle.composite");
       
        // send a message to each client. The last one throws and exception
        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"));  
        try {
            Helloworld hw = node.getService(Helloworld.class, "HelloworldC");
            hw.throwException("name");
        } catch (Exception ex) {
            // do nothing
            StatusImpl.appendStatus("Exception caught on throwException()", "LifecycleTestCase.testAppExceptionShutdown");
        }
       
View Full Code Here

TOP

Related Classes of helloWorld.HelloWorld

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.