logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r928156 - in /logging/log4j/trunk: src/changes/ tests/src/java/org/apache/log4j/ tests/src/java/org/apache/log4j/util/ tests/src/java/org/apache/log4j/varia/ tests/src/java/org/apache/log4j/xml/ tests/witness/
Date Sat, 27 Mar 2010 06:12:34 GMT
Author: carnold
Date: Sat Mar 27 06:12:33 2010
New Revision: 928156

URL: http://svn.apache.org/viewvc?rev=928156&view=rev
Log:
Bug 49002: Unit tests fail on gcj and Apache Harmony due to stack trace expectations

Modified:
    logging/log4j/trunk/src/changes/changes.xml
    logging/log4j/trunk/tests/src/java/org/apache/log4j/DRFATestCase.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTest.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/MinimumTestCase.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTest.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTestCase.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/util/JunitTestRunnerFilter.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/util/SunReflectFilter.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/varia/ErrorHandlerTestCase.java
    logging/log4j/trunk/tests/src/java/org/apache/log4j/xml/DOMTestCase.java
    logging/log4j/trunk/tests/witness/fallback1

Modified: logging/log4j/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/changes/changes.xml?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/src/changes/changes.xml (original)
+++ logging/log4j/trunk/src/changes/changes.xml Sat Mar 27 06:12:33 2010
@@ -98,6 +98,7 @@
        <action action="add" issue="48927">Add EnhancedPatternLayout from extras companion.</action>
        <action action="fix" issue="48784">Links to example code broken in the JavaDocs</action>
        <action action="fix" issue="48953">Unused imports and variables in test code
cause gcj compile warnings.</action>
+       <action action="fix" issue="49002">Unit tests fail on Apache Harmony and gcj
due to stack trace expectations.</action>
        <action action="fix" issue="49003">SocketServerTestCase.test8 fails on Apache
Harmony.</action>
        <action action="fix" issue="49004">TestLogMF.testDebugDate fails on gcj.</action>
        <action action="fix" issue="49005">TelnetAppenderTest.testIt fails on gcj.</action>

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/DRFATestCase.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/DRFATestCase.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/DRFATestCase.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/DRFATestCase.java Sat Mar 27 06:12:33
2010
@@ -26,7 +26,6 @@ import java.io.FileInputStream;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
-import java.util.TimeZone;
 import org.apache.log4j.util.Compare;
 
 /**

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTest.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTest.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTest.java Sat
Mar 27 06:12:33 2010
@@ -115,7 +115,7 @@ public class EnhancedPatternLayoutTest e
   /**
    * Class to ensure that protected members are still available.
    */
