Package org.apache.axis2.jaxws.sample.dlwmin.sei

Examples of org.apache.axis2.jaxws.sample.dlwmin.sei.Greeter


        return getTestSetup(new TestSuite(DLWMinTests.class));
    }

    private Greeter getProxy(String action) {
        Service service = Service.create(QNAME_SERVICE);
        Greeter proxy = service.getPort(QNAME_PORT, Greeter.class);
        BindingProvider p = (BindingProvider) proxy;
        p.getRequestContext().put(
                BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
        p.getRequestContext().put(
                BindingProvider.SOAPACTION_URI_PROPERTY, action);
View Full Code Here


     * Test simple greetMe method
     * with style doc/lit wrapped without the presence of wrapper classes.
     */
    public void testGreetMe() {
       
        Greeter proxy = getProxy("greetMe");
       
        String me = "Scheu";
        String response = proxy.greetMe(me);
        assertTrue("Hello Scheu".equals(response));
       
        // Try the call again
        response = proxy.greetMe(me);
        assertTrue("Hello Scheu".equals(response));
    }
View Full Code Here

     * Test simple greetMe method
     * with style doc/lit wrapped without the presence of wrapper classes.
     */
    public void testUnqualified() {
       
        Greeter proxy = getProxy("testUnqualified");
       
        String request = "hello world";
        String response = proxy.testUnqualified(request);
        assertTrue("hello world".equals(response));
       
        // Try the call again
        response = proxy.testUnqualified(request);
        assertTrue("hello world".equals(response));
    }
View Full Code Here

    /**
     * Test echo with complexType
     */
    public void testProcess_Echo()  throws Exception {
       
        Greeter proxy = getProxy("process");
       
        TestBean request = new TestBean();
        request.setData1("hello world");
        request.setData2(10);
        TestBean response = proxy.process(0, request);
        assertTrue(response != null);
        assertTrue(response.getData1().equals("hello world"));
        assertTrue(response.getData2() == 10);
       
       
        // Try the call again to verify
        response = proxy.process(0, request);
        assertTrue(response != null);
        assertTrue(response.getData1().equals("hello world"));
        assertTrue(response.getData2() == 10);
    }
View Full Code Here

    /**
     * Test throwing checked exception w/o a JAXB Bean
     */
    public void testProcess_CheckException()  throws Exception {
       
        Greeter proxy = getProxy("process");
       
        TestBean request = new TestBean();
        request.setData1("hello world");
        request.setData2(10);
        try {
            TestBean response = proxy.process(1, request);
            fail("Expected TestException thrown");
        } catch (WebServiceException wse) {
            // Currently there is no support if the fault bean is missing
            assertTrue(wse.getMessage().contains("User fault processing is not supported"));
        } catch (TestException te) {
            assertTrue(te.getMessage().equals("TestException thrown"));
            assertTrue(te.getFlag() == 123);
        } catch (Exception e) {
            fail("Expected TestException thrown but found " + e.getClass());
        }
       
        // Try the call again to verify
        try {
            TestBean response = proxy.process(1, request);
            fail("Expected TestException thrown");
        } catch (WebServiceException wse) {
            // Currently there is no support if the fault bean is missing
            assertTrue(wse.getMessage().contains("User fault processing is not supported"));
        } catch (TestException te) {
View Full Code Here

    /**
     * Test throwing checked exception that has a JAXB Bean
     */
    public void testProcess_CheckException2()  throws Exception {
       
        Greeter proxy = getProxy("process");
       
        TestBean request = new TestBean();
        request.setData1("hello world");
        request.setData2(10);
        try {
            TestBean response = proxy.process(4, request);
            fail("Expected TestException2 thrown");
        } catch (TestException2 te) {
            assertTrue(te.getMessage().equals("TestException2 thrown"));
            assertTrue(te.getFlag() == 456);
        } catch (Exception e) {
            fail("Expected TestException2 thrown but found " + e.getClass());
        }
       
        // Try the call again to verify the same behavior
        try {
            TestBean response = proxy.process(4, request);
            fail("Expected TestException2 thrown");
        } catch (TestException2 te) {
            assertTrue(te.getMessage().equals("TestException2 thrown"));
            assertTrue(te.getFlag() == 456);
        } catch (Exception e) {
View Full Code Here

    /**
     * Test throwing checked exception that is a compliant JAXWS exception
     */
    public void testProcess_CheckException3()  throws Exception {
       
        Greeter proxy = getProxy("process");
       
        TestBean request = new TestBean();
        request.setData1("hello world");
        request.setData2(10);
        try {
            TestBean response = proxy.process(5, request);
            fail("Expected TestException3 thrown");
        } catch (TestException3 te) {
            assertTrue(te.getMessage().equals("TestException3 thrown"));
            assertTrue(te.getFaultInfo().getFlag() == 789);
        } catch (Exception e) {
            fail("Expected TestException3 thrown but found " + e.getClass());
        }
       
        // Try the call again to verify the same behavior
        try {
            TestBean response = proxy.process(5, request);
            fail("Expected TestException3 thrown");
        } catch (TestException3 te) {
            assertTrue(te.getMessage().equals("TestException3 thrown"));
            assertTrue(te.getFaultInfo().getFlag() == 789);
        } catch (Exception e) {
View Full Code Here

    /**
     * Test throwing WebServiceException
     */
    public void testProcess_WebServiceException()  throws Exception {
       
        Greeter proxy = getProxy("process");
       
        TestBean request = new TestBean();
        request.setData1("hello world");
        request.setData2(10);
        try {
            TestBean response = proxy.process(2, request);
            fail("Expected WebServiceException thrown");
        } catch (WebServiceException wse) {
            assertTrue(wse.getMessage().equals("WebServiceException thrown"));
        } catch (Exception e) {
            fail("Expected WebServiceException thrown but found " + e.getClass());
        }
       
        // Try the call again to verify the same behavior
        try {
            TestBean response = proxy.process(2, request);
            fail("Expected WebServiceException thrown");
        } catch (WebServiceException wse) {
            assertTrue(wse.getMessage().equals("WebServiceException thrown"));
        } catch (Exception e) {
            fail("Expected WebServiceException thrown but found " + e.getClass());
View Full Code Here

    /**
     * Test throwing NPE
     */
    public void testProcess_NPE()  throws Exception {
       
        Greeter proxy = getProxy("process");
       
        TestBean request = new TestBean();
        request.setData1("hello world");
        request.setData2(10);
        try {
            TestBean response = proxy.process(3, request);
            fail("Expected NullPointerException thrown");
        } catch (WebServiceException wse) {
            assertTrue(wse.getMessage().equals("NPE thrown"));
        } catch (Exception e) {
            fail("Expected NullPointerException thrown but found " + e.getClass());
        }
       
        // Try the call again to verify the same behavior
        try {
            TestBean response = proxy.process(3, request);
            fail("Expected NullPointerException thrown");
        } catch (WebServiceException wse) {
            assertTrue(wse.getMessage().equals("NPE thrown"));
        } catch (Exception e) {
            fail("Expected NullPointerException thrown but found " + e.getClass());
View Full Code Here

     * Passing a null input and receiving a null return
     */
    public void testGreetMe_Null() {
       
       
        Greeter proxy = getProxy("greetMe");
       
        String me = null;
        String response = proxy.greetMe(me);
        assertTrue("Expected null but received " + response, response == null);
       
        // Try the call again
        response = proxy.greetMe(me);
        assertTrue("Expected null but received " + response, response == null);
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.sample.dlwmin.sei.Greeter

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.