You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-cvs@jakarta.apache.org by ce...@apache.org on 2002/04/16 18:39:47 UTC

cvs commit: jakarta-log4j/tests/witness hierarchyThreshold.1 hierarchyThreshold.2 hierarchyThreshold.3 hierarchyThreshold.4 hierarchyThreshold.5 hierarchyThreshold.6 hierarchyThreshold.7 hierarchyThreshold.8

ceki        02/04/16 09:39:47

  Modified:    tests    build.xml
  Added:       tests/input hierarchyThreshold1.properties
                        hierarchyThreshold2.properties
                        hierarchyThreshold3.properties
                        hierarchyThreshold4.properties
                        hierarchyThreshold5.properties
                        hierarchyThreshold6.properties
                        hierarchyThreshold7.properties
                        hierarchyThreshold8.properties
               tests/src/java/org/apache/log4j
                        HierarchyThresholdTestCase.java
               tests/witness hierarchyThreshold.1 hierarchyThreshold.2
                        hierarchyThreshold.3 hierarchyThreshold.4
                        hierarchyThreshold.5 hierarchyThreshold.6
                        hierarchyThreshold.7 hierarchyThreshold.8
  Log:
  Added HierarchyThresholdTestCase
  
  Revision  Changes    Path
  1.12      +9 -1      jakarta-log4j/tests/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/tests/build.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- build.xml	16 Apr 2002 14:36:14 -0000	1.11
  +++ build.xml	16 Apr 2002 16:39:46 -0000	1.12
  @@ -96,7 +96,7 @@
     <!-- ================================================================= -->  
     <target name="regression" depends="Minimum, Logger, DOM, CustomLevel, 
                                        CustomLogger, PatternLayout, 
  -                                     SocketServer"/>
  +                                     HierarchyThreshold, SocketServer"/>
   
     <!-- ================================================================= -->
     <!-- Unit tests test small parts of log4j for logical programming      -->
  @@ -137,6 +137,14 @@
       </junit>
     </target>
   
  +  <target name="HierarchyThreshold" depends="build">
  +    <delete file="output/temp"/>
  +    <junit printsummary="yes" fork="yes" haltonfailure="yes">
  +      <classpath refid="tests.classpath"/>
  +      <formatter type="plain" usefile="false"/>
  +      <test name="org.apache.log4j.HierarchyThresholdTestCase" />
  +    </junit>
  +  </target>
   
     <target name="DOM" depends="build">
       <junit printsummary="yes" fork="yes" haltonfailure="yes">
  
  
  
  1.1                  jakarta-log4j/tests/input/hierarchyThreshold1.properties
  
  Index: hierarchyThreshold1.properties
  ===================================================================
  log4j.threshold=OFF
  log4j.rootLogger=,A
  log4j.appender.A=org.apache.log4j.FileAppender
  log4j.appender.A.File=output/temp
  log4j.appender.A.Append=false
  log4j.appender.A.layout=org.apache.log4j.PatternLayout
  log4j.appender.A.layout.ConversionPattern=%p [%t] %c{2} = %m%n
  
  
  1.1                  jakarta-log4j/tests/input/hierarchyThreshold2.properties
  
  Index: hierarchyThreshold2.properties
  ===================================================================
  log4j.threshold=FATAL
  log4j.rootLogger=,A
  log4j.appender.A=org.apache.log4j.FileAppender
  log4j.appender.A.File=output/temp
  log4j.appender.A.Append=false
  log4j.appender.A.layout=org.apache.log4j.PatternLayout
  log4j.appender.A.layout.ConversionPattern=%p [%t] %c{2} = %m%n
  
  
  1.1                  jakarta-log4j/tests/input/hierarchyThreshold3.properties
  
  Index: hierarchyThreshold3.properties
  ===================================================================
  log4j.threshold=ERROR
  log4j.rootLogger=,A
  log4j.appender.A=org.apache.log4j.FileAppender
  log4j.appender.A.File=output/temp
  log4j.appender.A.Append=false
  log4j.appender.A.layout=org.apache.log4j.PatternLayout
  log4j.appender.A.layout.ConversionPattern=%p [%t] %c{2} = %m%n
  
  
  1.1                  jakarta-log4j/tests/input/hierarchyThreshold4.properties
  
  Index: hierarchyThreshold4.properties
  ===================================================================
  log4j.threshold=WARN
  log4j.rootLogger=,A
  log4j.appender.A=org.apache.log4j.FileAppender
  log4j.appender.A.File=output/temp
  log4j.appender.A.Append=false
  log4j.appender.A.layout=org.apache.log4j.PatternLayout
  log4j.appender.A.layout.ConversionPattern=%p [%t] %c{2} = %m%n
  
  
  1.1                  jakarta-log4j/tests/input/hierarchyThreshold5.properties
  
  Index: hierarchyThreshold5.properties
  ===================================================================
  log4j.threshold=INFO
  log4j.rootLogger=,A
  log4j.appender.A=org.apache.log4j.FileAppender
  log4j.appender.A.File=output/temp
  log4j.appender.A.Append=false
  log4j.appender.A.layout=org.apache.log4j.PatternLayout
  log4j.appender.A.layout.ConversionPattern=%p [%t] %c{2} = %m%n
  
  
  1.1                  jakarta-log4j/tests/input/hierarchyThreshold6.properties
  
  Index: hierarchyThreshold6.properties
  ===================================================================
  log4j.threshold=DEBUG
  log4j.rootLogger=,A
  log4j.appender.A=org.apache.log4j.FileAppender
  log4j.appender.A.File=output/temp
  log4j.appender.A.Append=false
  log4j.appender.A.layout=org.apache.log4j.PatternLayout
  log4j.appender.A.layout.ConversionPattern=%p [%t] %c{2} = %m%n
  
  
  1.1                  jakarta-log4j/tests/input/hierarchyThreshold7.properties
  
  Index: hierarchyThreshold7.properties
  ===================================================================
  log4j.threshold=TRACE#org.apache.log4j.xml.XLevel
  log4j.rootLogger=ALL,A
  log4j.appender.A=org.apache.log4j.FileAppender
  log4j.appender.A.File=output/temp
  log4j.appender.A.Append=false
  log4j.appender.A.layout=org.apache.log4j.PatternLayout
  log4j.appender.A.layout.ConversionPattern=%p [%t] %c{2} = %m%n
  
  
  
  1.1                  jakarta-log4j/tests/input/hierarchyThreshold8.properties
  
  Index: hierarchyThreshold8.properties
  ===================================================================
  log4j.threshold=ALL
  log4j.rootLogger=ALL,A
  log4j.appender.A=org.apache.log4j.FileAppender
  log4j.appender.A.File=output/temp
  log4j.appender.A.Append=false
  log4j.appender.A.layout=org.apache.log4j.PatternLayout
  log4j.appender.A.layout.ConversionPattern=%p [%t] %c{2} = %m%n
  
  
  1.1                  jakarta-log4j/tests/src/java/org/apache/log4j/HierarchyThresholdTestCase.java
  
  Index: HierarchyThresholdTestCase.java
  ===================================================================
  /* Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  
  package org.apache.log4j;
  
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  import junit.framework.Test;
  
  import org.apache.log4j.*;
  import org.apache.log4j.util.*;
  import org.apache.log4j.xml.XLevel;
  
  /**
     Test the configuration of the hierarchy-wide threshold.
  
     @author  Ceki G&uuml;lc&uuml;
  */
  public class HierarchyThresholdTestCase extends TestCase {
    
    static String TEMP = "output/temp";
    static Logger logger = Logger.getLogger(HierarchyThresholdTestCase.class);
  
    public HierarchyThresholdTestCase(String name) {
      super(name);
    }
  
    public void setUp() {
    }
    
    public void tearDown() {
      System.out.println("Tearing down test case.");
      logger.getLoggerRepository().resetConfiguration();
    }
    
    public void test1() throws Exception {
      PropertyConfigurator.configure("input/hierarchyThreshold1.properties");
      common();
      assertTrue(Compare.compare(TEMP, "witness/hierarchyThreshold.1"));
    }
  
    public void test2() throws Exception {
      PropertyConfigurator.configure("input/hierarchyThreshold2.properties");
      common();
      assertTrue(Compare.compare(TEMP, "witness/hierarchyThreshold.2"));
    }
  
    public void test3() throws Exception {
      PropertyConfigurator.configure("input/hierarchyThreshold3.properties");
      common();
      assertTrue(Compare.compare(TEMP, "witness/hierarchyThreshold.3"));
    }
  
    public void test4() throws Exception {
      PropertyConfigurator.configure("input/hierarchyThreshold4.properties");
      common();
      assertTrue(Compare.compare(TEMP, "witness/hierarchyThreshold.4"));
    }
  
    public void test5() throws Exception {
      PropertyConfigurator.configure("input/hierarchyThreshold5.properties");
      common();
      assertTrue(Compare.compare(TEMP, "witness/hierarchyThreshold.5"));
    }
  
    public void test6() throws Exception {
      PropertyConfigurator.configure("input/hierarchyThreshold6.properties");
      common();
      assertTrue(Compare.compare(TEMP, "witness/hierarchyThreshold.6"));
    }
  
    public void test7() throws Exception {
      PropertyConfigurator.configure("input/hierarchyThreshold7.properties");
      common();
      assertTrue(Compare.compare(TEMP, "witness/hierarchyThreshold.7"));
    }
  
    public void test8() throws Exception {
      PropertyConfigurator.configure("input/hierarchyThreshold8.properties");
      common();
      assertTrue(Compare.compare(TEMP, "witness/hierarchyThreshold.8"));
    }
  
  
    static 
    void common() {
      logger.log(XLevel.TRACE, "m0");
      logger.debug("m1");
      logger.info("m2");
      logger.warn("m3");
      logger.error("m4");
      logger.fatal("m5");
    }
  
    public static Test suite() {
      TestSuite suite = new TestSuite();
      suite.addTest(new HierarchyThresholdTestCase("test1"));
      suite.addTest(new HierarchyThresholdTestCase("test2"));
      suite.addTest(new HierarchyThresholdTestCase("test3"));
      suite.addTest(new HierarchyThresholdTestCase("test4"));
      suite.addTest(new HierarchyThresholdTestCase("test5"));
      suite.addTest(new HierarchyThresholdTestCase("test6"));
      suite.addTest(new HierarchyThresholdTestCase("test7"));
      suite.addTest(new HierarchyThresholdTestCase("test8"));
      return suite;
    }
  }
  
  
  
  1.1                  jakarta-log4j/tests/witness/hierarchyThreshold.1
  
  	<<Binary file>>
  
  
  1.1                  jakarta-log4j/tests/witness/hierarchyThreshold.2
  
  Index: hierarchyThreshold.2
  ===================================================================
  FATAL [main] log4j.HierarchyThresholdTestCase = m5
  
  
  
  1.1                  jakarta-log4j/tests/witness/hierarchyThreshold.3
  
  Index: hierarchyThreshold.3
  ===================================================================
  ERROR [main] log4j.HierarchyThresholdTestCase = m4
  FATAL [main] log4j.HierarchyThresholdTestCase = m5
  
  
  
  1.1                  jakarta-log4j/tests/witness/hierarchyThreshold.4
  
  Index: hierarchyThreshold.4
  ===================================================================
  WARN [main] log4j.HierarchyThresholdTestCase = m3
  ERROR [main] log4j.HierarchyThresholdTestCase = m4
  FATAL [main] log4j.HierarchyThresholdTestCase = m5
  
  
  
  1.1                  jakarta-log4j/tests/witness/hierarchyThreshold.5
  
  Index: hierarchyThreshold.5
  ===================================================================
  INFO [main] log4j.HierarchyThresholdTestCase = m2
  WARN [main] log4j.HierarchyThresholdTestCase = m3
  ERROR [main] log4j.HierarchyThresholdTestCase = m4
  FATAL [main] log4j.HierarchyThresholdTestCase = m5
  
  
  
  1.1                  jakarta-log4j/tests/witness/hierarchyThreshold.6
  
  Index: hierarchyThreshold.6
  ===================================================================
  DEBUG [main] log4j.HierarchyThresholdTestCase = m1
  INFO [main] log4j.HierarchyThresholdTestCase = m2
  WARN [main] log4j.HierarchyThresholdTestCase = m3
  ERROR [main] log4j.HierarchyThresholdTestCase = m4
  FATAL [main] log4j.HierarchyThresholdTestCase = m5
  
  
  
  1.1                  jakarta-log4j/tests/witness/hierarchyThreshold.7
  
  Index: hierarchyThreshold.7
  ===================================================================
  TRACE [main] log4j.HierarchyThresholdTestCase = m0
  DEBUG [main] log4j.HierarchyThresholdTestCase = m1
  INFO [main] log4j.HierarchyThresholdTestCase = m2
  WARN [main] log4j.HierarchyThresholdTestCase = m3
  ERROR [main] log4j.HierarchyThresholdTestCase = m4
  FATAL [main] log4j.HierarchyThresholdTestCase = m5
  
  
  
  1.1                  jakarta-log4j/tests/witness/hierarchyThreshold.8
  
  Index: hierarchyThreshold.8
  ===================================================================
  TRACE [main] log4j.HierarchyThresholdTestCase = m0
  DEBUG [main] log4j.HierarchyThresholdTestCase = m1
  INFO [main] log4j.HierarchyThresholdTestCase = m2
  WARN [main] log4j.HierarchyThresholdTestCase = m3
  ERROR [main] log4j.HierarchyThresholdTestCase = m4
  FATAL [main] log4j.HierarchyThresholdTestCase = m5
  
  
  

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