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 ru...@apache.org on 2001/06/21 13:12:41 UTC

cvs commit: xml-axis/java/samples/transport FileTest.java

rubys       01/06/21 04:12:41

  Modified:    java/samples/transport FileTest.java
  Log:
  I plan to introduce tests which force (and verify) failures.  So let
  the caller decide whether or not to write out the failure, and whether
  or not to run the test again.
  
  Revision  Changes    Path
  1.7       +25 -39    xml-axis/java/samples/transport/FileTest.java
  
  Index: FileTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/FileTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FileTest.java	2001/06/21 02:45:31	1.6
  +++ FileTest.java	2001/06/21 11:12:39	1.7
  @@ -22,49 +22,35 @@
       FileReader  reader = new FileReader();
       reader.start();
   
  -    try {
  -      Options opts = new Options( args );
  +    Options opts = new Options( args );
       
  -      Debug.setDebugLevel( opts.isFlagSet( 'd' ) );
  +    Debug.setDebugLevel( opts.isFlagSet( 'd' ) );
       
  -      args = opts.getRemainingArgs();
  +    args = opts.getRemainingArgs();
       
  -      if ( args == null ) {
  -        System.err.println( "Usage: GetQuote <symbol>" );
  -        System.exit(1);
  -      }
  -    
  -      String   symbol = args[0] ;
  -      ServiceClient call = new ServiceClient();
  -      ServiceDescription sd = new ServiceDescription("stockQuotes", true);
  -      sd.addOutputParam("return", SOAPTypeMappingRegistry.XSD_FLOAT);
  -      call.setServiceDescription(sd);
  -    
  -      if ( opts.isFlagSet('t') > 0 ) call.doLocal = true ;
  -    
  -      call.set(Transport.USER, opts.getUser() );
  -      call.set(Transport.PASSWORD, opts.getPassword() );
  -      call.setTransportRequest( "FileSender" );
  -    
  -      Float res = new Float(0.0F);
  -      res = (Float) call.invoke( "urn:xmltoday-delayed-quotes",
  -                                 "getQuote",
  -                                 new Object[] {symbol} );
  -    
  -      System.out.println( symbol + ": " + res );
  -
  -      // Once more just for fun...
  -      res = (Float) call.invoke( "urn:xmltoday-delayed-quotes",
  -                                 "getQuote",
  -                                 new Object[] {symbol} );
  -    
  -      System.out.println( symbol + ": " + res );
  +    if ( args == null ) {
  +      System.err.println( "Usage: GetQuote <symbol>" );
  +      System.exit(1);
       }
  -    catch( Exception e ) {
  -      if ( e instanceof AxisFault ) ((AxisFault)e).dump();
  -      e.printStackTrace();
  -        throw e;
  -    }
  +    
  +    String   symbol = args[0] ;
  +    ServiceClient call = new ServiceClient();
  +    ServiceDescription sd = new ServiceDescription("stockQuotes", true);
  +    sd.addOutputParam("return", SOAPTypeMappingRegistry.XSD_FLOAT);
  +    call.setServiceDescription(sd);
  +  
  +    if ( opts.isFlagSet('t') > 0 ) call.doLocal = true ;
  +  
  +    call.set(Transport.USER, opts.getUser() );
  +    call.set(Transport.PASSWORD, opts.getPassword() );
  +    call.setTransportRequest( "FileSender" );
  +  
  +    Float res = new Float(0.0F);
  +    res = (Float) call.invoke( "urn:xmltoday-delayed-quotes",
  +                               "getQuote",
  +                               new Object[] {symbol} );
  +  
  +    System.out.println( symbol + ": " + res );
   
       reader.halt();
     }