-  private static final class DerivedPatternLayout extends EnhancedPatternLayout {
+  public static final class DerivedPatternLayout extends EnhancedPatternLayout {
     /**
      * Constructs a new instance of DerivedPatternLayout.
      */

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java
(original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/EnhancedPatternLayoutTestCase.java
Sat Mar 27 06:12:33 2010
@@ -42,7 +42,7 @@ public class EnhancedPatternLayoutTestCa
   static String TEMP = "temp";
   static String FILTERED = "filtered";
   static String EXCEPTION1 = "java.lang.Exception: Just testing";
-  static String EXCEPTION2 = "\\s*at .*\\(.*:\\d{1,4}\\)";
+  static String EXCEPTION2 = "\\s*at .*\\(.*\\)";
   static String EXCEPTION3 = "\\s*at .*\\((Native Method|Unknown Source)\\)";
   static String EXCEPTION4 = "\\s*at .*\\(.*Compiled Code\\)";
 
@@ -55,7 +55,7 @@ public class EnhancedPatternLayoutTestCa
   static String PAT5 =
     "\\[main]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* : Message \\d{1,2}";
   static String PAT6 =
-    "\\[main]\\ (DEBUG|INFO |WARN |ERROR|FATAL) org.apache.log4j.EnhancedPatternLayoutTestCase.common\\(EnhancedPatternLayoutTestCase.java:\\d{1,4}\\):
Message \\d{1,2}";
+    "\\[main]\\ (DEBUG|INFO |WARN |ERROR|FATAL) org.apache.log4j.EnhancedPatternLayoutTestCase.common\\(EnhancedPatternLayoutTestCase.java(:\\d{1,4})?\\):
Message \\d{1,2}";
   static String PAT11a =
     "^(DEBUG|INFO |WARN |ERROR|FATAL) \\[main]\\ log4j.EnhancedPatternLayoutTest: Message
\\d{1,2}";
   static String PAT11b =

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/MinimumTestCase.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/MinimumTestCase.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/MinimumTestCase.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/MinimumTestCase.java Sat Mar 27 06:12:33
2010
@@ -32,7 +32,7 @@ public class MinimumTestCase extends Tes
   static String FILTERED = "output/filtered";
 
   static String EXCEPTION1 = "java.lang.Exception: Just testing";
-  static String EXCEPTION2 = "\\s*at .*\\(.*:\\d{1,4}\\)";
+  static String EXCEPTION2 = "\\s*at .*\\(.*\\)";
   static String EXCEPTION3 = "\\s*at .*\\(Native Method\\)";
   static String EXCEPTION4 = "\\s*at .*\\(.*Compiled Code\\)";
   static String EXCEPTION5 = "\\s*at .*\\(.*libgcj.*\\)";

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTest.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTest.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTest.java Sat Mar 27
06:12:33 2010
@@ -116,7 +116,7 @@ public class PatternLayoutTest extends L
   /**
    * Class to ensure that protected members are still available.
    */
-  private static final class DerivedPatternLayout extends PatternLayout {
+  public static final class DerivedPatternLayout extends PatternLayout {
     /**
      * Constructs a new instance of DerivedPatternLayout.
      */

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTestCase.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTestCase.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTestCase.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/PatternLayoutTestCase.java Sat Mar
27 06:12:33 2010
@@ -39,7 +39,7 @@ public class PatternLayoutTestCase exten
   Logger logger;
 
   static String EXCEPTION1 = "java.lang.Exception: Just testing";
-  static String EXCEPTION2 = "\\s*at .*\\(.*:\\d{1,4}\\)";
+  static String EXCEPTION2 = "\\s*at .*\\(.*\\)";
   static String EXCEPTION3 = "\\s*at .*\\(Native Method\\)";
   static String EXCEPTION4 = "\\s*at .*\\(.*Compiled Code\\)";
   static String EXCEPTION5 = "\\s*at .*\\(.*libgcj.*\\)";
@@ -51,7 +51,7 @@ public class PatternLayoutTestCase exten
   static String PAT4 = Filter.RELATIVE_TIME_PAT+ " " + PAT0;
 
   static String PAT5 = "\\[main]\\ (TRACE|DEBUG|INFO |WARN |ERROR|FATAL) .* : Message \\d{1,2}";
-  static String PAT6 = "\\[main]\\ (TRACE|DEBUG|INFO |WARN |ERROR|FATAL) org.apache.log4j.PatternLayoutTestCase.common\\(PatternLayoutTestCase.java:\\d{1,4}\\):
Message \\d{1,2}";
+  static String PAT6 = "\\[main]\\ (TRACE|DEBUG|INFO |WARN |ERROR|FATAL) org.apache.log4j.PatternLayoutTestCase.common\\(PatternLayoutTestCase.java(:\\d{1,4})?\\):
Message \\d{1,2}";
 
   static String PAT11a = "^(TRACE|DEBUG|INFO |WARN |ERROR|FATAL) \\[main]\\ log4j.PatternLayoutTestCase:
Message \\d{1,2}";
   static String PAT11b = "^(TRACE|DEBUG|INFO |WARN |ERROR|FATAL) \\[main]\\ root: Message
\\d{1,2}";

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/util/JunitTestRunnerFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/util/JunitTestRunnerFilter.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/util/JunitTestRunnerFilter.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/util/JunitTestRunnerFilter.java Sat
Mar 27 06:12:33 2010
@@ -49,6 +49,10 @@ public class JunitTestRunnerFilter imple
        return null;
     } else if (in.indexOf("org.apache.maven") >= 0) {
        return null;
+    } else if(in.indexOf("junit.internal") >= 0) {
+        return null;
+    } else if(in.indexOf("JUnit4TestAdapter") >= 0) {
+        return null;
     } else if (util.match("/\\sat /", in)) {
        return "\t" + in.trim();
     } else {

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/util/SunReflectFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/util/SunReflectFilter.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/util/SunReflectFilter.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/util/SunReflectFilter.java Sat Mar
27 06:12:33 2010
@@ -34,7 +34,7 @@ public class SunReflectFilter implements
     if (util.match("/at sun.reflect/", in)) {
       return null;
     }
-    if (in.indexOf("at java.lang.reflect.Method") >= 0) {
+    if (in.indexOf("at java.lang.reflect.") >= 0) {
       return null;
     }
     if (in.indexOf("Compiled Code") >= 0) {

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/varia/ErrorHandlerTestCase.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/varia/ErrorHandlerTestCase.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/varia/ErrorHandlerTestCase.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/varia/ErrorHandlerTestCase.java Sat
Mar 27 06:12:33 2010
@@ -26,6 +26,7 @@ import org.apache.log4j.util.Filter;
 import org.apache.log4j.util.Transformer;
 import org.apache.log4j.util.Compare;
 import org.apache.log4j.util.JunitTestRunnerFilter;
+import org.apache.log4j.util.SunReflectFilter;
 import org.apache.log4j.util.LineNumberFilter;
 import org.apache.log4j.util.ControlFilter;
 import org.apache.log4j.xml.DOMConfigurator;
@@ -38,7 +39,7 @@ public class ErrorHandlerTestCase extend
 
 
   static String EXCEPTION1 = "java.lang.Exception: Just testing";
-  static String EXCEPTION2 = "\\s*at .*\\(.*:\\d{1,4}\\)";
+  static String EXCEPTION2 = "\\s*at .*\\(.*\\)";
   static String EXCEPTION3 = "\\s*at .*\\(Native Method\\)";
 
   static String TEST1_PAT =
@@ -73,8 +74,9 @@ public class ErrorHandlerTestCase extend
 					       EXCEPTION1, EXCEPTION2, EXCEPTION3});
 
     Transformer.transform(TEMP, FILTERED, new Filter[] {cf,
-							new LineNumberFilter(),
-                            new JunitTestRunnerFilter()});
+                            new LineNumberFilter(),
+                            new JunitTestRunnerFilter(),
+                            new SunReflectFilter()});
 
 
     assertTrue(Compare.compare(FILTERED, "witness/fallback1"));
@@ -92,8 +94,9 @@ public class ErrorHandlerTestCase extend
 					       EXCEPTION1, EXCEPTION2, EXCEPTION3});
 
     Transformer.transform(TEMP, FILTERED, new Filter[] {cf,
-							new LineNumberFilter(),
-                            new JunitTestRunnerFilter()});
+                            new LineNumberFilter(),
+                            new JunitTestRunnerFilter(),
+                            new SunReflectFilter()});
 
 
     assertTrue(Compare.compare(FILTERED, "witness/fallback1"));

