Examples of FaultyWebServiceFault_Exception


Examples of org.apache.axis2.jaxws.sample.faults.FaultyWebServiceFault_Exception

    }



    public void testFaultyWebService(){
        FaultyWebServiceFault_Exception exception = null;
        try{
            TestLogger.logger.debug("----------------------------------");
            TestLogger.logger.debug("test: " + getName());
            FaultyWebServiceService service = new FaultyWebServiceService();
            FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
            BindingProvider p =  (BindingProvider)proxy;
            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);

            // the invoke will throw an exception, if the test is performed right
            int total = proxy.faultyWebService(10);

        }catch(FaultyWebServiceFault_Exception e){
            exception = e;
        }catch(Exception e) {
            e.printStackTrace();
            fail(e.toString());
        }

        TestLogger.logger.debug("----------------------------------");

        assertNotNull(exception);
        assertEquals("custom exception", exception.getMessage());
        assertNotNull(exception.getFaultInfo());
        assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
        assertEquals("bean custom message", exception.getFaultInfo().getMessage());

    }
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faults.FaultyWebServiceFault_Exception

import org.test.faults.FaultyWebServiceResponse;

public class FaultyWebServiceTests extends TestCase {
  String axisEndpoint = "http://localhost:8080/axis2/services/FaultyWebServiceService";
  public void testFaultyWebService(){
    FaultyWebServiceFault_Exception exception = null;
    try{
            TestLogger.logger.debug("----------------------------------");
            TestLogger.logger.debug("test: " + getName());
        FaultyWebServiceService service = new FaultyWebServiceService();
        FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
      BindingProvider p =  (BindingProvider)proxy;
      p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);

      // the invoke will throw an exception, if the test is performed right
      int total = proxy.faultyWebService(10);
     
    }catch(FaultyWebServiceFault_Exception e){
      exception = e;
    }catch(Exception e) {
           e.printStackTrace();
           fail(e.toString());
        }

        TestLogger.logger.debug("----------------------------------");
   
    assertNotNull(exception);
    assertEquals("custom exception", exception.getMessage());
    assertNotNull(exception.getFaultInfo());
    assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
    assertEquals("bean custom message", exception.getFaultInfo().getMessage());
   
  }
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faults.FaultyWebServiceFault_Exception

        TestLogger.logger.debug("----------------------------------");
        TestLogger.logger.debug("test: " + getName());
        FaultyWebServiceService service = new FaultyWebServiceService();
        FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
       
        FaultyWebServiceFault_Exception exception = null;
        try{
            exception = null;
            BindingProvider p =  (BindingProvider)proxy;
            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);

            // the invoke will throw an exception, if the test is performed right
            int total = proxy.faultyWebService(10);

        }catch(FaultyWebServiceFault_Exception e){
            exception = e;
        }catch(Exception e) {
            e.printStackTrace();
            fail(e.toString());
        }

        TestLogger.logger.debug("----------------------------------");

        assertNotNull(exception);
        assertEquals("custom exception", exception.getMessage());
        assertNotNull(exception.getFaultInfo());
        assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
        assertEquals("bean custom message", exception.getFaultInfo().getMessage());
       
        // Repeat to verify behavior
        try{
            exception = null;
            BindingProvider p = (BindingProvider)proxy;
            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);

            // the invoke will throw an exception, if the test is performed right
            int total = proxy.faultyWebService(10);

        }catch(FaultyWebServiceFault_Exception e){
            exception = e;
        }catch(Exception e) {
            e.printStackTrace();
            fail(e.toString());
        }

        TestLogger.logger.debug("----------------------------------");

        assertNotNull(exception);
        assertEquals("custom exception", exception.getMessage());
        assertNotNull(exception.getFaultInfo());
        assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
        assertEquals("bean custom message", exception.getFaultInfo().getMessage());

    }
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faults.FaultyWebServiceFault_Exception

        TestLogger.logger.debug("----------------------------------");
        TestLogger.logger.debug("test: " + getName());
        FaultyWebServiceService service = new FaultyWebServiceService();
        FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
       
        FaultyWebServiceFault_Exception exception = null;
        try{
            exception = null;
            BindingProvider p =  (BindingProvider)proxy;
            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);

            // the invoke will throw an exception, if the test is performed right
            int total = proxy.faultyWebService(10);

        }catch(FaultyWebServiceFault_Exception e){
            exception = e;
        }catch(Exception e) {
            e.printStackTrace();
            fail(e.toString());
        }

        TestLogger.logger.debug("----------------------------------");

        assertNotNull(exception);
        assertEquals("custom exception", exception.getMessage());
        assertNotNull(exception.getFaultInfo());
        assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
        assertEquals("bean custom message", exception.getFaultInfo().getMessage());
       
        // Repeat to verify behavior
        try{
            exception = null;
            BindingProvider p = (BindingProvider)proxy;
            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);

            // the invoke will throw an exception, if the test is performed right
            int total = proxy.faultyWebService(10);

        }catch(FaultyWebServiceFault_Exception e){
            exception = e;
        }catch(Exception e) {
            e.printStackTrace();
            fail(e.toString());
        }

        TestLogger.logger.debug("----------------------------------");

        assertNotNull(exception);
        assertEquals("custom exception", exception.getMessage());
        assertNotNull(exception.getFaultInfo());
        assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
        assertEquals("bean custom message", exception.getFaultInfo().getMessage());

    }
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.faults.FaultyWebServiceFault_Exception

import org.test.faults.FaultyWebServiceResponse;

public class FaultyWebServiceTests extends TestCase {
  String axisEndpoint = "http://localhost:8080/axis2/services/FaultyWebServiceService";
  public void testFaultyWebService(){
    FaultyWebServiceFault_Exception exception = null;
    try{
            TestLogger.logger.debug("----------------------------------");
            TestLogger.logger.debug("test: " + getName());
        FaultyWebServiceService service = new FaultyWebServiceService();
        FaultyWebServicePortType proxy = service.getFaultyWebServicePort();
      BindingProvider p =  (BindingProvider)proxy;
      p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);

      // the invoke will throw an exception, if the test is performed right
      int total = proxy.faultyWebService(10);
     
    }catch(FaultyWebServiceFault_Exception e){
      exception = e;
    }catch(Exception e) {
           e.printStackTrace();
           fail(e.toString());
        }

        TestLogger.logger.debug("----------------------------------");
   
    assertNotNull(exception);
    assertEquals("custom exception", exception.getMessage());
    assertNotNull(exception.getFaultInfo());
    assertEquals("bean custom fault info", exception.getFaultInfo().getFaultInfo());
    assertEquals("bean custom message", exception.getFaultInfo().getMessage());
   
  }
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.