axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject cvs commit: xml-axis/java/test/functional TestTransportSample.java
Date Wed, 17 Oct 2001 21:12:59 GMT
gdaniels    01/10/17 14:12:59

  Modified:    java/samples/transport FileTest.java client_deploy.xml
                        testit.cmd
               java/src/org/apache/axis AxisEngine.java
               java/src/org/apache/axis/client Call.java
               java/src/org/apache/axis/suppliers
                        TargetedChainSupplier.java
               java/src/org/apache/axis/utils Admin.java
               java/test/functional TestTransportSample.java
  Log:
  Fix File transport tests, make transport tests really work in functional tests.
  
  * Admin now forces the internally created engine to save it's config after
    modification when directly invoked (since that's the point).
  
  * File test now programattically deploys the FileSender and FileTransport.
  
  * Cleaned up exceptions in Call a little
  
  Revision  Changes    Path
  1.16      +16 -0     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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- FileTest.java	2001/10/17 20:53:04	1.15
  +++ FileTest.java	2001/10/17 21:12:58	1.16
  @@ -5,6 +5,8 @@
   import org.apache.axis.client.Transport;
   import org.apache.axis.encoding.XMLType;
   import org.apache.axis.utils.Options;
  +import org.apache.axis.AxisEngine;
  +import org.apache.axis.suppliers.TransportSupplier;
   
   /** Tests the simple File transport.  To run:
    *      java org.apache.axis.utils.Admin client client_deploy.xml
  @@ -31,6 +33,20 @@
           String   symbol = args[0] ;
           Service  service = new Service();
           Call     call    = (Call) service.createCall();
  +
  +        AxisEngine engine = call.getEngine();
  +
  +        // Manually deploy file sender and file transport for this example
  +        engine.deployHandler("FileSender", new FileSender());
  +        engine.deployTransport("FileTransport",
  +                               new TransportSupplier("FileTransport",
  +                                                     null,
  +                                                     null,
  +                                                     "FileSender",
  +                                                     null,
  +                                                     engine.getHandlerRegistry())
  +                                );
  +
           call.setOperationName( "getQuote" );
           call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
           call.setProperty( Call.NAMESPACE, "urn:xmltoday-delayed-quotes" );
  
  
  
  1.3       +2 -2      xml-axis/java/samples/transport/client_deploy.xml
  
  Index: client_deploy.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/client_deploy.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- client_deploy.xml	2001/06/27 16:18:05	1.2
  +++ client_deploy.xml	2001/10/17 21:12:58	1.3
  @@ -4,7 +4,7 @@
   <!--      from the same dir that the Axis client will run in    -->
   <!-- This file will be replaced by WSDD once it's ready         -->
   
  -<deploy>
  +<m:deploy xmlns:m="AdminService">
     <handler name="FileSender" class="samples.transport.FileSender" />
     <transport name="FileTransport" pivot="FileSender"/>
  -</deploy>
  +</m:deploy>
  
  
  
  1.2       +0 -1      xml-axis/java/samples/transport/testit.cmd
  
  Index: testit.cmd
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/testit.cmd,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testit.cmd	2001/05/31 14:43:13	1.1
  +++ testit.cmd	2001/10/17 21:12:58	1.2
  @@ -1,3 +1,2 @@
  -java org.apache.axis.utils.Admin client client_deploy.xml
   java org.apache.axis.utils.Admin server deploy.xml
   java samples.transport.FileTest XXX
  
  
  
  1.34      +5 -0      xml-axis/java/src/org/apache/axis/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- AxisEngine.java	2001/10/16 19:00:02	1.33
  +++ AxisEngine.java	2001/10/17 21:12:59	1.34
  @@ -226,6 +226,11 @@
           saveConfiguration();
       }
   
  +    public void setShouldSaveConfig(boolean shouldSaveConfig)
  +    {
  +        this.shouldSaveConfig = shouldSaveConfig;
  +    }
  +
       public HandlerRegistry getHandlerRegistry()
       {
           return _handlerRegistry;
  
  
  
  1.15      +20 -18    xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Call.java	2001/10/17 20:20:24	1.14
  +++ Call.java	2001/10/17 21:12:59	1.15
  @@ -143,7 +143,7 @@
       private static Hashtable transports  = new Hashtable();
       private static boolean   initialized = false;
   
  -    private static FileProvider configProvider = 
  +    private static FileProvider configProvider =
                              new FileProvider(Constants.CLIENT_CONFIG_FILE);
   
   
  @@ -197,7 +197,7 @@
               paramTypes = new Vector();
               paramModes = new Vector();
           }
  -        
  +
           paramNames.add( paramName );
           paramTypes.add( paramType.getType() );
           paramModes.add( new Integer(parameterMode) );
  @@ -324,7 +324,7 @@
                   transport.setTransportName( name );
               return ;
            }
  -        if (myProperties == null) 
  +        if (myProperties == null)
               myProperties = new Hashtable();
           myProperties.put(name, value);
       }
  @@ -378,7 +378,7 @@
               /* ok, we're doing Messaging, so build up the message */
               /******************************************************/
               env = new SOAPEnvelope();
  -            
  +
               for ( i = 0 ; myHeaders != null && i < myHeaders.size() ; i++ )
                   env.addHeader((SOAPHeader)myHeaders.get(i));
   
  @@ -410,6 +410,8 @@
                   return( this.invoke(ns,operationName,getParamList(params)) );
           }
           catch( Exception exp ) {
  +            if ( exp instanceof AxisFault ) throw (AxisFault) exp ;
  +
               throw new AxisFault( "Error invoking operation",
                                                   exp );
           }
  @@ -447,9 +449,9 @@
        * @param env a SOAPEnvelope to send.
        * @exception AxisFault
        */
  -    public SOAPEnvelope invoke(SOAPEnvelope env) 
  +    public SOAPEnvelope invoke(SOAPEnvelope env)
                                     throws java.rmi.RemoteException {
  -        try { 
  +        try {
               Message msg = null ;
               int     i ;
   
  @@ -503,7 +505,7 @@
           if (!initialized) {
               addTransportPackage("org.apache.axis.transport");
   
  -            setTransportForProtocol("local", 
  +            setTransportForProtocol("local",
                            org.apache.axis.transport.local.LocalTransport.class);
               setTransportForProtocol("http", HTTPTransport.class);
               setTransportForProtocol("https", HTTPTransport.class);
  @@ -539,7 +541,7 @@
   
       /**
        * Change the AxisEngine being used by this Call object.  This should
  -     * be called right away after creating the Call object since any 
  +     * be called right away after creating the Call object since any
        * values in the old msgContext object associated with the old engine
        * will NOT be carried over to the new msgContext of this new engine.
        *
  @@ -572,7 +574,7 @@
        * @param  params   Array of parameters to pass into the operation/method
        * @return Object[] Array of parameters to pass to invoke()
        */
  -    private Object[] getParamList(Object[] params) 
  +    private Object[] getParamList(Object[] params)
                              throws org.apache.axis.rpc.JAXRPCException {
           int  numParams = 0 ;
           int  i ;
  @@ -591,10 +593,10 @@
           }
   
           if ( numParams != params.length )
  -            throw new org.apache.axis.rpc.JAXRPCException( 
  +            throw new org.apache.axis.rpc.JAXRPCException(
                                          "Number of parameters passed in (" +
                                          params.length + ") doesn't match the " +
  -                                       "number of IN/INOUT parameters (" + 
  +                                       "number of IN/INOUT parameters (" +
                                          numParams + ") from the addParameter" +
                                          "() calls" );
   
  @@ -605,7 +607,7 @@
           for ( i = 0 ; i < numParams ; i++ ) {
               if (((Integer)paramModes.get(i)).intValue() == Call.PARAM_MODE_OUT)
                   continue ;
  -            RPCParam p = new RPCParam( (String) paramNames.get(i), 
  +            RPCParam p = new RPCParam( (String) paramNames.get(i),
                                             params[j++] );
               result.add( p );
           }
  @@ -614,7 +616,7 @@
       }
   
       /**
  -     * Set the Transport 
  +     * Set the Transport
        *
        * Note: Not part of JAX-RPC specification.
        *
  @@ -734,7 +736,7 @@
        * @param qName the xsi:type QName of the associated XML type.
        * @param serializer a Serializer which will be used to write the XML.
        */
  -    public void addSerializer(Class _class, org.apache.axis.utils.QName qName, 
  +    public void addSerializer(Class _class, org.apache.axis.utils.QName qName,
                                 Serializer serializer){
           TypeMappingRegistry typeMap = msgContext.getTypeMappingRegistry();
           typeMap.addSerializer(_class, qName, serializer);
  @@ -750,7 +752,7 @@
        * @param deserializerFactory a factory which can create deserializer
        *                            instances for this type.
        */
  -    public void addDeserializerFactory(org.apache.axis.utils.QName qName, 
  +    public void addDeserializerFactory(org.apache.axis.utils.QName qName,
                                          Class _class,
                                          DeserializerFactory deserFactory){
           TypeMappingRegistry typeMap = msgContext.getTypeMappingRegistry();
  @@ -778,7 +780,7 @@
        * @return a deserialized Java Object containing the return value
        * @exception AxisFault
        */
  -    public Object invoke(String namespace, String method, Object[] args) 
  +    public Object invoke(String namespace, String method, Object[] args)
                       throws AxisFault {
           category.debug("Enter: Call::invoke(ns, meth, args)" );
           RPCElement  body = new RPCElement(namespace, method, args);
  @@ -879,7 +881,7 @@
           resMsg = msgContext.getResponseMessage();
   
           if (resMsg == null)
  -            throw new AxisFault(new Exception("Null response message!"));
  +            throw new AxisFault("Null response message!");
   
           /** This must happen before deserialization...
            */
  @@ -948,7 +950,7 @@
                           intValue = ((Integer)value).intValue();
                       else
                           intValue = Integer.parseInt((String)value);
  -                        
  +
                       msgContext.setTimeout( intValue );
                   }
                   else
  
  
  
  1.10      +2 -2      xml-axis/java/src/org/apache/axis/suppliers/TargetedChainSupplier.java
  
  Index: TargetedChainSupplier.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/suppliers/TargetedChainSupplier.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TargetedChainSupplier.java	2001/10/03 15:30:07	1.9
  +++ TargetedChainSupplier.java	2001/10/17 21:12:59	1.10
  @@ -130,7 +130,7 @@
               c.setOptions(_options);
               c.setName(_myName);
               
  -            if (!_requestNames.isEmpty()) {
  +            if (_requestNames != null && !_requestNames.isEmpty()) {
                   if (_requestNames.size() == 1) {
                       h = _registry.find((String)_requestNames.elementAt(0));
                       c.setRequestHandler(h);
  @@ -144,7 +144,7 @@
               h = _registry.find(_pivotName);
               c.setPivotHandler(h);
   
  -            if (!_responseNames.isEmpty()) {
  +            if (_responseNames != null && !_responseNames.isEmpty()) {
                   if (_responseNames.size() == 1) {
                       h = _registry.find((String)_responseNames.elementAt(0));
                       c.setResponseHandler(h);
  
  
  
  1.69      +1 -0      xml-axis/java/src/org/apache/axis/utils/Admin.java
  
  Index: Admin.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Admin.java,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- Admin.java	2001/10/17 13:16:36	1.68
  +++ Admin.java	2001/10/17 21:12:59	1.69
  @@ -908,6 +908,7 @@
               engine = new AxisClient(new FileProvider("client-config.xml"));
           else
               engine = new AxisServer(new FileProvider("server-config.xml"));
  +        engine.setShouldSaveConfig(true);
           engine.init();
           MessageContext msgContext = new MessageContext(engine);
   
  
  
  
  1.13      +0 -7      xml-axis/java/test/functional/TestTransportSample.java
  
  Index: TestTransportSample.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/functional/TestTransportSample.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestTransportSample.java	2001/10/17 18:24:10	1.12
  +++ TestTransportSample.java	2001/10/17 21:12:59	1.13
  @@ -83,11 +83,6 @@
           super(name);
       }
       
  -    public void doTestClientDeploy () throws Exception {
  -        String[] args = { "client", "samples/transport/client_deploy.xml" };
  -        Admin.main(args);
  -    }
  -    
       public void doTestDeploy () throws Exception {
           String[] args = { "server", "samples/transport/deploy.xml" };
           Admin.main(args);
  @@ -123,8 +118,6 @@
       public void testService () throws Exception {
           try {
               category.info("Testing transport sample.");
  -            category.info("Testing client deployment...");
  -            doTestClientDeploy();
               category.info("Testing deployment...");
               doTestDeploy();
               category.info("Testing service with symbol IBM...");
  
  
  

Mime
View raw message