vmassol     2003/12/06 09:30:58

  Modified:    framework/src/java/share/org/apache/cactus/client
                        ResponseObjectFactory.java
                        WebResponseObjectFactory.java
  Log:
  - Made call to endXXX methods generic. 
  - Moved them from WebClientTestCaseDelegate to AbstractClientTestCaseDelegate
  
  Revision  Changes    Path
  1.5       +3 -7      
jakarta-cactus/framework/src/java/share/org/apache/cactus/client/ResponseObjectFactory.java
  
  Index: ResponseObjectFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/ResponseObjectFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ResponseObjectFactory.java        26 May 2003 11:45:25 -0000      1.4
  +++ ResponseObjectFactory.java        6 Dec 2003 17:30:58 -0000       1.5
  @@ -56,8 +56,6 @@
    */
   package org.apache.cactus.client;
   
  -import java.net.HttpURLConnection;
  -
   import org.apache.cactus.Request;
   
   /**
  @@ -76,12 +74,10 @@
        *
        * @param theClassName the class name of the object to construct
        * @param theRequest the request that was sent by Cactus to the server side
  -     * @param theConnection the HTTP connection object that was used by Cactus
  -     *        to connect to the server side
        * @return the response object that will be passed to <code>endXXX()</code>
        *         methods and to the global end method
        * @throws ClientException if it fails to construct the response object
        */
  -    Object getResponseObject(String theClassName, Request theRequest, 
  -        HttpURLConnection theConnection) throws ClientException;
  +    Object getResponseObject(String theClassName, Request theRequest) 
  +        throws ClientException;
   }
  
  
  
  1.6       +21 -6     
jakarta-cactus/framework/src/java/share/org/apache/cactus/client/WebResponseObjectFactory.java
  
  Index: WebResponseObjectFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/WebResponseObjectFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WebResponseObjectFactory.java     26 May 2003 11:45:25 -0000      1.5
  +++ WebResponseObjectFactory.java     6 Dec 2003 17:30:58 -0000       1.6
  @@ -76,30 +76,45 @@
   public class WebResponseObjectFactory implements ResponseObjectFactory
   {
       /**
  +     * Connection object used to connect to the Cactus server side. Required
  +     * to create the response object.  
  +     */
  +    private HttpURLConnection connection;
  +    
  +    /**
  +     * @param theConnection the connection object used to connect to the 
  +     *        Cactus server side
  +     */
  +    public WebResponseObjectFactory(HttpURLConnection theConnection)
  +    {
  +        this.connection = theConnection;
  +    }
  +       
  +    /**
        * @see ResponseObjectFactory#getResponseObject
        */
  -    public Object getResponseObject(String theClassName, Request theRequest, 
  -        HttpURLConnection theConnection) throws ClientException
  +    public Object getResponseObject(String theClassName, Request theRequest) 
  +        throws ClientException
       {
           Object responseObject;
   
           // Is it a Http Unit WebResponse ?
           if (theClassName.equals("com.meterware.httpunit.WebResponse"))
           {
  -            responseObject = createHttpUnitWebResponse(theConnection);
  +            responseObject = createHttpUnitWebResponse(this.connection);
   
               // Is it a Cactus WebResponse ?
           }
           else if (theClassName.equals("org.apache.cactus.WebResponse"))
           {
               responseObject = new WebResponse((WebRequest) theRequest, 
  -                theConnection);
  +                this.connection);
   
               // Is it an old HttpURLConnection (deprecated) ?
           }
           else if (theClassName.equals("java.net.HttpURLConnection"))
           {
  -            responseObject = theConnection;
  +            responseObject = this.connection;
   
               // Else it is an error ...
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to