Modified: logging/log4j/trunk/tests/src/java/org/apache/log4j/xml/DOMTestCase.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/src/java/org/apache/log4j/xml/DOMTestCase.java?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/src/java/org/apache/log4j/xml/DOMTestCase.java (original)
+++ logging/log4j/trunk/tests/src/java/org/apache/log4j/xml/DOMTestCase.java Sat Mar 27 06:12:33
2010
@@ -57,7 +57,7 @@ public class DOMTestCase extends TestCas
 
 
   static String EXCEPTION1 = "java.lang.Exception: Just testing";
-  static String EXCEPTION2 = "\\s*at .*\\(.*:\\d{1,4}\\)";
+  static String EXCEPTION2 = "\\s*at .*\\(.*\\)";
   static String EXCEPTION3 = "\\s*at .*\\(Native Method\\)";
   static String EXCEPTION4 = "\\s*at .*\\(.*Compiled Code\\)";
   static String EXCEPTION5 = "\\s*at .*\\(.*libgcj.*\\)";

Modified: logging/log4j/trunk/tests/witness/fallback1
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/tests/witness/fallback1?rev=928156&r1=928155&r2=928156&view=diff
==============================================================================
--- logging/log4j/trunk/tests/witness/fallback1 (original)
+++ logging/log4j/trunk/tests/witness/fallback1 Sat Mar 27 06:12:33 2010
@@ -12,10 +12,6 @@ FALLBACK - test - Message 5
 java.lang.Exception: Just testing
 	at org.apache.log4j.varia.ErrorHandlerTestCase.common(ErrorHandlerTestCase.java:XXX)
 	at org.apache.log4j.varia.ErrorHandlerTestCase.test1(ErrorHandlerTestCase.java:XXX)
