logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/log4j HTMLLayout.java
Date Sat, 01 May 2004 13:10:55 GMT
ceki        2004/05/01 06:10:55

  Modified:    tests/src/java/org/apache/log4j/xml XMLLayoutTestCase.java
               tests/src/java/org/apache/log4j/util SunReflectFilter.java
                        XMLSequenceNumberFilter.java
                        XMLTimestampFilter.java XMLLineAttributeFilter.java
               tests/src/java/org/apache/log4j/net
                        SocketServerTestCase.java
               tests/witness xmlLayout.1 xmlLayout.null xmlLayout.2
               src/java/org/apache/log4j HTMLLayout.java
  Log:
  Changes to keep the unit tests happy in particualr when run by gump.
  
  Revision  Changes    Path
  1.11      +19 -6     logging-log4j/tests/src/java/org/apache/log4j/xml/XMLLayoutTestCase.java
  
  Index: XMLLayoutTestCase.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/xml/XMLLayoutTestCase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- XMLLayoutTestCase.java	28 Apr 2004 17:54:03 -0000	1.10
  +++ XMLLayoutTestCase.java	1 May 2004 13:10:55 -0000	1.11
  @@ -26,6 +26,7 @@
   import org.apache.log4j.MDC;
   import org.apache.log4j.util.Compare;
   import org.apache.log4j.util.Filter;
  +import org.apache.log4j.util.JunitTestRunnerFilter;
   import org.apache.log4j.util.LineNumberFilter;
   import org.apache.log4j.util.SunReflectFilter;
   import org.apache.log4j.util.Transformer;
  @@ -61,7 +62,9 @@
       Transformer.transform(
         TEMP, FILTERED,
         new Filter[] {
  -        new LineNumberFilter(), new XMLTimestampFilter(), 
  +        new LineNumberFilter(),
  +        new JunitTestRunnerFilter(),
  +        new XMLTimestampFilter(), 
           new XMLSequenceNumberFilter(),
           new SunReflectFilter()
         });
  @@ -76,7 +79,9 @@
       Transformer.transform(
         TEMP, FILTERED,
         new Filter[] {
  -        new LineNumberFilter(), new XMLTimestampFilter(),
  +        new LineNumberFilter(), 
  +        new JunitTestRunnerFilter(),
  +        new XMLTimestampFilter(),
           new XMLSequenceNumberFilter(),
           new XMLLineAttributeFilter(), new SunReflectFilter()
         });
  @@ -93,7 +98,9 @@
       Transformer.transform(
         TEMP, FILTERED,
         new Filter[] {
  -        new LineNumberFilter(), new XMLTimestampFilter(),
  +        new LineNumberFilter(), 
  +        new JunitTestRunnerFilter(),
  +        new XMLTimestampFilter(),
           new XMLSequenceNumberFilter(),
           new XMLLineAttributeFilter(), new SunReflectFilter()
         });
  @@ -110,7 +117,9 @@
       logger.debug("hi", e);
       Transformer.transform(
         TEMP, FILTERED,
  -      new Filter[] { new LineNumberFilter(), new XMLTimestampFilter(),  
  +      new Filter[] { new LineNumberFilter(), 
  +          new JunitTestRunnerFilter(),
  +          new XMLTimestampFilter(),  
             new XMLSequenceNumberFilter() });
       assertTrue(Compare.compare(FILTERED, "witness/xmlLayout.null"));
     }
  @@ -131,7 +140,9 @@
       logger.debug("Hello");
       Transformer.transform(
         TEMP, FILTERED,
  -      new Filter[] { new LineNumberFilter(), new XMLTimestampFilter(), 
  +      new Filter[] { new LineNumberFilter(), 
  +          new JunitTestRunnerFilter(),
  +          new XMLTimestampFilter(), 
             new XMLSequenceNumberFilter()});
       assertTrue(Compare.compare(FILTERED, "witness/xmlLayout.mdc.1"));
     }
  @@ -147,7 +158,9 @@
       logger.debug("Hello");
       Transformer.transform(
         TEMP, FILTERED,
  -      new Filter[] { new LineNumberFilter(), new XMLTimestampFilter(),
  +      new Filter[] { new LineNumberFilter(), 
  +          new JunitTestRunnerFilter(),
  +          new XMLTimestampFilter(),
             new XMLSequenceNumberFilter() });
       assertTrue(Compare.compare(FILTERED, "witness/xmlLayout.mdc.2"));
     }
  
  
  
  1.4       +3 -0      logging-log4j/tests/src/java/org/apache/log4j/util/SunReflectFilter.java
  
  Index: SunReflectFilter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/util/SunReflectFilter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SunReflectFilter.java	27 Feb 2004 16:47:37 -0000	1.3
  +++ SunReflectFilter.java	1 May 2004 13:10:55 -0000	1.4
  @@ -23,6 +23,9 @@
     Perl5Util util = new Perl5Util();
   
     public String filter(String in) {
  +    if(in == null) {
  +      return null;
  +    }
       if (util.match("/at sun.reflect/", in)) {
         return null;
       } else {
  
  
  
  1.2       +3 -0      logging-log4j/tests/src/java/org/apache/log4j/util/XMLSequenceNumberFilter.java
  
  Index: XMLSequenceNumberFilter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/util/XMLSequenceNumberFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMLSequenceNumberFilter.java	28 Apr 2004 17:54:03 -0000	1.1
  +++ XMLSequenceNumberFilter.java	1 May 2004 13:10:55 -0000	1.2
  @@ -27,6 +27,9 @@
      * replace the number 123 by XXX and return the result.
      */
     public String filter(String in) {
  +    if(in == null) {
  +      return null;
  +    }
       if (util.match("/sequenceNumber=\"\\d{1,13}\"/", in)) {
         return util.substitute(
           "s/sequenceNumber=\"\\d{1,13}\"/sequenceNumber=\"XXX\"/", in);
  
  
  
  1.4       +3 -0      logging-log4j/tests/src/java/org/apache/log4j/util/XMLTimestampFilter.java
  
  Index: XMLTimestampFilter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/util/XMLTimestampFilter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XMLTimestampFilter.java	27 Feb 2004 16:47:37 -0000	1.3
  +++ XMLTimestampFilter.java	1 May 2004 13:10:55 -0000	1.4
  @@ -23,6 +23,9 @@
     Perl5Util util = new Perl5Util();
   
     public String filter(String in) {
  +    if(in == null) {
  +      return null;
  +    }
       if (util.match("/timestamp=\"\\d{10,13}\"/", in)) {
         return util.substitute(
           "s/timestamp=\"\\d{10,13}\"/timestamp=\"XXX\"/", in);
  
  
  
  1.4       +3 -0      logging-log4j/tests/src/java/org/apache/log4j/util/XMLLineAttributeFilter.java
  
  Index: XMLLineAttributeFilter.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/util/XMLLineAttributeFilter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XMLLineAttributeFilter.java	27 Feb 2004 16:47:37 -0000	1.3
  +++ XMLLineAttributeFilter.java	1 May 2004 13:10:55 -0000	1.4
  @@ -23,6 +23,9 @@
     Perl5Util util = new Perl5Util();
   
     public String filter(String in) {
  +    if(in == null) {
  +      return null;
  +    }
       if (util.match("/line=\"\\d{1,3}\"/", in)) {
         return util.substitute("s/line=\"\\d{1,3}\"/line=\"X\"/", in);
       } else if (util.match("/line=\"?\"/", in)) {
  
  
  
  1.7       +0 -6      logging-log4j/tests/src/java/org/apache/log4j/net/SocketServerTestCase.java
  
  Index: SocketServerTestCase.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/src/java/org/apache/log4j/net/SocketServerTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SocketServerTestCase.java	27 Feb 2004 16:47:36 -0000	1.6
  +++ SocketServerTestCase.java	1 May 2004 13:10:55 -0000	1.7
  @@ -14,12 +14,6 @@
    * limitations under the License.
    */
   
  -/* 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.net;
   
   import junit.framework.Test;
  
  
  
  1.5       +0 -8      logging-log4j/tests/witness/xmlLayout.1
  
  Index: xmlLayout.1
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/witness/xmlLayout.1,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- xmlLayout.1	28 Apr 2004 17:54:02 -0000	1.4
  +++ xmlLayout.1	1 May 2004 13:10:55 -0000	1.5
  @@ -56,8 +56,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   </log4j:event>
   
  @@ -75,8 +73,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   </log4j:event>
   
  @@ -94,8 +90,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   </log4j:event>
   
  @@ -113,8 +107,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   </log4j:event>
   
  
  
  
  1.4       +0 -2      logging-log4j/tests/witness/xmlLayout.null
  
  Index: xmlLayout.null
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/witness/xmlLayout.null,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- xmlLayout.null	28 Apr 2004 17:54:02 -0000	1.3
  +++ xmlLayout.null	1 May 2004 13:10:55 -0000	1.4
  @@ -22,8 +22,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   </log4j:event>
   
  
  
  
  1.6       +0 -8      logging-log4j/tests/witness/xmlLayout.2
  
  Index: xmlLayout.2
  ===================================================================
  RCS file: /home/cvs/logging-log4j/tests/witness/xmlLayout.2,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- xmlLayout.2	28 Apr 2004 17:54:02 -0000	1.5
  +++ xmlLayout.2	1 May 2004 13:10:55 -0000	1.6
  @@ -67,8 +67,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   <log4j:locationInfo class="org.apache.log4j.xml.XMLLayoutTestCase" method="common" file="XMLLayoutTestCase.java"
line="X"/>
   </log4j:event>
  @@ -87,8 +85,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   <log4j:locationInfo class="org.apache.log4j.xml.XMLLayoutTestCase" method="common" file="XMLLayoutTestCase.java"
line="X"/>
   </log4j:event>
  @@ -107,8 +103,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   <log4j:locationInfo class="org.apache.log4j.xml.XMLLayoutTestCase" method="common" file="XMLLayoutTestCase.java"
line="X"/>
   </log4j:event>
  @@ -127,8 +121,6 @@
   	at junit.framework.TestCase.run(X)
   	at junit.framework.TestSuite.runTest(X)
   	at junit.framework.TestSuite.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(X)
  -	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(X)
   ]]></log4j:throwable>
   <log4j:locationInfo class="org.apache.log4j.xml.XMLLayoutTestCase" method="common" file="XMLLayoutTestCase.java"
line="X"/>
   </log4j:event>
  
  
  
  1.33      +1 -1      logging-log4j/src/java/org/apache/log4j/HTMLLayout.java
  
  Index: HTMLLayout.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/HTMLLayout.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- HTMLLayout.java	27 Feb 2004 16:47:28 -0000	1.32
  +++ HTMLLayout.java	1 May 2004 13:10:55 -0000	1.33
  @@ -119,7 +119,7 @@
       output.write(Layout.LINE_SEP + "<tr>" + Layout.LINE_SEP);
   
       output.write("<td>");
  -    output.write(Long.toString(event.timeStamp - LoggingEvent.getStartTime()));
  +    output.write(Long.toString(event.getTimeStamp() - LoggingEvent.getStartTime()));
       output.write("</td>" + Layout.LINE_SEP);
   
       output.write("<td title=\"" + event.getThreadName() + " thread\">");
  
  
  

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


Mime
View raw message