Package org.oasisopen.sca.client

Examples of org.oasisopen.sca.client.SCAClientFactory


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

        try {
            SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("someBadDomainName"));
            fail();
        } catch (NoSuchDomainException e) {
            // expected
        }
    }
View Full Code Here


    public void testDefault() throws Exception {

        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

    @Test
    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

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

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        try {
            clientFactory.getService(HelloworldService.class, "HelloworldComponent");
            fail("expecting ServiceRuntimeException");
        } catch (ServiceRuntimeException e) {
            assertTrue(e.getMessage().contains("More than one service is declared on component"));
        }
    }
View Full Code Here

    @Test
    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

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

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

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

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        try {
           clientFactory.getService(HelloworldService.class, "HelloworldComponent/foo");
           fail();
        } catch (NoSuchServiceException e) {
            // expected
        }
    }
View Full Code Here

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

        try {
            SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("someBadDomainName"));
            fail();
        } catch (NoSuchDomainException e) {
            // expected
        }
    }
View Full Code Here

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

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        RemoteHelloworldService service = clientFactory.getService(RemoteHelloworldService.class, "OnlyWSBindingComponent/RemoteHelloworldService");
        assertEquals("Hello petra", service.sayHelloRemote("petra"));
    }
View Full Code Here

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

        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
        RemoteHelloworldService service = clientFactory.getService(RemoteHelloworldService.class, "MultipleBindingsComponent/RemoteHelloworldService");
        assertEquals("Hello petra", service.sayHelloRemote("petra"));
    }
View Full Code Here

TOP

Related Classes of org.oasisopen.sca.client.SCAClientFactory

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.