Package itest

Examples of itest.HelloworldService


    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 (Exception e) {
            if (!(e.getCause() instanceof NoSuchDomainException)) {
                throw e;
            }
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

    @Test
    public void testExplicitRemote() throws Exception {
        node = NodeFactory.newInstance("uri:myFooDomain?bind=127.0.0.1:14821").createNode((String)null, new String[] {"target/classes"});
        node.start();

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

    @Test
    public void testExplicitRemote2() throws Exception {
        node = NodeFactory.newInstance("uri:myFooDomain?bind=127.0.0.1:14821").createNode((String)null, new String[] {"target/classes"});
        node.start();

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

    public void testExplicit() 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, "HelloworldComponent/HelloworldService");
        assertEquals("Hello petra", service.sayHello("petra"));
       
        RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
        assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

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

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("someBadDomainName"));
        try {
            HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/foo");
            service.sayHello("petra");
            fail();
        } catch (Exception e) {
            if (!(e.getCause() instanceof NoSuchDomainException)) {
                throw e;
            }
View Full Code Here

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

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("default"));
        HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
        assertEquals("Hello petra", service.sayHello("petra"));
       
        RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
        assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));

    }
View Full Code Here

    }

    public void testInvoke() throws Exception {
        // At the moment the SCAClientFactory assumes that only one domain is active
        // in a JVM. So we pass in null for the domain name and get what we're given
        HelloworldService service =
            SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent");
        assertEquals("Hello petra", service.sayHello("petra"));
    }
View Full Code Here

        System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader());
        node.start();
    }

    public void testInvoke() throws NoSuchServiceException, NoSuchDomainException {
        HelloworldService service =
            SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent");
        String result = service.sayHello("petra");
        assertEquals("Hello petra", result);
        System.out.println("Result from SCAClient call = " + result);
    }
View Full Code Here

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

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("default"));
        HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
        assertEquals("Hello petra", service.sayHello("petra"));
       
        RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
        assertEquals("Hello petra", remoteService.sayHelloRemote("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.