Package itest

Examples of itest.HelloworldService


    public void testWithoutServiceNameSingleService() throws Exception {
        node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
        node.start();

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        HelloworldService service = clientFactory.getService(HelloworldService.class, "SingleServiceComponent");
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here


        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
       
        // test multiple service error reported at the SCAClient wire
        try {
            HelloworldService service = clientFactory.getService(HelloworldService.class, "MultipleServiceComponent");
            assertEquals("Hello petra", service.sayHello("petra"));
            fail();
        } catch (ServiceRuntimeException e) {
            // expected
        }  
       
        // test multiple service error reported at the wire associated with a reference of
        // the component the SCAClient is talking to
        HelloworldService service = clientFactory.getService(HelloworldService.class, "MultipleServiceClientComponent");
       
        try {
            assertEquals("Hello Hello again petra", service.sayHello("petra"));
            fail();
        } catch (ServiceRuntimeException e) {
            // expected
       
    }   
View Full Code Here

public class SCAClientTestCase extends TestCase {

    @Test
    public void testDefault() throws Exception {
        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("uri:default?wka=127.0.0.1:9876"));
        HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent");
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

    public void testDefault() throws Exception {

        node = NodeFactory.newInstance().createNode((String)null, new String[] {"target/classes"});
        node.start();

        HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent");
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

    public void testURIconfig() throws Exception {

        node = NodeFactory.newInstance("uri:somedomain").createNode((String)null, new String[] {"target/classes"});
        node.start();

        HelloworldService service = SCAClientFactory.newInstance(URI.create("somedomain")).getService(HelloworldService.class, "HelloworldComponent");
        assertEquals("Hello petra", service.sayHello("petra"));
        try {
            service = SCAClientFactory.newInstance(URI.create("nosuchdomain")).getService(HelloworldService.class, "HelloworldComponent");
            service.sayHello("petra");
            fail();
        } catch (NoSuchDomainException e) {
            //expected
        }
    }
View Full Code Here

    @Test
    public void testExplicit() throws Exception {
        node = NodeFactory.newInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
        node.start();

        HelloworldService service = SCAClientFactory.newInstance(URI.create("myFooDomain")).getService(HelloworldService.class, "HelloworldComponent");
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

        // TUSCANY-3670 - why factory takes URI while node factory take configuration string?
        //                hacked this for now to make the client domain name match the domain
        //                name that's pulled out of the factory URI
        //HelloworldService service = SCAClientFactory.newInstance(URI.create("uri:myFooDomain?wka=127.0.0.1:14821")).getService(HelloworldService.class, "HelloworldComponent");
        HelloworldService service = SCAClientFactory.newInstance(URI.create("myFooDomain")).getService(HelloworldService.class, "HelloworldComponent");
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

        // TUSCANY-3670 - why factory takes URI while node factory take configuration string?
        //                hacked this for now to make the client domain name match the domain
        //                name that's pulled out of the factory URI
        //HelloworldService service = SCAClientFactory.newInstance(URI.create("uri:myFooDomain?wka=127.0.0.1:14821")).getService(HelloworldService.class, "HelloworldComponent");
        HelloworldService service = SCAClientFactory.newInstance(URI.create("myFooDomain")).getService(HelloworldService.class, "HelloworldComponent");       
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

        node = NodeFactory.newInstance().createNode();
        node.start();
    }

    public void testInvoke() throws Exception {
        HelloworldService service =
            SCAClientFactory.newInstance().getService(HelloworldService.class,
                                                      "HelloworldComponent",
                                                      URI.create(Node.DEFAULT_DOMAIN_URI));
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

    public void testDefault() throws Exception {

        node = NodeFactory.newInstance().createNode((String)null, new String[] {"target/classes"});
        node.start();

        HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent");
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

TOP

Related Classes of itest.HelloworldService

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.