Package org.apache.tuscany.sca.binding.ws.axis2.helloworld

Examples of org.apache.tuscany.sca.binding.ws.axis2.helloworld.HelloWorldService


        context = CurrentCompositeContext.getContext();
    }

    public void testHelloWorld() throws Exception {
        HelloWorldService helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponent");
        assertEquals(helloWorldService.sayHello("petra"), "Hello petra");
    }
View Full Code Here


        HelloWorldService helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponent");
        assertEquals(helloWorldService.sayHello("petra"), "Hello petra");
    }

    public void testIntrospectedHelloWorld() throws Exception {
        HelloWorldService introspectableService = context.locateService(HelloWorldService.class, "IntrospectableHelloWorldComponent");
        assertEquals(introspectableService.sayHello("petra"), "Hello petra");
    }
View Full Code Here

        HelloWorldService introspectableService = context.locateService(HelloWorldService.class, "IntrospectableHelloWorldComponent");
        assertEquals(introspectableService.sayHello("petra"), "Hello petra");
    }
   
    public void testE4XImplInvocation() throws Exception {
        HelloWorldService e4xHelloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponentE4X");
        String xmlInput = "<hel:getGreetings xmlns:hel=\"http://helloworld\"> " +
                            "<hel:name>TuscanyWorld</hel:name> " +
                        "</hel:getGreetings>";
       
        XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(
                                       new ByteArrayInputStream(xmlInput.getBytes()));
        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(OMAbstractFactory.getOMFactory(), xmlReader);
        Object response = e4xHelloWorldService.sayE4XHello(staxOMBuilder.getDocumentElement());
        assertNotNull(response);
        assertTrue(response instanceof OMElement);
        assertEquals("e4xHello TuscanyWorld", ((OMElement)response).getFirstElement().getText());
        //System.out.println(response);
    }
View Full Code Here

        //System.out.println(response);
    }
   
    public void testE4XRefInvocation() throws Exception
    {
        HelloWorldService e4xHelloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponentE4X");

        String initialInput = "JavaClient";
        String jsAddition = " thro e4x reference";
        String endSvcImplResponse = "Hello from Java Implementation to ";
       
        Object response = e4xHelloWorldService.sayHello(initialInput);
        assertNotNull(response);
        assertTrue(response instanceof String);
        assertEquals(endSvcImplResponse + initialInput + jsAddition, response.toString());
        //System.out.println(response);
    }
View Full Code Here

        assertEquals(endSvcImplResponse + initialInput + jsAddition, response.toString());
        //System.out.println(response);
    }

    public void testHelloWorldProperty() throws Exception {
        HelloWorldService helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldProperty");
        assertEquals(helloWorldService.sayHello("petra"), "Kia ora petra");
        System.out.println(helloWorldService.sayHello("petra"));
    }
View Full Code Here

        assertEquals(helloWorldService.sayHello("petra"), "Kia ora petra");
        System.out.println(helloWorldService.sayHello("petra"));
    }

    public void testHelloWorldPropertyDefault() throws Exception {
        HelloWorldService helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldPropertyDefault");
        assertEquals(helloWorldService.sayHello("petra"), "Hi petra");
    }
View Full Code Here

//        assertEquals("1", composoteScopeService.sayHello(""));
//        assertEquals("2", composoteScopeService.sayHello(""));
//    }

    public void testStateless() throws Exception {
        HelloWorldService statelessService = context.locateService(HelloWorldService.class, "StatelessComponent");
        assertEquals("1", statelessService.sayHello(""));
        // stateless gives a new instance for each request
        assertEquals("1", statelessService.sayHello(""));
    }
View Full Code Here

        }

    }

    public void testServiceCall() throws IOException {
        HelloWorldService helloWorldService_one =
            domain.getService(HelloWorldService.class, "HelloWorldServiceComponent_one/HelloWorldService");
        assertNotNull(helloWorldService_one);

        assertEquals("Hello Smith", helloWorldService_one.getGreetings("Smith"));

    }
View Full Code Here

        SCANodeFactory factory = SCANodeFactory.newInstance();
        SCANode node = factory.createSCANode(new File("src/main/resources/imports/wsdl/helloworldws.composite").toURL().toString(),
                new SCAContribution("TestContribution", new File("src/main/resources/imports/wsdl/").toURL().toString()));
        node.start();       
             
        HelloWorldService hwService =
            ((SCAClient)node).getService(HelloWorldService.class, "HelloWorldServiceComponent");
       
        System.out.println("Hello " + hwService.getGreetings("World"));

        node.stop();
        System.out.println("Bye");
    }
View Full Code Here

    }

    @Test
    public void testReference() throws MalformedURLException, IOException {
       
        HelloWorldService client = node.getService(HelloWorldService.class, "HelloWorldClient");

        Assert.assertEquals("Hello beate", client.sayHello("beate"));
        Assert.assertEquals("Hello beate arnold", client.sayHello2("beate", "arnold"));

    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.ws.axis2.helloworld.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.