You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2002/10/01 14:43:11 UTC

cvs commit: xml-axis/java/test/wsdl/terra TerraServiceTestCase.java

dims        2002/10/01 05:43:11

  Modified:    java/test/wsdl/terra TerraServiceTestCase.java
  Log:
  Continue gracefully even when TerraService is down.
  
  Revision  Changes    Path
  1.2       +12 -0     xml-axis/java/test/wsdl/terra/TerraServiceTestCase.java
  
  Index: TerraServiceTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/terra/TerraServiceTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TerraServiceTestCase.java	13 Sep 2002 13:42:22 -0000	1.1
  +++ TerraServiceTestCase.java	1 Oct 2002 12:43:11 -0000	1.2
  @@ -7,6 +7,10 @@
   
   package test.wsdl.terra;
   
  +import org.apache.axis.AxisFault;
  +
  +import java.net.ConnectException;
  +
   public class TerraServiceTestCase extends junit.framework.TestCase {
       public TerraServiceTestCase(java.lang.String name) {
           super(name);
  @@ -39,6 +43,14 @@
               }
           }
           catch (java.rmi.RemoteException re) {
  +            if (re instanceof AxisFault) {
  +                AxisFault fault = (AxisFault) re;
  +                if (fault.detail instanceof ConnectException ||
  +                    fault.getFaultCode().getLocalPart().equals("HTTP")) {
  +                    System.err.println("TerraService HTTP error: " + fault);
  +                    return;
  +                }
  +            }
               throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
           }
       }