You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by an...@apache.org on 2006/01/19 21:05:21 UTC

svn commit: r370591 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java

Author: antoine
Date: Thu Jan 19 12:05:14 2006
New Revision: 370591

URL: http://svn.apache.org/viewcvs?rev=370591&view=rev
Log:
Bugzilla 37426
Submitted by Maarten Coene
<junit> task doesn't print all the Test names when using forkmode='once'

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewcvs/ant/core/trunk/WHATSNEW?rev=370591&r1=370590&r2=370591&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Jan 19 12:05:14 2006
@@ -178,6 +178,9 @@
 * Copy task would fail on locked (or otherwise uncopyable) files even if
   failonerror set to false. Bugzilla report 38175.
 
+* <junit> task did not print all the Test names when using forkmode='once'.
+  Bugzilla report 37426.
+
 Other changes:
 --------------
 * Minor performance improvements Bugzilla report 37777

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java?rev=370591&r1=370590&r2=370591&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Thu Jan 19 12:05:14 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2000-2005 The Apache Software Foundation
+ * Copyright  2000-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -766,8 +766,8 @@
      * @param  watchdog   the watchdog in charge of cancelling the test if it
      * exceeds a certain amount of time. Can be <tt>null</tt>, in this case
      * the test could probably hang forever.
-     * @param ForkedVMState will hold information about the forked
-     * VM's sanity.
+     * @param casesFile list of test cases to execute. Can be <tt>null</tt>,
+     * in this case only one test is executed.
      * @throws BuildException in case of error creating a temporary property file,
      * or if the junit process can not be forked
      */
@@ -789,9 +789,6 @@
         }
         cmd.setClassname("org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner");
         if (casesFile == null) {
-            if (summary) {
-                log("Running " + test.getName(), Project.MSG_INFO);
-            }
             cmd.createArgument().setValue(test.getName());
         } else {
             log("Running multiple tests in the same VM", Project.MSG_VERBOSE);
@@ -927,7 +924,7 @@
      * The file will be in the project basedir unless tmpDir declares
      * something else.
      * @param prefix
-     * @return
+     * @return created file
      */
     private File createTempPropertiesFile(String prefix) {
         File propsFile =
@@ -1073,7 +1070,6 @@
                                          test.getHaltonfailure(), false,
                                          true, classLoader);
             if (summary) {
-                log("Running " + test.getName(), Project.MSG_INFO);
 
                 SummaryJUnitResultFormatter f =
                     new SummaryJUnitResultFormatter();
@@ -1438,7 +1434,7 @@
         /**
          * hashcode is based only on the boolean members, and returns a value
          * in the range 0-7.
-         * @return
+         * @return hash code value
          */
         public int hashCode() {
             return (filterTrace ? 1 : 0)

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java?rev=370591&r1=370590&r2=370591&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java Thu Jan 19 12:05:14 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2000-2002,2004 The Apache Software Foundation
+ * Copyright  2000-2002,2004,2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -50,9 +50,20 @@
     public SummaryJUnitResultFormatter() {
     }
     /**
-     * Empty
+     * The testsuite started.
      */
     public void startTestSuite(JUnitTest suite) {
+        String newLine = System.getProperty("line.separator");
+        StringBuffer sb = new StringBuffer("Running ");
+        sb.append(suite.getName());
+        sb.append(newLine);
+
+        try {
+            out.write(sb.toString().getBytes());
+            out.flush();
+        } catch (IOException ioex) {
+            throw new BuildException("Unable to write summary output", ioex);
+        }
     }
     /**
      * Empty



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