You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2002/07/21 13:36:55 UTC

cvs commit: jakarta-cactus/framework/src/java/share/org/apache/cactus/server AbstractWebTestCaller.java AbstractWebTestController.java

vmassol     2002/07/21 04:36:55

  Modified:    framework/src/java/share/org/apache/cactus
                        AbstractWebTestCase.java
               framework/src/java/share/org/apache/cactus/client
                        AbstractHttpClient.java
               framework/src/java/share/org/apache/cactus/server
                        AbstractWebTestCaller.java
                        AbstractWebTestController.java
  Added:       framework/src/java/share/org/apache/cactus
                        HttpServiceDefinition.java
  Removed:     framework/src/java/share/org/apache/cactus
                        ServiceDefinition.java
  Log:
  * moved ServiceDefinition class to interface as it is really an interface
  * renamed it to HttpServiceDefinition as it is only used when cactus client side uses the HTTP protocol (prepare for other protocols)
  
  Revision  Changes    Path
  1.5       +4 -4      jakarta-cactus/framework/src/java/share/org/apache/cactus/AbstractWebTestCase.java
  
  Index: AbstractWebTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/AbstractWebTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractWebTestCase.java	17 May 2002 12:55:35 -0000	1.4
  +++ AbstractWebTestCase.java	21 Jul 2002 11:36:54 -0000	1.5
  @@ -241,11 +241,11 @@
           // Note: All these pareameters are passed in the URL. This is to allow
           // the user to send whatever he wants in the request body. For example
           // a file, ...
  -        request.addParameter(ServiceDefinition.CLASS_NAME_PARAM,
  +        request.addParameter(HttpServiceDefinition.CLASS_NAME_PARAM,
               this.getClass().getName(), WebRequest.GET_METHOD);
  -        request.addParameter(ServiceDefinition.METHOD_NAME_PARAM,
  +        request.addParameter(HttpServiceDefinition.METHOD_NAME_PARAM,
               this.getCurrentTestMethod(), WebRequest.GET_METHOD);
  -        request.addParameter(ServiceDefinition.AUTOSESSION_NAME_PARAM,
  +        request.addParameter(HttpServiceDefinition.AUTOSESSION_NAME_PARAM,
               request.getAutomaticSession() ? "true" : "false",
               WebRequest.GET_METHOD);
   
  
  
  
  1.1                  jakarta-cactus/framework/src/java/share/org/apache/cactus/HttpServiceDefinition.java
  
  Index: HttpServiceDefinition.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Cactus" and "Apache Software
   *    Foundation" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.cactus;
  
  /**
   * Constants that define HTTP parameters required for defining a service that
   * is performed by the <code>ServletTestRedirector</code> servlet.
   *
   * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
   *
   * @version $Id: HttpServiceDefinition.java,v 1.1 2002/07/21 11:36:54 vmassol Exp $
   */
  public interface HttpServiceDefinition
  {
      /**
       * Name of the parameter in the HTTP request that represents the name of the
       * Test class to call. The name is voluntarily long so that it will not
       * clash with a user-defined parameter.
       */
      public static final String CLASS_NAME_PARAM =
          "Cactus_TestClass";
  
      /**
       * Name of the parameter in the HTTP request that represents the name of the
       * Test method to call. The name is voluntarily long so that it will not
       * clash with a user-defined parameter.
       */
      public static final String METHOD_NAME_PARAM =
          "Cactus_TestMethod";
  
      /**
       * Name of the parameter in the HTTP request that specify if a session
       * should be automatically created for the user or not.
       */
      public static final String AUTOSESSION_NAME_PARAM =
          "Cactus_AutomaticSession";
  
      /**
       * Name of the parameter in the HTTP request that specify the service asked
       * to the Redirector Servlet. It can be either to ask the Redirector Servlet
       * to call the test method or to ask the Redirector Servlet to return the
       * result of the last test.
       *
       * @see ServiceEnumeration
       */
      public static final String SERVICE_NAME_PARAM =
          "Cactus_Service";
  }
  
  
  
  1.7       +4 -4      jakarta-cactus/framework/src/java/share/org/apache/cactus/client/AbstractHttpClient.java
  
  Index: AbstractHttpClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/AbstractHttpClient.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractHttpClient.java	18 Jul 2002 19:45:07 -0000	1.6
  +++ AbstractHttpClient.java	21 Jul 2002 11:36:54 -0000	1.7
  @@ -58,7 +58,7 @@
   
   import java.net.HttpURLConnection;
   
  -import org.apache.cactus.ServiceDefinition;
  +import org.apache.cactus.HttpServiceDefinition;
   import org.apache.cactus.ServiceEnumeration;
   import org.apache.cactus.WebRequest;
   import org.apache.cactus.WebTestResult;
  @@ -174,7 +174,7 @@
           throws Throwable
       {
           // Specify the service to call on the redirector side
  -        theRequest.addParameter(ServiceDefinition.SERVICE_NAME_PARAM,
  +        theRequest.addParameter(HttpServiceDefinition.SERVICE_NAME_PARAM,
               ServiceEnumeration.CALL_TEST_SERVICE.toString(),
               WebRequest.GET_METHOD);
   
  @@ -213,7 +213,7 @@
           WebRequest resultsRequest = new WebRequest();
   
           // Add authentication details
  -        resultsRequest.addParameter(ServiceDefinition.SERVICE_NAME_PARAM,
  +        resultsRequest.addParameter(HttpServiceDefinition.SERVICE_NAME_PARAM,
               ServiceEnumeration.GET_RESULTS_SERVICE.toString(),
               WebRequest.GET_METHOD);
           resultsRequest.setAuthentication(theAuthentication);
  
  
  
  1.5       +7 -7      jakarta-cactus/framework/src/java/share/org/apache/cactus/server/AbstractWebTestCaller.java
  
  Index: AbstractWebTestCaller.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/server/AbstractWebTestCaller.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractWebTestCaller.java	18 May 2002 13:26:05 -0000	1.4
  +++ AbstractWebTestCaller.java	21 Jul 2002 11:36:55 -0000	1.5
  @@ -62,7 +62,7 @@
   import javax.servlet.ServletException;
   
   import org.apache.cactus.AbstractTestCase;
  -import org.apache.cactus.ServiceDefinition;
  +import org.apache.cactus.HttpServiceDefinition;
   import org.apache.cactus.WebTestResult;
   import org.apache.cactus.util.log.Log;
   import org.apache.cactus.util.log.LogService;
  @@ -227,11 +227,11 @@
           String queryString =
               this.webImplicitObjects.getHttpServletRequest().getQueryString();
           String className = ServletUtil.getQueryStringParameter(queryString,
  -            ServiceDefinition.CLASS_NAME_PARAM);
  +            HttpServiceDefinition.CLASS_NAME_PARAM);
   
           if (className == null) {
               String message = "Missing class name parameter [" +
  -                ServiceDefinition.CLASS_NAME_PARAM + "] in HTTP request.";
  +                HttpServiceDefinition.CLASS_NAME_PARAM + "] in HTTP request.";
               LOGGER.error(message);
               throw new ServletException(message);
           }
  @@ -252,11 +252,11 @@
           String queryString =
               this.webImplicitObjects.getHttpServletRequest().getQueryString();
           String methodName = ServletUtil.getQueryStringParameter(queryString,
  -            ServiceDefinition.METHOD_NAME_PARAM);
  +            HttpServiceDefinition.METHOD_NAME_PARAM);
   
           if (methodName == null) {
               String message = "Missing method name parameter [" +
  -                ServiceDefinition.METHOD_NAME_PARAM + "] in HTTP request.";
  +                HttpServiceDefinition.METHOD_NAME_PARAM + "] in HTTP request.";
               LOGGER.error(message);
               throw new ServletException(message);
           }
  @@ -275,7 +275,7 @@
           String queryString =
               this.webImplicitObjects.getHttpServletRequest().getQueryString();
           String autoSession = ServletUtil.getQueryStringParameter(queryString,
  -            ServiceDefinition.AUTOSESSION_NAME_PARAM);
  +            HttpServiceDefinition.AUTOSESSION_NAME_PARAM);
   
           boolean isAutomaticSession = Boolean.valueOf(
               autoSession).booleanValue();
  
  
  
  1.2       +4 -4      jakarta-cactus/framework/src/java/share/org/apache/cactus/server/AbstractWebTestController.java
  
  Index: AbstractWebTestController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/server/AbstractWebTestController.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractWebTestController.java	6 May 2002 17:38:23 -0000	1.1
  +++ AbstractWebTestController.java	21 Jul 2002 11:36:55 -0000	1.2
  @@ -59,7 +59,7 @@
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   
  -import org.apache.cactus.ServiceDefinition;
  +import org.apache.cactus.HttpServiceDefinition;
   import org.apache.cactus.ServiceEnumeration;
   import org.apache.cactus.util.log.Log;
   import org.apache.cactus.util.log.LogService;
  @@ -178,11 +178,11 @@
           // Call the correct Service method
           String queryString = theRequest.getQueryString();
           String serviceName = ServletUtil.getQueryStringParameter(queryString,
  -            ServiceDefinition.SERVICE_NAME_PARAM);
  +            HttpServiceDefinition.SERVICE_NAME_PARAM);
   
           if (serviceName == null) {
               String message = "Missing service name parameter [" +
  -                ServiceDefinition.SERVICE_NAME_PARAM + "] in HTTP request. " +
  +                HttpServiceDefinition.SERVICE_NAME_PARAM + "] in HTTP request. " +
                   "Received query string is [" + queryString + "].";
               LOGGER.debug(message);
               throw new ServletException(message);
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>