axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@apache.org
Subject cvs commit: xml-axis/java/samples/addr Main.java
Date Tue, 16 Jul 2002 15:17:34 GMT
butek       2002/07/16 08:17:34

  Modified:    java/samples/addr Main.java
  Log:
  If the address book sample fails in the build, the build still succeeds.  The
  problem is samples.addr.Main swallows any exceptions.  A fix is to remove
  the try/catch block since we don't want the exception caught in the sample.
  
  Revision  Changes    Path
  1.21      +28 -33    xml-axis/java/samples/addr/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/addr/Main.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Main.java	19 Jun 2002 19:11:49 -0000	1.20
  +++ Main.java	16 Jul 2002 15:17:34 -0000	1.21
  @@ -125,44 +125,39 @@
       }
       
       public static void main (String[] args) throws Exception {
  -        try {
  -            Options opts = new Options(args);
  +        Options opts = new Options(args);
   
  -            System.err.println ("Using proxy without session maintenance.");
  -            System.err.println ("(queries without session should say:  \"ADDRESS NOT FOUND!\")");
  +        System.err.println ("Using proxy without session maintenance.");
  +        System.err.println ("(queries without session should say:  \"ADDRESS NOT FOUND!\")");
   
  -            AddressBookService abs = new AddressBookServiceLocator();
  -            opts.setDefaultURL( abs.getAddressBookAddress() );
  -            URL serviceURL = new URL(opts.getURL());
  +        AddressBookService abs = new AddressBookServiceLocator();
  +        opts.setDefaultURL( abs.getAddressBookAddress() );
  +        URL serviceURL = new URL(opts.getURL());
   
  -            AddressBook ab1 = null;
  -            if (serviceURL == null) {
  -                ab1 = abs.getAddressBook();
  -            }
  -            else {
  -                ab1 = abs.getAddressBook(serviceURL);
  -            }
  -            Object ret = doit (ab1);
  -            if (ret != null) {
  -                throw new Exception("non-session test expected null response, got "+ret);
  -            }
  +        AddressBook ab1 = null;
  +        if (serviceURL == null) {
  +            ab1 = abs.getAddressBook();
  +        }
  +        else {
  +            ab1 = abs.getAddressBook(serviceURL);
  +        }
  +        Object ret = doit (ab1);
  +        if (ret != null) {
  +            throw new Exception("non-session test expected null response, got " + ret);
  +        }
   
  -            System.err.println ("\n\nUsing proxy with session maintenance.");
  -            AddressBook ab2 = null;
  -            if (serviceURL == null) {
  -                ab2 = abs.getAddressBook();
  -            }
  -            else {
  -                ab2 = abs.getAddressBook(serviceURL);
  -            }
  -            ((AddressBookSOAPBindingStub) ab2).setMaintainSession (true);
  -            ret = doit (ab2);
  -            if (ret == null) {
  -                throw new Exception("session test expected non-null response, got "+ret);
  -            }
  +        System.err.println ("\n\nUsing proxy with session maintenance.");
  +        AddressBook ab2 = null;
  +        if (serviceURL == null) {
  +            ab2 = abs.getAddressBook();
  +        }
  +        else {
  +            ab2 = abs.getAddressBook(serviceURL);
           }
  -        catch (Exception e) {
  -            e.printStackTrace();
  +        ((AddressBookSOAPBindingStub) ab2).setMaintainSession (true);
  +        ret = doit (ab2);
  +        if (ret == null) {
  +            throw new Exception("session test expected non-null response, got " + ret);
           }
       }
   }
  
  
  

Mime
View raw message