-	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:XXX)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:XXX)
-	at java.lang.reflect.Method.invoke(Method.java:XXX)
 	at junit.framework.TestCase.runTest(TestCase.java:XXX)
 	at junit.framework.TestCase.runBare(TestCase.java:XXX)
 	at junit.framework.TestResult$1.protect(TestResult.java:XXX)
@@ -28,10 +24,6 @@ FALLBACK - root - Message 5
 java.lang.Exception: Just testing
 	at org.apache.log4j.varia.ErrorHandlerTestCase.common(ErrorHandlerTestCase.java:XXX)
 	at org.apache.log4j.varia.ErrorHandlerTestCase.test1(ErrorHandlerTestCase.java:XXX)
-	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:XXX)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:XXX)
-	at java.lang.reflect.Method.invoke(Method.java:XXX)
 	at junit.framework.TestCase.runTest(TestCase.java:XXX)
 	at junit.framework.TestCase.runBare(TestCase.java:XXX)
 	at junit.framework.TestResult$1.protect(TestResult.java:XXX)
@@ -44,10 +36,6 @@ FALLBACK - test - Message 6
 java.lang.Exception: Just testing
 	at org.apache.log4j.varia.ErrorHandlerTestCase.common(ErrorHandlerTestCase.java:XXX)
 	at org.apache.log4j.varia.ErrorHandlerTestCase.test1(ErrorHandlerTestCase.java:XXX)
-	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:XXX)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:XXX)
-	at java.lang.reflect.Method.invoke(Method.java:XXX)
 	at junit.framework.TestCase.runTest(TestCase.java:XXX)
 	at junit.framework.TestCase.runBare(TestCase.java:XXX)
 	at junit.framework.TestResult$1.protect(TestResult.java:XXX)
@@ -60,10 +48,6 @@ FALLBACK - root - Message 6
 java.lang.Exception: Just testing
 	at org.apache.log4j.varia.ErrorHandlerTestCase.common(ErrorHandlerTestCase.java:XXX)
 	at org.apache.log4j.varia.ErrorHandlerTestCase.test1(ErrorHandlerTestCase.java:XXX)
-	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:XXX)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:XXX)
-	at java.lang.reflect.Method.invoke(Method.java:XXX)
 	at junit.framework.TestCase.runTest(TestCase.java:XXX)
 	at junit.framework.TestCase.runBare(TestCase.java:XXX)
 	at junit.framework.TestResult$1.protect(TestResult.java:XXX)



---------------------------------------------------------------------
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