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 2001/06/27 23:34:44 UTC

cvs commit: jakarta-log4j/src/java/org/apache/log4j/xml/test DOMTest.java Makefile

ceki        01/06/27 14:34:44

  Modified:    build    build.xml
               docs     TROUBLESHOOT.html critique.html
               src/java/org/apache/log4j/test runAll
               src/java/org/apache/log4j/varia PriorityMatchFilter.java
               src/java/org/apache/log4j/xml DOMConfigurator.java
               src/java/org/apache/log4j/xml/examples XPriority.java
                        package.html
               src/java/org/apache/log4j/xml/test DOMTest.java Makefile
  Added:       src/java/org/apache/log4j/test extSupport
               src/java/org/apache/log4j/test/witness ext.1
  Log:
  - Added a new test on extension support by DOMConfigurator and other components.
  
  - Added a toPriority(String) method to XPriority. This is required by DOMConfigurator
  
  - Doc changes.
  
  Revision  Changes    Path
  1.38      +4 -2      jakarta-log4j/build/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/build/build.xml,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- build.xml	2001/06/19 18:45:18	1.37
  +++ build.xml	2001/06/27 21:34:28	1.38
  @@ -278,12 +278,14 @@
   
       <copy todir="${BSTEM}/xml/examples/doc-files/" >
         <fileset dir="${BSTEM}/xml/examples/" 
  -         includes="XMLSample.java, sample*.xml, extension1.xml, 
  -	     extension2.xml, XCategory.java, XTest.java"/>
  +         includes="XMLSample.java, XCategory.java, XTest.java"/>
       </copy>
   
       <copy todir="${BSTEM}/xml/doc-files/"  >
         <fileset dir="${BSTEM}/xml/" includes="log4j.dtd"/>
  +      <fileset dir="${BSTEM}/xml/test/" includes="*.xml"/>
  +      <fileset dir="${BSTEM}/xml/examples/" 
  +         includes="sample*.xml, extension?.xml"/>
       </copy>
   
   
  
  
  
  1.10      +1 -1      jakarta-log4j/docs/TROUBLESHOOT.html
  
  Index: TROUBLESHOOT.html
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/docs/TROUBLESHOOT.html,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TROUBLESHOOT.html	2001/06/27 16:02:40	1.9
  +++ TROUBLESHOOT.html	2001/06/27 21:34:30	1.10
  @@ -218,7 +218,7 @@
   connection refused</code>.
   
   <p>This can be done by adding the <code>-r</code> option when starting
  -the daemon. Or more precesiely:
  +the daemon. Or more precisely:
   
   <ol>
   <li>Login as the <code>root</code> user
  
  
  
  1.15      +1 -1      jakarta-log4j/docs/critique.html
  
  Index: critique.html
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/docs/critique.html,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- critique.html	2001/06/27 16:02:40	1.14
  +++ critique.html	2001/06/27 21:34:30	1.15
  @@ -459,7 +459,7 @@
   <li><p><a href="pub-support/SabyMaxime.html">Saby Maxime</a> 
   <li><p><a href="pub-support/MeirFaraj.html">Meir Faraj</a> 
   <li><p><a href="pub-support/RobWalker.html">Rob Walker</a> <!-- -->
  -<li><p><a href="pub-support/LorrinNelson.html">Lorrin Nelson</a> 
  +<li><p><a href="pub-support/LorrinNelson.html">Lorrin Nelson</a> <!-- -->
   <li><p><a href="pub-support/ChristopherCooper.html">Christopher J. Cooper</a> <!-- -->
   <li><p><a href="pub-support/LarsGregori.html">Lars Gregori</a> <!-- -->
   <li><p><a href="pub-support/VieridelBianco.html">Vieri del Bianco</a> <!-- -->
  
  
  
  1.5       +2 -0      jakarta-log4j/src/java/org/apache/log4j/test/runAll
  
  Index: runAll
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/test/runAll,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- runAll	2001/05/20 14:03:32	1.4
  +++ runAll	2001/06/27 21:34:32	1.5
  @@ -16,5 +16,7 @@
   ./pattern || die "pattern test FAILED."
   ./mycat || die "mycat test FAILED."
   ./l7d || die "L7D test FAILED."
  +./fqcn || die "FQCN test FAILED."
  +./extTest || die "Extension support test FAILED."
   
   ./unitTest || die "unit test FAILED."
  
  
  
  1.1                  jakarta-log4j/src/java/org/apache/log4j/test/extSupport
  
  Index: extSupport
  ===================================================================
  #!/bin/bash
  
  # A regression test to check extension support in DOMConfigurator and elsewhere
  
  # Read the .functions file
  . .functions
  
  # If set, allows to skip tests 
  declare -i start=$1
  echo "start=$start TEMP=$TEMP OUTPUT=$OUTPUT"
  
  function testExtSupport {
   configFile=$1
   
   echo -n "Extension support test $TEST - "
   java org.apache.log4j.xml.test.XTest $configFile
  
   check witness/ext.$TEST $OUTPUT; echo "OK."
  }
  
  
  
  declare -i TEST
  
  TEST=1
  if [ $TEST -ge $start ]; then
    testExtSupport xml/ext$TEST.xml
  fi
  
  
  1.1                  jakarta-log4j/src/java/org/apache/log4j/test/witness/ext.1
  
  Index: ext.1
  ===================================================================
  TRACE test.XTest - Message 0
  
  
  
  1.7       +9 -4      jakarta-log4j/src/java/org/apache/log4j/varia/PriorityMatchFilter.java
  
  Index: PriorityMatchFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/varia/PriorityMatchFilter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PriorityMatchFilter.java	2001/04/26 17:31:05	1.6
  +++ PriorityMatchFilter.java	2001/06/27 21:34:35	1.7
  @@ -1,5 +1,10 @@
  -//  Copyright (c) 2000 Ceki Gulcu.  All Rights Reserved.
  -//  See the LICENCE file for the terms of distribution.
  +/*
  + * 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.APL file.
  + */
   
   package org.apache.log4j.varia;
   
  @@ -73,7 +78,7 @@
     public
     void setOption(String key, String value) {    
       if(key.equalsIgnoreCase(PRIORITY_TO_MATCH_OPTION)) {
  -      priorityToMatch = Priority.toPriority(value, null);
  +      priorityToMatch = OptionConverter.toPriority(value, null);
       } else if (key.equalsIgnoreCase(ACCEPT_ON_MATCH_OPTION)) {
         acceptOnMatch = OptionConverter.toBoolean(value, acceptOnMatch);
       }
  @@ -81,7 +86,7 @@
     
     public
     void setPriorityToMatch(String priority) {
  -    priorityToMatch = Priority.toPriority(priority, null);
  +    priorityToMatch = OptionConverter.toPriority(priority, null);
     }
     
     public
  
  
  
  1.26      +1 -2      jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java
  
  Index: DOMConfigurator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DOMConfigurator.java	2001/06/25 06:58:09	1.25
  +++ DOMConfigurator.java	2001/06/27 21:34:36	1.26
  @@ -479,8 +479,7 @@
         } else {
   	cat.setPriority(null);
         }
  -    }
  -    else {
  +    } else {
         String className = subst(element.getAttribute(CLASS_ATTR));      
         if(EMPTY_STR.equals(className)) {      
   	
  
  
  
  1.6       +11 -1     jakarta-log4j/src/java/org/apache/log4j/xml/examples/XPriority.java
  
  Index: XPriority.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/examples/XPriority.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XPriority.java	2001/04/17 17:14:28	1.5
  +++ XPriority.java	2001/06/27 21:34:39	1.6
  @@ -29,11 +29,21 @@
       super(level, strLevel, syslogEquiv);
     }
   
  +  /**
  +     Convert the string passed as argument to a priority. If the
  +     conversion fails, then this method returns {@link #TRACE}. 
  +  */
  +  public
  +  static
  +  Priority toPriority(String sArg) {
  +    return toPriority(sArg, XPriority.TRACE);
  +  }
   
  +
     public
     static
     Priority toPriority(String sArg, Priority defaultValue) {
  -    
  +
       if(sArg == null) {
         return defaultValue;
       }
  
  
  
  1.3       +6 -6      jakarta-log4j/src/java/org/apache/log4j/xml/examples/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/examples/package.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- package.html	2001/03/20 16:06:03	1.2
  +++ package.html	2001/06/27 21:34:39	1.3
  @@ -10,13 +10,13 @@
   configuration file.
   
   <p>See source code of <a
  -href="doc-files/XMLSample.java">XMLSample.java</a> showing how to
  +href="../doc-files/XMLSample.java">XMLSample.java</a> showing how to
   configure with an XML file.  Sample XML files 
  -<a href="doc-files/sample1.xml">sample1.xml</a>, 
  -<a href="doc-files/sample2.xml">sample2.xml</a>, 
  -<a href="doc-files/sample3.xml">sample3.xml</a>, 
  -<a href="doc-files/sample4.xml">sample4.xml</a>, 
  -<a href="doc-files/sample5.xml">sample5.xml</a> are provided.
  +<a href="../doc-files/sample1.xml">sample1.xml</a>, 
  +<a href="../doc-files/sample2.xml">sample2.xml</a>, 
  +<a href="../doc-files/sample3.xml">sample3.xml</a>, 
  +<a href="../doc-files/sample4.xml">sample4.xml</a>, 
  +<a href="../doc-files/sample5.xml">sample5.xml</a> are provided.
   
   <hr>
   <address></address>
  
  
  
  1.5       +0 -13     jakarta-log4j/src/java/org/apache/log4j/xml/test/DOMTest.java
  
  Index: DOMTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/test/DOMTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMTest.java	2001/01/18 07:49:40	1.4
  +++ DOMTest.java	2001/06/27 21:34:41	1.5
  @@ -45,19 +45,6 @@
     static
     void init(String configFile) {
       DOMConfigurator.configure(configFile);
  -    //try {
  -      //DOMParser domParser = new DOMParser();
  -      //domParser.setFeature("http://xml.org/sax/features/validation", true);
  -      //domParser.setFeature("http://xml.org/sax/features/namespaces", true); 
  -      //domParser.setErrorHandler(new ReportParserError());      
  -      //domParser.parse(new InputSource(configFile));
  -      //DOMConfigurator.configure(domParser.getDocument().getDocumentElement() );
  -      //}
  -    //catch(Exception e) {
  -    //System.err.println("Could not initialize test program.");
  -    //e.printStackTrace();
  -    //System.exit(1);		
  -    //}
     }
   
     static
  
  
  
  1.6       +2 -1      jakarta-log4j/src/java/org/apache/log4j/xml/test/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/xml/test/Makefile,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Makefile	2001/03/21 21:34:32	1.5
  +++ Makefile	2001/06/27 21:34:41	1.6
  @@ -2,7 +2,8 @@
   PKG_DIR :=org/apache/log4j/xml/test
   DEPTH   :=../../../../../../..
   JSOURCES:=DOMTest.java DisableOverrideTest.java \
  -	SubClassTest.java\
  + SubClassTest.java\
  + XTest.java\
   
   #DisableTest.java \
   SUBDIRS :=
  
  
  

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