ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r691627 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
Date Wed, 03 Sep 2008 14:38:36 GMT
Author: bodewig
Date: Wed Sep  3 07:38:35 2008
New Revision: 691627

URL: http://svn.apache.org/viewvc?rev=691627&view=rev
Log:
ensure TestListenerEvents get labeled even if they span multipl lines.  PR 45411.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=691627&r1=691626&r2=691627&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Sep  3 07:38:35 2008
@@ -187,6 +187,10 @@
    <subant> might set the wrong basedir on the called projects.
    Bugzilla Report 30569.
 
+ * If the message of the failed assertion of a forked JUnit test
+   contained line feeds some excess output ended up in Ant's log.
+   Bugzilla Report 45411.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java?rev=691627&r1=691626&r2=691627&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
Wed Sep  3 07:38:35 2008
@@ -495,10 +495,17 @@
     }
 
     private void logTestListenerEvent(String msg) {
-        PrintStream out = savedOut != null ? savedOut : System.out;
         if (logTestListenerEvents) {
+            PrintStream out = savedOut != null ? savedOut : System.out;
             out.flush();
-            out.println(JUnitTask.TESTLISTENER_PREFIX + msg);
+            if (msg == null) {
+                msg = "null";
+            }
+            StringTokenizer msgLines = new StringTokenizer(msg, "\r\n", false);
+            while (msgLines.hasMoreTokens()) {
+                out.println(JUnitTask.TESTLISTENER_PREFIX
+                            + msgLines.nextToken());
+            }
             out.flush();
         }
     }

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java?rev=691627&r1=691626&r2=691627&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
Wed Sep  3 07:38:35 2008
@@ -227,7 +227,7 @@
     }
 
     // Bugzilla Issue 45411
-    public void XtestMultilineAssertsFork() {
+    public void testMultilineAssertsFork() {
         expectLogNotContaining("testMultilineAssertsFork", "messed up)");
         assertLogNotContaining("crashed)");
     }



Mime
View raw message