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 ca...@apache.org on 2010/05/29 22:59:21 UTC

svn commit: r949441 - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test: java/org/apache/log4j/util/ resources/org/apache/log4j/

Author: carnold
Date: Sat May 29 20:59:20 2010
New Revision: 949441

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

Modified:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/java/org/apache/log4j/util/JunitTestRunnerFilter.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.1
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.10
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.11
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.12
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.13
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.14
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.15
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.2
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.3
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.4
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.5
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.6
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.7
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.8
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.9

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/java/org/apache/log4j/util/JunitTestRunnerFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/java/org/apache/log4j/util/JunitTestRunnerFilter.java?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/java/org/apache/log4j/util/JunitTestRunnerFilter.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/java/org/apache/log4j/util/JunitTestRunnerFilter.java Sat May 29 20:59:20 2010
@@ -23,15 +23,6 @@ import org.apache.oro.text.perl.Perl5Uti
 public class JunitTestRunnerFilter implements Filter {
   Perl5Util util = new Perl5Util();
 
-  private static final String[] patterns = {
-          "/at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner/",
-          "/at org.apache.tools.ant/",
-          "/at junit.textui.TestRunner/",
-          "/at com.intellij.rt.execution.junit/",
-          "/at java.lang.reflect.Method.invoke/",
-          "/at org.apache.maven.surefire./"
-  };
-
   /**
    * Filter out stack trace lines coming from the various JUnit TestRunners.
    */
@@ -40,18 +31,36 @@ public class JunitTestRunnerFilter imple
       return null;
     }
 
-      //
-      //  restore the one instance of Method.invoke that we actually want
-      //
-    if (util.match("/at junit.framework.TestCase.runTest/", in)) {
-        return "\tat java.lang.reflect.Method.invoke(X)\n" + in;
-    }
-
-    for (int i = 0; i < patterns.length; i++) {
-        if(util.match(patterns[i], in)) {
-            return null;
-        }
+    if (
+      util.match(
+          "/at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner/", in)) {
+      return null;
+    } else if (
+      util.match(
+          "/at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner/",
+          in)) {
+      return null;
+    } else if (
+      util.match(
+          "/at com.intellij/",
+          in)) {
+      return null;
+    } else if (in.indexOf("at junit.") >= 0 && in.indexOf("ui.TestRunner") >= 0) {
+       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(in.indexOf("org.junit") >= 0) {
+        return null;
+    } else if(in.indexOf("java.lang.reflect") >= 0) {
+        return null;
+    } else if (util.match("/\\sat /", in)) {
+       return "\t" + in.trim();
+    } else {
+      return in;
     }
-    return in;
   }
 }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.1
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.1?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.10
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.10?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.11
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.11?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.12
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.12?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.13
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.13?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.14
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.14?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.15
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.15?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.15 (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.15 Sat May 29 20:59:20 2010
@@ -12,7 +12,6 @@ DEBUG 11   - Message 5
 java.lang.Exception: Just testing
 	at org.apache.log4j.PatternLayoutTestCase.common(X)
 	at org.apache.log4j.PatternLayoutTestCase.test15(X)
-	at java.lang.reflect.Method.invoke(X)
 	at junit.framework.TestCase.runTest(X)
 	at junit.framework.TestCase.runBare(X)
 	at junit.framework.TestResult$1.protect(X)
@@ -25,7 +24,6 @@ java.lang.Exception: Just testing
 java.lang.Exception: Just testing
 	at org.apache.log4j.PatternLayoutTestCase.common(X)
 	at org.apache.log4j.PatternLayoutTestCase.test15(X)
-	at java.lang.reflect.Method.invoke(X)
 	at junit.framework.TestCase.runTest(X)
 	at junit.framework.TestCase.runBare(X)
 	at junit.framework.TestResult$1.protect(X)
@@ -38,7 +36,6 @@ java.lang.Exception: Just testing
 java.lang.Exception: Just testing
 	at org.apache.log4j.PatternLayoutTestCase.common(X)
 	at org.apache.log4j.PatternLayoutTestCase.test15(X)
-	at java.lang.reflect.Method.invoke(X)
 	at junit.framework.TestCase.runTest(X)
 	at junit.framework.TestCase.runBare(X)
 	at junit.framework.TestResult$1.protect(X)
@@ -51,7 +48,6 @@ ERROR 14   - Message 8
 java.lang.Exception: Just testing
 	at org.apache.log4j.PatternLayoutTestCase.common(X)
 	at org.apache.log4j.PatternLayoutTestCase.test15(X)
-	at java.lang.reflect.Method.invoke(X)
 	at junit.framework.TestCase.runTest(X)
 	at junit.framework.TestCase.runBare(X)
 	at junit.framework.TestResult$1.protect(X)
@@ -64,7 +60,6 @@ FATAL 15   - Message 9
 java.lang.Exception: Just testing
 	at org.apache.log4j.PatternLayoutTestCase.common(X)
 	at org.apache.log4j.PatternLayoutTestCase.test15(X)
-	at java.lang.reflect.Method.invoke(X)
 	at junit.framework.TestCase.runTest(X)
 	at junit.framework.TestCase.runBare(X)
 	at junit.framework.TestResult$1.protect(X)

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.2
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.2?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.3
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.3?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.4
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.4?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.5
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.5?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.6
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.6?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.7
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.7?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.8
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.8?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.9
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/log4j2-core/src/test/resources/org/apache/log4j/patternLayout.9?rev=949441&r1=949440&r2=949441&view=diff
==============================================================================
Binary files - no diff available.



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