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 gd...@apache.org on 2004/07/13 00:43:28 UTC

cvs commit: ws-axis/java/test/client TestCall.java

gdaniels    2004/07/12 15:43:28

  Modified:    java/test/client TestCall.java
  Log:
  Little cleanup - throw actual exception, not a new one.
  
  Revision  Changes    Path
  1.4       +8 -16     ws-axis/java/test/client/TestCall.java
  
  Index: TestCall.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/client/TestCall.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestCall.java	25 Feb 2004 14:02:54 -0000	1.3
  +++ TestCall.java	12 Jul 2004 22:43:28 -0000	1.4
  @@ -19,13 +19,11 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.MessageContext;
   import org.apache.axis.client.Call;
  -import org.apache.axis.handlers.BasicHandler;
   
  -import java.net.URL;
  -import java.net.ConnectException;
   import java.io.InterruptedIOException;
  +import java.net.ConnectException;
  +import java.net.URL;
   
   public class TestCall extends TestCase {
       public TestCall(String name) {
  @@ -40,7 +38,7 @@
       }
   
       /* Test case for Bug 23031 - No deserializer found for ns1:ArrayOfstring */
  -    public void testWeatherService() {
  +    public void testWeatherService() throws Exception {
           try {
               Call call = new Call(new URL("http://live.capescience.com:80/ccx/GlobalWeather"));
               call.setUseSOAPAction(true);
  @@ -52,21 +50,15 @@
               for (int i = 0; i < c.length; i++) {
                   System.out.println(c[i]);
               }
  -        }  catch (java.rmi.RemoteException re) {
  -            if (re instanceof AxisFault) {
  -                AxisFault fault = (AxisFault) re;
  -                if (fault.detail instanceof ConnectException ||
  +        }  catch (AxisFault fault) {
  +            if (fault.detail instanceof ConnectException ||
                       fault.detail instanceof InterruptedIOException ||
                       (fault.getFaultString().indexOf("Connection timed out") != -1) ||
                       fault.getFaultCode().getLocalPart().equals("HTTP")) {
  -                    System.err.println("getTemp HTTP error: " + fault);
  -                    return;
  -                }
  +                System.err.println("getTemp HTTP error: " + fault);
  +                return;
               }
  -            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
  -        }  catch (java.io.IOException ioe) {
  -            System.err.println("testWeatherService connect error: " + ioe);
  -            return;
  +            throw fault;
           }
       }
   }