vmassol     02/04/14 08:56:28

  Modified:    anttasks/src/java/org/apache/cactus/ant ChangeLogTask.java
               documentation/docs/xdocs changes.xml
               framework/src/java/j2ee13/org/apache/cactus/client
                        FilterHttpClient.java
               framework/src/java/share/org/apache/cactus/client
                        JspHttpClient.java ServletHttpClient.java
               framework/src/java/share/org/apache/cactus/util/log
                        LogService.java
               sample-servlet/conf/sample/build/j2ee12
                        build-tests-enhydra-31.xml build-tests-resin-12.xml
                        build-tests-tomcat-32.xml build-tests-tomcat-33.xml
                        build-tests-weblogic-51.xml
               sample-servlet/conf/sample/build/j2ee13
                        build-tests-resin-13.xml build-tests-tomcat-40.xml
                        build-tests-weblogic-61.xml
               sample-servlet/conf/sample/build/share build-share.xml
                        build-tests-orion-14.xml build-tests-orion-15.xml
                        build-tests-resin-20.xml
               sample-servlet/conf/sample/conf/test/j2ee12
                        cactus.properties
               sample-servlet/conf/sample/conf/test/j2ee13
                        cactus.properties
  Added:       framework/src/java/share/org/apache/cactus/util
                        Configuration.java
  Removed:     framework/src/java/share/org/apache/cactus/client
                        ClientConfiguration.java
  Log:
  Improved Cactus logging. Cactus logging is now enabled by a 
<code>cactus.enableLogging=true</code> property that needs to be either defined in 
<code>cactus.properties</code> (which also needs to be part of the server WAR if you 
wish to turn on logging on the server side) or by using a java parameter 
(<code>-Dcactus.enableLogging=true</code>). If Log4J is not in the classpath, then 
logging is disabled.
  
  Revision  Changes    Path
  1.3       +67 -9     
jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/ChangeLogTask.java
  
  Index: ChangeLogTask.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/ChangeLogTask.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ChangeLogTask.java        19 Mar 2002 10:40:18 -0000      1.2
  +++ ChangeLogTask.java        14 Apr 2002 15:56:27 -0000      1.3
  @@ -68,6 +68,7 @@
   import java.io.OutputStreamWriter;
   import java.io.PrintWriter;
   import java.io.UnsupportedEncodingException;
  +import java.io.BufferedInputStream;
   import java.net.HttpURLConnection;
   import java.net.MalformedURLException;
   import java.net.URL;
  @@ -97,7 +98,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jeff Martin</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: ChangeLogTask.java,v 1.2 2002/03/19 10:40:18 vmassol Exp $
  + * @version $Id: ChangeLogTask.java,v 1.3 2002/04/14 15:56:27 vmassol Exp $
    */
   public class ChangeLogTask extends Task implements ExecuteStreamHandler
   {
  @@ -134,7 +135,8 @@
       /**
        * Input stream read in from CVS log command
        */
  -    private BufferedReader input;
  +    private BufferedInputStream input;
  +//    private InputStream input;
   
       /**
        * Error Input stream read in from CVS log command
  @@ -416,8 +418,9 @@
   
           // Check if a threshold date has been specified
           if (this.thresholdDate != null) {
  -            toExecute.createArgument().setValue("-d\">=" +
  -                OUTPUT_DATE.format(this.thresholdDate) + "\"");
  +
  +            toExecute.createArgument().setValue("-d >=" +
  +                OUTPUT_DATE.format(this.thresholdDate));
           }
   
           // Check if list of files to check has been specified
  @@ -476,16 +479,63 @@
        */
       public void setProcessOutputStream(InputStream theIs) throws IOException
       {
  -        this.input = new BufferedReader(new InputStreamReader(theIs));
  +        this.input = new BufferedInputStream(theIs);
  +//        this.input = theIs;
       }
   
       /**
  -     * Stop handling of the streams (i.e. the cvs process).
  +     * Stop handling of the streams (ie the cvs process).
        */
       public void stop()
       {
       }
   
  +    private String readLine(InputStream stream) throws IOException
  +    {
  +        debug("ReadLine: begin");
  +
  +        String returnValue = null;
  +        int c;
  +        StringBuffer line = new StringBuffer();
  +
  +        while ((c = stream.read()) != -1) {
  +            debug("ReadLine: available = " + stream.available());
  +            debug("ReadLine: char: [" + c + "]");
  +            if (c == 13) {
  +                c = stream.read();
  +                debug("ReadLine: available = " + stream.available());
  +                debug("ReadLine: char special: [" + c + "]");
  +                if (c == 10) {
  +                    debug("ReadLine: eol");
  +                    break;
  +                } else {
  +                    line.append((char)c);
  +//                    if (stream.available() == 0) {
  +//                        debug("ReadLine: no more chars");
  +//                        break;
  +//                    }
  +                    continue;
  +                }
  +            }
  +            line.append((char)c);
  +//            if (stream.available() == 0) {
  +//                debug("ReadLine: no more chars");
  +//                break;
  +//            }
  +        }
  +
  +        if (c != -1) {
  +//        if (stream.available() != 0) {
  +            returnValue = line.toString();
  +        } else {
  +            debug("ReadLine: assuming end of file");
  +            returnValue = null;
  +        }
  +
  +        debug("ReadLine: end");
  +        return returnValue;
  +    }
  +
       /**
        * Start reading from the cvs log stream.
        */
  @@ -508,10 +558,10 @@
           // RCS entries
           Hashtable entries = new Hashtable();
   
  -        while ((line = this.input.readLine()) != null) {
  +        while ((line = readLine(this.input)) != null) {
   
               // Log to debug file if debug mode is on
  -            debug("Text: [" + line);
  +            debug("Text: [" + line + "]");
   
               switch (status) {
   
  @@ -562,7 +612,7 @@
                           !line.startsWith("------")) {
   
                           comment += line + "\n";
  -                        line = this.input.readLine();
  +                        line = readLine(this.input);
   
                           debug("Text: [" + line);
                       }
  @@ -595,9 +645,15 @@
               // We cannot use a BufferedReader as the ready() method is bugged!
               // (see Bug 4329985, which is supposed to be fixed in JDK 1.4 :
               // http://developer.java.sun.com/developer/bugParade/bugs/4329985.html)
  +
  +            debug("begin reading bytes");
  +
               while (this.errorInput.ready()) {
  +                debug("reading bytes");
                   this.errorInput.read();
               }
  +
  +            debug("end of loop");
           }
   
           debug("Preparing to write changelog file");
  @@ -610,6 +666,8 @@
           this.output.println("</changelog>");
           this.output.flush();
           this.output.close();
  +
  +        debug("End of preparing to write changelog file");
       }
   
       /**
  
  
  
  1.5       +8 -0      jakarta-cactus/documentation/docs/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/changes.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- changes.xml       14 Apr 2002 07:36:12 -0000      1.4
  +++ changes.xml       14 Apr 2002 15:56:27 -0000      1.5
  @@ -48,6 +48,14 @@
       </devs>
   
       <release version="1.3 in CVS">
  +      <action dev="VMA" type="update">
  +        Improved Cactus logging. Cactus logging is now enabled by a
  +        <code>cactus.enableLogging=true</code> property that needs to be either
  +        defined in <code>cactus.properties</code> (which also needs to be part
  +        of the server WAR if you wish to turn on logging on the server side) or
  +        by using a java parameter (<code>-Dcactus.enableLogging=true</code>).
  +        If Log4J is not in the classpath, then logging is disabled.
  +      </action>
         <action dev="VMA" type="add">
           Added a <link href="news.html">"News"</link> page with all news and
           events regarding Cactus. It is also supposed to act as a history page.
  
  
  
  1.3       +4 -3      
jakarta-cactus/framework/src/java/j2ee13/org/apache/cactus/client/FilterHttpClient.java
  
  Index: FilterHttpClient.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/framework/src/java/j2ee13/org/apache/cactus/client/FilterHttpClient.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FilterHttpClient.java     14 Apr 2002 10:17:16 -0000      1.2
  +++ FilterHttpClient.java     14 Apr 2002 15:56:27 -0000      1.3
  @@ -57,6 +57,7 @@
   package org.apache.cactus.client;
   
   import org.apache.cactus.WebRequest;
  +import org.apache.cactus.util.Configuration;
   
   /**
    * Manage the logic for calling the Servlet redirector for executing a test on
  @@ -64,7 +65,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: FilterHttpClient.java,v 1.2 2002/04/14 10:17:16 vmassol Exp $
  + * @version $Id: FilterHttpClient.java,v 1.3 2002/04/14 15:56:27 vmassol Exp $
    */
   public class FilterHttpClient extends AbstractHttpClient
   {
  @@ -81,10 +82,10 @@
   
           // Check if user has overriden the servlet redirector
           if (theRequest.getRedirectorName() != null) {
  -            url = ClientConfiguration.getContextURL() + "/" +
  +            url = Configuration.getContextURL() + "/" +
                   theRequest.getRedirectorName();
           } else {
  -            url = ClientConfiguration.getFilterRedirectorURL();
  +            url = Configuration.getFilterRedirectorURL();
           }
   
           return url;
  
  
  
  1.2       +4 -3      
jakarta-cactus/framework/src/java/share/org/apache/cactus/client/JspHttpClient.java
  
  Index: JspHttpClient.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/JspHttpClient.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JspHttpClient.java        1 Mar 2002 00:43:46 -0000       1.1
  +++ JspHttpClient.java        14 Apr 2002 15:56:27 -0000      1.2
  @@ -57,6 +57,7 @@
   package org.apache.cactus.client;
   
   import org.apache.cactus.WebRequest;
  +import org.apache.cactus.util.Configuration;
   
   /**
    * Manage the logic for calling the JSP redirector for executing a test on
  @@ -64,7 +65,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: JspHttpClient.java,v 1.1 2002/03/01 00:43:46 vmassol Exp $
  + * @version $Id: JspHttpClient.java,v 1.2 2002/04/14 15:56:27 vmassol Exp $
    */
   public class JspHttpClient extends AbstractHttpClient
   {
  @@ -81,10 +82,10 @@
   
           // Check if user has overriden the servlet redirector
           if (theRequest.getRedirectorName() != null) {
  -            url = ClientConfiguration.getContextURL() + "/" +
  +            url = Configuration.getContextURL() + "/" +
                   theRequest.getRedirectorName();
           } else {
  -            url = ClientConfiguration.getJspRedirectorURL();
  +            url = Configuration.getJspRedirectorURL();
           }
   
           return url;
  
  
  
  1.2       +4 -3      
jakarta-cactus/framework/src/java/share/org/apache/cactus/client/ServletHttpClient.java
  
  Index: ServletHttpClient.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/ServletHttpClient.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServletHttpClient.java    1 Mar 2002 00:43:46 -0000       1.1
  +++ ServletHttpClient.java    14 Apr 2002 15:56:27 -0000      1.2
  @@ -57,6 +57,7 @@
   package org.apache.cactus.client;
   
   import org.apache.cactus.WebRequest;
  +import org.apache.cactus.util.Configuration;
   
   /**
    * Manage the logic for calling the Servlet redirector for executing a test on
  @@ -64,7 +65,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: ServletHttpClient.java,v 1.1 2002/03/01 00:43:46 vmassol Exp $
  + * @version $Id: ServletHttpClient.java,v 1.2 2002/04/14 15:56:27 vmassol Exp $
    */
   public class ServletHttpClient extends AbstractHttpClient
   {
  @@ -81,10 +82,10 @@
   
           // Check if user has overriden the servlet redirector
           if (theRequest.getRedirectorName() != null) {
  -            url = ClientConfiguration.getContextURL() + "/" +
  +            url = Configuration.getContextURL() + "/" +
                   theRequest.getRedirectorName();
           } else {
  -            url = ClientConfiguration.getServletRedirectorURL();
  +            url = Configuration.getServletRedirectorURL();
           }
   
           return url;
  
  
  
  1.4       +55 -26    
jakarta-cactus/framework/src/java/share/org/apache/cactus/util/log/LogService.java
  
  Index: LogService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/log/LogService.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LogService.java   10 Apr 2002 00:31:21 -0000      1.3
  +++ LogService.java   14 Apr 2002 15:56:27 -0000      1.4
  @@ -58,8 +58,10 @@
   
   import java.net.URL;
   import java.util.Hashtable;
  +import java.util.MissingResourceException;
   
   import org.apache.log4j.PropertyConfigurator;
  +import org.apache.cactus.util.Configuration;
   
   /**
    * Logging service acting as a wrapper around the Jakarta Log4j logging
  @@ -67,11 +69,18 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: LogService.java,v 1.3 2002/04/10 00:31:21 vmassol Exp $
  + * @version $Id: LogService.java,v 1.4 2002/04/14 15:56:27 vmassol Exp $
    */
   public class LogService
   {
       /**
  +     * Name of property that enables Cactus logging if passed as a System
  +     * property.
  +     */
  +    private static final String ENABLE_LOGGING_PROPERTY =
  +        "cactus.enableLogging";
  +
  +    /**
        * List of <code>Log</code> instances (i.e. <code>Category</code>
        * objects for Log4j) indexed on the category's name.
        */
  @@ -83,33 +92,11 @@
       private boolean isInitialized = false;
   
       /**
  -     * Is Log4j in the classpath ?
  -     */
  -    private boolean isLog4jInClasspath = false;
  -
  -    /**
        * The singleton's unique instance
        */
       private static LogService instance;
   
       /**
  -     * Initialization
  -     */
  -    private LogService()
  -    {
  -        // Check if Log4j is in the classpath. If not, use a dummy
  -        // implementation that does nothing. This is to make it easy on user
  -        // who do not want to have to download log4j and put it in their
  -        // classpath !
  -        this.isLog4jInClasspath = true;
  -        try {
  -            Class.forName("org.apache.log4j.PropertyConfigurator");
  -        } catch (ClassNotFoundException e) {
  -            this.isLog4jInClasspath = false;
  -        }
  -    }
  -
  -    /**
        * @return the unique singleton instance
        */
       public static synchronized LogService getInstance()
  @@ -138,7 +125,7 @@
   
           if (theFileName != null) {
   
  -            if (this.isLog4jInClasspath) {
  +            if (isLoggingEnabled()) {
   
                   URL url = this.getClass().getResource(theFileName);
                   if (url != null) {
  @@ -160,6 +147,49 @@
       }
   
       /**
  +     * @return true if logging is enabled or false otherwise.
  +     */
  +    private boolean isLoggingEnabled()
  +    {
  +        boolean isLoggingEnabled = false;
  +
  +        // 1 - Checks if a ENABLE_LOGGING_PROPERTY System property exist and
  +        //     if it is set to "true"
  +        // 2 - Checks if logging has been enabled in Cactus configuration
  +        //     file
  +
  +        String value = System.getProperty(ENABLE_LOGGING_PROPERTY);
  +        if ((value != null) && (value.equalsIgnoreCase("true"))) {
  +            isLoggingEnabled = true;
  +        } else {
  +            try {
  +                isLoggingEnabled = Configuration.isLoggingEnabled();
  +            } catch (MissingResourceException e) {
  +                // ignored. It simply means that the cactus configuration file
  +                // has not been defined or is not in the classpath.
  +            }
  +        }
  +
  +        // 3 - If logging is turned on but log4j is not on the classpath, do
  +        //     not do anything.
  +        return isLoggingEnabled && isLog4jInClasspath();
  +    }
  +
  +    /**
  +     * @return true if Log4J is in the classpath, false otherwise.
  +     */
  +    private boolean isLog4jInClasspath()
  +    {
  +        boolean isLog4jInClasspath = false;
  +        try {
  +            Class.forName("org.apache.log4j.PropertyConfigurator");
  +            isLog4jInClasspath = true;
  +        } catch (ClassNotFoundException e) {
  +        }
  +        return isLog4jInClasspath;
  +    }
  +
  +    /**
        * @param theCategoryName the category's name. Usually, it is the full
        *        name of the class being logged, including the package name
        * @return the <code>Log</code> instance associated with the specified
  @@ -176,14 +206,13 @@
   
           if (log == null) {
   
  -            if (this.isLog4jInClasspath) {
  +            if (isLoggingEnabled()) {
                   log = new BaseLog(theCategoryName);
               } else {
                   log = new BaseLogDummy();
               }
   
               this.logCategories.put(theCategoryName, log);
  -
           }
   
           return log;
  
  
  
  1.3       +2 -3      
jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-enhydra-31.xml
  
  Index: build-tests-enhydra-31.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-enhydra-31.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build-tests-enhydra-31.xml        29 Mar 2002 21:23:19 -0000      1.2
  +++ build-tests-enhydra-31.xml        14 Apr 2002 15:56:27 -0000      1.3
  @@ -66,8 +66,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.enhydra.31" depends="testwar"
  -        unless="enhydra.home.31">
  +    <target name="check.test.enhydra.31" unless="enhydra.home.31">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -84,7 +83,7 @@
          ========================================================================
       -->
       <target name="prepare.test.enhydra.31"
  -        depends="check.test.enhydra.31,prepare.test" if="enhydra.home.31">
  +        depends="check.test.enhydra.31,testwar" if="enhydra.home.31">
   
           <echo message="enhydra.home.31 = ${enhydra.home.31}"/>
   
  
  
  
  1.2       +2 -2      
jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-resin-12.xml
  
  Index: build-tests-resin-12.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-resin-12.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-tests-resin-12.xml  10 Mar 2002 14:26:01 -0000      1.1
  +++ build-tests-resin-12.xml  14 Apr 2002 15:56:27 -0000      1.2
  @@ -74,7 +74,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.resin.12" depends="testwar" unless="resin.home.12">
  +    <target name="check.test.resin.12" unless="resin.home.12">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -91,7 +91,7 @@
          ========================================================================
       -->
       <target name="prepare.test.resin.12"
  -        depends="check.test.resin.12,prepare.test" if="resin.home.12">
  +        depends="check.test.resin.12,testwar" if="resin.home.12">
   
           <echo message="resin.home.12 = ${resin.home.12}"/>
   
  
  
  
  1.2       +2 -3      
jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-tomcat-32.xml
  
  Index: build-tests-tomcat-32.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-tomcat-32.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-tests-tomcat-32.xml 10 Mar 2002 14:26:01 -0000      1.1
  +++ build-tests-tomcat-32.xml 14 Apr 2002 15:56:27 -0000      1.2
  @@ -65,8 +65,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.tomcat.32" depends="testwar"
  -        unless="tomcat.home.32">
  +    <target name="check.test.tomcat.32" unless="tomcat.home.32">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -83,7 +82,7 @@
          ========================================================================
       -->
       <target name="prepare.test.tomcat.32"
  -        depends="check.test.tomcat.32,prepare.test" if="tomcat.home.32">
  +        depends="check.test.tomcat.32,testwar" if="tomcat.home.32">
   
           <echo message="tomcat.home.32 = ${tomcat.home.32}"/>
   
  
  
  
  1.2       +2 -3      
jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-tomcat-33.xml
  
  Index: build-tests-tomcat-33.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-tomcat-33.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-tests-tomcat-33.xml 10 Mar 2002 14:26:01 -0000      1.1
  +++ build-tests-tomcat-33.xml 14 Apr 2002 15:56:27 -0000      1.2
  @@ -63,8 +63,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.tomcat.33" depends="testwar"
  -        unless="tomcat.home.33">
  +    <target name="check.test.tomcat.33" unless="tomcat.home.33">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -81,7 +80,7 @@
          ========================================================================
       -->
       <target name="prepare.test.tomcat.33"
  -        depends="check.test.tomcat.33,prepare.test" if="tomcat.home.33">
  +        depends="check.test.tomcat.33,testwar" if="tomcat.home.33">
   
           <echo message="tomcat.home.33 = ${tomcat.home.33}"/>
   
  
  
  
  1.2       +2 -3      
jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-weblogic-51.xml
  
  Index: build-tests-weblogic-51.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/j2ee12/build-tests-weblogic-51.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-tests-weblogic-51.xml       10 Mar 2002 14:26:01 -0000      1.1
  +++ build-tests-weblogic-51.xml       14 Apr 2002 15:56:27 -0000      1.2
  @@ -75,8 +75,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.weblogic.51" depends="testwar"
  -        unless="weblogic.home.51">
  +    <target name="check.test.weblogic.51" unless="weblogic.home.51">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -93,7 +92,7 @@
          ========================================================================
       -->
       <target name="prepare.test.weblogic.51"
  -        depends="check.test.weblogic.51,prepare.test" if="weblogic.home.51">
  +        depends="check.test.weblogic.51,testwar" if="weblogic.home.51">
   
           <echo message="weblogic.home.51 = ${weblogic.home.51}"/>
   
  
  
  
  1.2       +2 -2      
jakarta-cactus/sample-servlet/conf/sample/build/j2ee13/build-tests-resin-13.xml
  
  Index: build-tests-resin-13.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/j2ee13/build-tests-resin-13.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-tests-resin-13.xml  10 Mar 2002 14:26:01 -0000      1.1
  +++ build-tests-resin-13.xml  14 Apr 2002 15:56:28 -0000      1.2
  @@ -74,7 +74,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.resin.13" depends="testwar" unless="resin.home.13">
  +    <target name="check.test.resin.13" unless="resin.home.13">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -91,7 +91,7 @@
          ========================================================================
       -->
       <target name="prepare.test.resin.13"
  -        depends="check.test.resin.13,prepare.test" if="resin.home.13">
  +        depends="check.test.resin.13,testwar" if="resin.home.13">
   
           <echo message="resin.home.13 = ${resin.home.13}"/>
   
  
  
  
  1.3       +2 -3      
jakarta-cactus/sample-servlet/conf/sample/build/j2ee13/build-tests-tomcat-40.xml
  
  Index: build-tests-tomcat-40.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/j2ee13/build-tests-tomcat-40.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build-tests-tomcat-40.xml 10 Mar 2002 19:00:39 -0000      1.2
  +++ build-tests-tomcat-40.xml 14 Apr 2002 15:56:28 -0000      1.3
  @@ -79,8 +79,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.tomcat.40" depends="testwar"
  -        unless="tomcat.home.40">
  +    <target name="check.test.tomcat.40" unless="tomcat.home.40">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -97,7 +96,7 @@
          ========================================================================
       -->
       <target name="prepare.test.tomcat.40"
  -        depends="check.test.tomcat.40,prepare.test" if="tomcat.home.40">
  +        depends="check.test.tomcat.40,testwar" if="tomcat.home.40">
   
           <echo message="tomcat.home.40 = ${tomcat.home.40}"/>
   
  
  
  
  1.3       +2 -3      
jakarta-cactus/sample-servlet/conf/sample/build/j2ee13/build-tests-weblogic-61.xml
  
  Index: build-tests-weblogic-61.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/j2ee13/build-tests-weblogic-61.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build-tests-weblogic-61.xml       10 Mar 2002 19:00:39 -0000      1.2
  +++ build-tests-weblogic-61.xml       14 Apr 2002 15:56:28 -0000      1.3
  @@ -77,8 +77,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.weblogic.61" depends="testwar"
  -        unless="weblogic.home.61">
  +    <target name="check.test.weblogic.61" unless="weblogic.home.61">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -95,7 +94,7 @@
          ========================================================================
       -->
       <target name="prepare.test.weblogic.61"
  -        depends="check.test.weblogic.61,prepare.test" if="weblogic.home.61">
  +        depends="check.test.weblogic.61,testwar" if="weblogic.home.61">
   
           <echo message="weblogic.home.61 = ${weblogic.home.61}"/>
   
  
  
  
  1.2       +2 -1      
jakarta-cactus/sample-servlet/conf/sample/build/share/build-share.xml
  
  Index: build-share.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/share/build-share.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-share.xml   10 Mar 2002 14:26:02 -0000      1.1
  +++ build-share.xml   14 Apr 2002 15:56:28 -0000      1.2
  @@ -378,7 +378,7 @@
   
       </target>
   
  -    <target name="testwar" depends="compile,prepare.testwar.log4j">
  +    <target name="testwar" depends="compile,prepare.testwar.log4j,prepare.test">
   
           <!-- Gather libraries in a place where they can be copied in the
                war -->
  @@ -399,6 +399,7 @@
               <!-- log_server.properties need to be in the server classpath -->
               <classes dir="${conf.test.dir}">
                   <include name="log_server.properties"/>
  +                <include name="cactus.properties"/>
               </classes>
   
               <!-- We need to copy all dependent jar in the war. This is
  
  
  
  1.2       +2 -2      
jakarta-cactus/sample-servlet/conf/sample/build/share/build-tests-orion-14.xml
  
  Index: build-tests-orion-14.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/share/build-tests-orion-14.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-tests-orion-14.xml  10 Mar 2002 14:26:02 -0000      1.1
  +++ build-tests-orion-14.xml  14 Apr 2002 15:56:28 -0000      1.2
  @@ -63,7 +63,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.orion.14" depends="testwar" unless="orion.home.14">
  +    <target name="check.test.orion.14" unless="orion.home.14">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -80,7 +80,7 @@
          ========================================================================
       -->
       <target name="prepare.test.orion.14"
  -        depends="check.test.orion.14,prepare.test" if="orion.home.14">
  +        depends="check.test.orion.14,testwar" if="orion.home.14">
   
           <echo message="orion.home.14 = ${orion.home.14}"/>
   
  
  
  
  1.2       +2 -2      
jakarta-cactus/sample-servlet/conf/sample/build/share/build-tests-orion-15.xml
  
  Index: build-tests-orion-15.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/share/build-tests-orion-15.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-tests-orion-15.xml  10 Mar 2002 14:26:02 -0000      1.1
  +++ build-tests-orion-15.xml  14 Apr 2002 15:56:28 -0000      1.2
  @@ -64,7 +64,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.orion.15" depends="testwar" unless="orion.home.15">
  +    <target name="check.test.orion.15" unless="orion.home.15">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -81,7 +81,7 @@
          ========================================================================
       -->
       <target name="prepare.test.orion.15"
  -        depends="check.test.orion.15,prepare.test" if="orion.home.15">
  +        depends="check.test.orion.15,testwar" if="orion.home.15">
   
           <echo message="orion.home.15 = ${orion.home.15}"/>
   
  
  
  
  1.2       +2 -2      
jakarta-cactus/sample-servlet/conf/sample/build/share/build-tests-resin-20.xml
  
  Index: build-tests-resin-20.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/build/share/build-tests-resin-20.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build-tests-resin-20.xml  10 Mar 2002 14:26:02 -0000      1.1
  +++ build-tests-resin-20.xml  14 Apr 2002 15:56:28 -0000      1.2
  @@ -74,7 +74,7 @@
            is not set
          ========================================================================
       -->
  -    <target name="check.test.resin.20" depends="testwar" unless="resin.home.20">
  +    <target name="check.test.resin.20" unless="resin.home.20">
   
           <echo message=""/>
           <echo message="******************************************************"/>
  @@ -91,7 +91,7 @@
          ========================================================================
       -->
       <target name="prepare.test.resin.20"
  -        depends="check.test.resin.20,prepare.test" if="resin.home.20">
  +        depends="check.test.resin.20,testwar" if="resin.home.20">
   
           <echo message="resin.home.20 = ${resin.home.20}"/>
   
  
  
  
  1.2       +3 -0      
jakarta-cactus/sample-servlet/conf/sample/conf/test/j2ee12/cactus.properties
  
  Index: cactus.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/conf/test/j2ee12/cactus.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cactus.properties 10 Mar 2002 14:26:02 -0000      1.1
  +++ cactus.properties 14 Apr 2002 15:56:28 -0000      1.2
  @@ -16,3 +16,6 @@
   
   # Default JSP Redirector Name. Used by JspTestCase test cases.
   cactus.jspRedirectorName = JspRedirector
  +
  +# Enable Cactus internal logging
  +cactus.enableLogging = true
  \ No newline at end of file
  
  
  
  1.2       +3 -0      
jakarta-cactus/sample-servlet/conf/sample/conf/test/j2ee13/cactus.properties
  
  Index: cactus.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/sample-servlet/conf/sample/conf/test/j2ee13/cactus.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cactus.properties 10 Mar 2002 14:26:02 -0000      1.1
  +++ cactus.properties 14 Apr 2002 15:56:28 -0000      1.2
  @@ -25,3 +25,6 @@
   # cactus.filterRedirectorURL = http://localhost:@test.port@/test/FilterRedirector
   
   cactus.filterRedirectorName = test/filterRedirector.jsp
  +
  +# Enable Cactus internal logging
  +cactus.enableLogging = true
  \ No newline at end of file
  
  
  
  1.1                  
jakarta-cactus/framework/src/java/share/org/apache/cactus/util/Configuration.java
  
  Index: Configuration.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 [EMAIL PROTECTED]
   *
   * 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.util;
  
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.util.PropertyResourceBundle;
  import java.util.ResourceBundle;
  
  /**
   * Provides acces to the Cactus configuration.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
   *
   * @version $Id: Configuration.java,v 1.1 2002/04/14 15:56:28 vmassol Exp $
   */
  public class Configuration
  {
      /**
       * Name of the Cactus configuration file if cactus is to look for it in
       * the classpath.
       */
      private static final String CONFIG_DEFAULT_NAME = "cactus";
  
      /**
       * Name of the java property for specifying the location of the cactus
       * configuration file. This overrides any cactus configuration that is
       * put in the classpath.
       */
      private static final String CONFIG_PROPERTY = "cactus.config";
  
      /**
       * Name of property in Cactus configuration file that enables Cactus
       * logging.
       */
      private static final String ENABLE_LOGGING_PROPERTY =
          "cactus.enableLogging";
  
      /**
       * Properties file holding configuration data for Cactus.
       */
      private static ResourceBundle config = null;
  
      /**
       * Tries to read the cactus configuration from the java property defined
       * on the command line (named CONFIG_PROPERTY) and if none has been defined
       * tries to read the CONFIG_DEFAULT_NAME file from the classpath.
       *
       * @return the cactus configuration as a <code>ResourceBundle</code>.
       */
      private static final ResourceBundle getConfiguration()
      {
          if (config == null) {
              // Has the user passed the location of the cactus configuration file
              // as a java property
              String configOverride = System.getProperty(CONFIG_PROPERTY);
              if (configOverride == null) {
                  // Try to read the default cactus configuration file from the
                  // classpath
                  config = PropertyResourceBundle.getBundle(CONFIG_DEFAULT_NAME);
              } else {
                  try {
                      config = new PropertyResourceBundle(
                              new FileInputStream(configOverride));
                  } catch (IOException e) {
                      throw new ChainedRuntimeException(
                              "Cannot read cactus configuration file [" +
                              configOverride + "]", e);
                  }
              }
          }
          return config;
      }
  
      /**
       * @return the context URL under which our application to test runs.
       * @throw MissingResourceException if the property defining the context
       *        is missing.
       */
      public static String getContextURL()
      {
          return getConfiguration().getString("cactus.contextURL");
      }
  
      /**
       * @return the Servlet redirector
       * @throw MissingResourceException if the property defining the servlet
       *        redirector is missing.
       */
      public static String getServletRedirectorURL()
      {
          return getContextURL() + "/" +
              getConfiguration().getString("cactus.servletRedirectorName");
      }
  
      /**
       * @return the JSP redirector
       * @throw MissingResourceException if the property defining the JSP
       *        redirector is missing.
       */
      public static String getJspRedirectorURL()
      {
          return getContextURL() + "/" +
              getConfiguration().getString("cactus.jspRedirectorName");
      }
  
      /**
       * @return the Filter redirector
       * @throw MissingResourceException if the property defining the Filter
       *        redirector is missing.
       */
      public static String getFilterRedirectorURL()
      {
          return getContextURL() + "/" +
              getConfiguration().getString("cactus.filterRedirectorName");
      }
  
      /**
       * @return true if logging is enabled or false otherwise.
       */
      public static boolean isLoggingEnabled()
      {
          return (new Boolean(getConfiguration().
              getString(ENABLE_LOGGING_PROPERTY)).booleanValue());
      }
  }
  
  
  

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

Reply via email to