You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ce...@apache.org on 2005/01/12 13:06:23 UTC

cvs commit: logging-log4j/tests/integration/src/webapp/WEB-INF/classes test-log4j.xml

ceki        2005/01/12 04:06:23

  Modified:    tests/integration build.xml
               tests/integration/src/webapp/WEB-INF/classes test-log4j.xml
  Added:       tests/integration README.txt
               tests/integration/src/java TestAppender.java
  Removed:     tests/input/xml fallback1.xml
               tests/src/java/org/apache/log4j/varia
                        ErrorHandlerTestCase.java
               tests/input/schema/valid fallback1.xml
  Log:
  - Removed ErrorHandlerTestCase and related files
  - Updates to the Tomcat integration tests
  
  Revision  Changes    Path
  1.2       +15 -2     logging-log4j/tests/integration/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/integration/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.xml	11 Jan 2005 20:27:22 -0000	1.1
  +++ build.xml	12 Jan 2005 12:06:22 -0000	1.2
  @@ -55,7 +55,7 @@
     </target>
   
     <!-- Initialize the build. Must be called by all targets -->
  -  <target name="init">
  +  <target name="init">  
     </target>
   
     <target name="log4j.jar">
  @@ -73,6 +73,17 @@
       </javac>
     </target>
     
  +
  +  
  +  <!-- Create the jar file containing TestAppender-->
  +  <target name="test-appender.jar" depends="compile.java">
  +
  +    <jar jarfile="${target.dir}/test-appender.jar"
  +         basedir="${target.classes.java.dir}"
  +         includes="TestAppender.class">
  +    </jar>
  +  </target>
  +
     
     <!-- Create the war file -->
     <target name="war" depends="compile">
  @@ -80,6 +91,7 @@
            webxml="${src.webapp.dir}/WEB-INF/web.xml">
         <fileset dir="${src.webapp.dir}"/>
         <classes dir="${target.classes.java.dir}"/>   
  +      <lib file="${target.dir}/test-appender.jar"/>
       </war>
     </target>
   
  @@ -102,7 +114,8 @@
   
   
     <target name="test.prepare" depends="war, compile.test, log4j.jar">
  -    
  +    <mkdir dir="${target.testreports.dir}"/>
  +
       <!-- Cactify the web-app archive -->
       <cactifywar srcfile="${target.dir}/${project.name.file}.war"
                   destfile="${target.dir}/test.war">
  
  
  
  1.1                  logging-log4j/tests/integration/README.txt
  
  Index: README.txt
  ===================================================================
  
  The tests in this directory (LOG4J_HOME/tests/integration/) test
  log4j's integration with various Application Servers. Most of the
  tests deal with the logging separation problem while others deal with
  class loader issues. 
  
  Unfortunately, we are currently unable to test web-applicatin
  recycling with Cactus.
  
  
  Prerequisites
  =============
  
  You need a recent version of Ant.
  
  You need to place the following jar files in the ./lib/ directory.
  
    aspectjrt-1.1.1.jar
    cactus-1.6.1.jar
    cactus-ant-1.6.1.jar
    commons-httpclient-2.0.jar
    commons-logging-1.0.4.jar
  
  They are shipped by Cactus.
  
  You also need to place 'servletapi-2.3.jar' or equivalent in
  ./otherlib/ directory. This jar file also ships with Cactus.
  
  Modify the 'build.properties.sample' file as appropriate for your
  environment and copy it as 'build.properties'.
  
  Make sure that you have a copy of Tomcat 5.0.x installed and
  available. The 'tomcat5x.home' property should point to your Tomcat
  5.0.x installation.
  
  Running the tests
  =================
  
  There nothing more to it than invoking the 'ant test' command.
  
  
  
  1.1                  logging-log4j/tests/integration/src/java/TestAppender.java
  
  Index: TestAppender.java
  ===================================================================
  
  import org.apache.log4j.AppenderSkeleton;
  import org.apache.log4j.spi.LoggingEvent;
  
  
  public class TestAppender extends AppenderSkeleton {
  
    public void activateOptions() {
      getLogger().debug("Activate options called for appender named {}.", 
                        getName());
    }
  
    public void append(LoggingEvent event) {
    }
  
    public void close() {    
    }
  }
  
  
  
  1.2       +5 -2      logging-log4j/tests/integration/src/webapp/WEB-INF/classes/test-log4j.xml
  
  Index: test-log4j.xml
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/integration/src/webapp/WEB-INF/classes/test-log4j.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test-log4j.xml	11 Jan 2005 20:27:22 -0000	1.1
  +++ test-log4j.xml	12 Jan 2005 12:06:23 -0000	1.2
  @@ -3,6 +3,10 @@
   
   <configuration debug="false" xmlns='http://logging.apache.org/'>
     
  +  <appender name="TEST" class="TestAppender">
  +    <param name="bogus" value="bogus"/>
  +  </appender>
  +
     <appender name="FILE" class="org.apache.log4j.FileAppender">
   
       <param name="File" value="server-side.log"/>
  @@ -11,8 +15,6 @@
       <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%-5p %c - %m%n"/>
       </layout>     
  -
  -
     </appender>
   
     <logger name="org.apache.log4j.joran.action"> <level value="INFO"/></logger>
  @@ -22,5 +24,6 @@
     <root>
       <level value="DEBUG"/>
       <appender-ref ref="FILE" />
  +    <appender-ref ref="TEST" />
     </root>
   </configuration>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org