Examples of FaultsServicePortType


Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

    /**
     * Tests that throwing of DerivedFault1_Exception
     */
    public void testFaultsService7(){
        FaultsServicePortType proxy = getProxy();
        Exception exception = null;
        try{
            // the invoke will throw an exception, if the test is performed right
            float total = proxy.getQuote("DF1");
            fail( "Expected DerivedFault1_Exception but no fault was thrown");
        }catch(DerivedFault1_Exception e){
            DerivedFault1_Exception fault = (DerivedFault1_Exception) e;

            DerivedFault1 faultInfo = fault.getFaultInfo();
            assertTrue(faultInfo != null);
            assertTrue(faultInfo.getA() == 100);
            assertTrue(faultInfo.getB().equals("DF1"));
        } catch (Exception e) {
            fail("Wrong exception thrown.  Expected DerivedFault1_Exception but received " + e.getClass());
        }
       
        // Repeat to verify behavior
        try{
            // the invoke will throw an exception, if the test is performed right
            float total = proxy.getQuote("DF1");
            fail( "Expected DerivedFault1_Exception but no fault was thrown");
        }catch(DerivedFault1_Exception e){
            DerivedFault1_Exception fault = (DerivedFault1_Exception) e;

            DerivedFault1 faultInfo = fault.getFaultInfo();
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests that throwing of DerivedFault1_Exception
     */
    public void testFaultsService8(){
        FaultsServicePortType proxy = getProxy();
        Exception exception = null;
        try{
            // the invoke will throw an exception, if the test is performed right
            float total = proxy.getQuote("DF2");
            fail( "Expected DerivedFault2_Exception but no fault was thrown ");
        }catch(DerivedFault2_Exception e){
            DerivedFault2_Exception fault = (DerivedFault2_Exception) e;

            DerivedFault2 faultInfo = fault.getFaultInfo();
            assertTrue(faultInfo != null);
            assertTrue(faultInfo.getA() == 200);
            assertTrue(faultInfo.getB().equals("DF2"));
            assertTrue(faultInfo.getC() == 80.0F);
        } catch (Exception e) {
            fail("Wrong exception thrown.  Expected DerivedFault1_Exception but received " + e.getClass());
        }
       
        // Repeat to verify behavior
        try{
            // the invoke will throw an exception, if the test is performed right
            float total = proxy.getQuote("DF2");
            fail( "Expected DerivedFault2_Exception but no fault was thrown ");
        }catch(DerivedFault2_Exception e){
            DerivedFault2_Exception fault = (DerivedFault2_Exception) e;

            DerivedFault2 faultInfo = fault.getFaultInfo();
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests that that SOAPFaultException is thrown
     */
    public void testFaultsService9a(){
        FaultsServicePortType proxy = getProxy();
        Exception exception = null;
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "SOAPFaultException", 2)// "SOAPFaultException" will cause service to throw SOAPFaultException
           
        }catch(SOAPFaultException e){
            // Okay
            exception = e;
        } catch (Exception e) {
            fail("Did not get a SOAPFaultException");
        }

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        SOAPFaultException sfe = (SOAPFaultException) exception;
        SOAPFault soapFault = sfe.getFault();
        assertTrue(soapFault != null);
        assertTrue(soapFault.getFaultString().equals("hello world"));
        assertTrue(soapFault.getFaultActor().equals("actor"));
        assertTrue(soapFault.getDetail() == null);
       
        // Repeat to verify behavior
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "SOAPFaultException", 2)// "SOAPFaultException" will cause service to throw SOAPFaultException
           
        }catch(SOAPFaultException e){
            // Okay
            exception = e;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests that that SOAPFaultException is thrown
     */
    public void testFaultsService9b(){
        FaultsServicePortType proxy = getProxy();
        Exception exception = null;
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "SOAPFaultException2", 2)// "SOAPFaultException" will cause service to throw SOAPFaultException
           
        }catch(SOAPFaultException e){
            // Okay
            exception = e;
        } catch (Exception e) {
            fail("Did not get a SOAPFaultException");
        }

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        SOAPFaultException sfe = (SOAPFaultException) exception;
        SOAPFault soapFault = sfe.getFault();
        assertTrue(soapFault != null);
        assertTrue(soapFault.getFaultString().equals("hello world2"));
        assertTrue(soapFault.getFaultActor().equals("actor2"));
        assertTrue(soapFault.getDetail() != null);
        DetailEntry de = (DetailEntry) soapFault.getDetail().getDetailEntries().next();
        assertTrue(de != null);
        assertTrue(de.getNamespaceURI().equals("urn://sample"));
        assertTrue(de.getLocalName().equals("detailEntry"));
        assertTrue(de.getValue().equals("Texas"));
       
        // Repeat to verify behavior
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "SOAPFaultException2", 2)// "SOAPFaultException" will cause service to throw SOAPFaultException
           
        }catch(SOAPFaultException e){
            // Okay
            exception = e;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests that that SOAPFaultException (NPE) is thrown
     */
    public void testFaultsService10(){
        FaultsServicePortType proxy = getProxy();
        Exception exception = null;
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "NPE", 2)// "NPE" will cause service to throw NPE System Exception
           
        }catch(SOAPFaultException e){
            // Okay
            exception = e;
        } catch (Exception e) {
            fail("Did not get a SOAPFaultException");
        }

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        SOAPFaultException sfe = (SOAPFaultException) exception;
        SOAPFault soapFault = sfe.getFault();
        assertTrue(soapFault != null);
        assertTrue(soapFault.getFaultString().equals("java.lang.NullPointerException"));
       
        // Repeat to verify behavior
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "NPE", 2)// "NPE" will cause service to throw NPE System Exception
           
        }catch(SOAPFaultException e){
            // Okay
            exception = e;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests that that SOAPFaultException (NPE) is thrown
     */
    public void testFaultsService10a(){
        FaultsServicePortType proxy = getProxy();
        Exception exception = null;
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "NPE2", 2)// "NPE" will cause service to throw NPE System Exception
           
        }catch(SOAPFaultException e){
            // Okay
            exception = e;
        } catch (Exception e) {
            fail("Did not get a SOAPFaultException");
        }

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        SOAPFaultException sfe = (SOAPFaultException) exception;
        SOAPFault soapFault = sfe.getFault();
        assertTrue(soapFault != null);
        assertTrue(soapFault.getFaultString().equals("Null Pointer Exception occurred"));
       
       
        // Repeat to verify behavior
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "NPE2", 2)// "NPE" will cause service to throw NPE System Exception
           
        }catch(SOAPFaultException e){
            // Okay
            exception = e;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests that that SOAPFaultException (for WebServiceException) is thrown
     */
    public void testFaultsService11(){
        FaultsServicePortType proxy = getProxy();
        Exception exception = null;
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "WSE", 2)// "WSE" will cause service to throw WebServiceException System Exception
           
        }catch(SOAPFaultException e){
            // Okay...on the client a SOAPFaultException should be thrown
            exception = e;
        } catch (Exception e) {
            fail("Did not get a SOAPFaultException");
        }

       
        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        SOAPFaultException sfe = (SOAPFaultException) exception;
        SOAPFault soapFault = sfe.getFault();
        assertTrue(soapFault != null);
        assertTrue(soapFault.getFaultString().equals("This is a WebServiceException"));
       
        // Repeat to verify behavior
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "WSE", 2)// "WSE" will cause service to throw WebServiceException System Exception
           
        }catch(SOAPFaultException e){
            // Okay...on the client a SOAPFaultException should be thrown
            exception = e;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests Resource injection
     */
    public void testResourceInjection() throws Exception {
        FaultsServicePortType proxy = getProxy();
       
        float total = proxy.getQuote("INJECTION");
       
        // If resource injection occurred properly, then the a value of 1234567 is expected
        assertTrue("Resource Injection Failed", total == 1234567);
       
        // Repeat to verify behavior
        total = proxy.getQuote("INJECTION");
       
        // If resource injection occurred properly, then the a value of 1234567 is expected
        assertTrue("Resource Injection Failed", total == 1234567);
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests that that SOAPFaultException (for WebServiceException) is thrown
     */
    public void testFaultsService11(){
        FaultsServicePortType proxy = getProxy();
        Exception exception = null;
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "WSE", 2)// "WSE" will cause service to throw WebServiceException System Exception
           
        }catch(SOAPFaultException e){
            // Okay...on the client a SOAPFaultException should be thrown
            exception = e;
        } catch (Exception e) {
            fail("Did not get a SOAPFaultException");
        }

       
        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        SOAPFaultException sfe = (SOAPFaultException) exception;
        SOAPFault soapFault = sfe.getFault();
        assertNotNull(soapFault);
        assertEquals("This is a WebServiceException", soapFault.getFaultString());
       
        // Repeat to verify behavior
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "WSE", 2)// "WSE" will cause service to throw WebServiceException System Exception
           
        }catch(SOAPFaultException e){
            // Okay...on the client a SOAPFaultException should be thrown
            exception = e;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType

   
    /**
     * Tests Resource injection
     */
    public void testResourceInjection() throws Exception {
        FaultsServicePortType proxy = getProxy();
       
        float total = proxy.getQuote("INJECTION");
       
        // If resource injection occurred properly, then the a value of 1234567 is expected
        assertEquals("Resource Injection Failed", 1234567F, total);
       
        // Repeat to verify behavior
        total = proxy.getQuote("INJECTION");
       
        // If resource injection occurred properly, then the a value of 1234567 is expected
        assertEquals("Resource Injection Failed", 1234567F, total);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.