PR: 31962 Obtained from: Kevin Jackson git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277033 13f79535-47bb-0310-9956-ffa450edef68master
@@ -81,7 +81,10 @@ Other changes: | |||||
* New task <getlibraries> can retrieve library files from a maven repository. | * New task <getlibraries> can retrieve library files from a maven repository. | ||||
* unzip/unwar/unjar/untar now supports a nested mapper, which lets you unzip | * unzip/unwar/unjar/untar now supports a nested mapper, which lets you unzip | ||||
in useful ways. | |||||
in useful ways. | |||||
* Junit task -- display suite first. | |||||
Bugzilla report 31962. | |||||
Changes from Ant 1.6.2 to current Ant 1.6 CVS version | Changes from Ant 1.6.2 to current Ant 1.6 CVS version | ||||
===================================================== | ===================================================== | ||||
@@ -94,19 +94,27 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter { | |||||
/** | /** | ||||
* The whole testsuite started. | * The whole testsuite started. | ||||
* @param suite the test suite | |||||
*/ | */ | ||||
public void startTestSuite(JUnitTest suite) throws BuildException { | |||||
public void startTestSuite(JUnitTest suite) { | |||||
if (output == null) { | |||||
return; // Quick return - no output do nothing. | |||||
} | |||||
String newLine = System.getProperty("line.separator"); | |||||
StringBuffer sb = new StringBuffer("Testsuite: "); | |||||
sb.append(suite.getName()); | |||||
sb.append(newLine); | |||||
output.write(sb.toString()); | |||||
output.flush(); | |||||
} | } | ||||
/** | /** | ||||
* The whole testsuite ended. | * The whole testsuite ended. | ||||
* @param suite the test suite | |||||
*/ | */ | ||||
public void endTestSuite(JUnitTest suite) throws BuildException { | |||||
public void endTestSuite(JUnitTest suite) { | |||||
String newLine = System.getProperty("line.separator"); | String newLine = System.getProperty("line.separator"); | ||||
StringBuffer sb = new StringBuffer("Testsuite: "); | |||||
sb.append(suite.getName()); | |||||
sb.append(newLine); | |||||
sb.append("Tests run: "); | |||||
StringBuffer sb = new StringBuffer("Tests run: "); | |||||
sb.append(suite.runCount()); | sb.append(suite.runCount()); | ||||
sb.append(", Failures: "); | sb.append(", Failures: "); | ||||
sb.append(suite.failureCount()); | sb.append(suite.failureCount()); | ||||
@@ -81,20 +81,34 @@ public class PlainJUnitResultFormatter implements JUnitResultFormatter { | |||||
} | } | ||||
/** | /** | ||||
* Empty. | |||||
* The whole testsuite started. | |||||
* @param suite the test suite | |||||
* @throws BuildException if unable to write the output | |||||
*/ | */ | ||||
public void startTestSuite(JUnitTest suite) { | |||||
public void startTestSuite(JUnitTest suite) throws BuildException { | |||||
if (out == null) { | |||||
return; // Quick return - no output do nothing. | |||||
} | |||||
String newLine = System.getProperty("line.separator"); | |||||
StringBuffer sb = new StringBuffer("Testsuite: "); | |||||
sb.append(suite.getName()); | |||||
sb.append(newLine); | |||||
try { | |||||
out.write(sb.toString().getBytes()); | |||||
out.flush(); | |||||
} catch (IOException ex) { | |||||
throw new BuildException("Unable to write output", ex); | |||||
} | |||||
} | } | ||||
/** | /** | ||||
* The whole testsuite ended. | * The whole testsuite ended. | ||||
* @param suite the test suite | |||||
* @throws BuildException if unable to write the output | |||||
*/ | */ | ||||
public void endTestSuite(JUnitTest suite) throws BuildException { | public void endTestSuite(JUnitTest suite) throws BuildException { | ||||
String newLine = System.getProperty("line.separator"); | String newLine = System.getProperty("line.separator"); | ||||
StringBuffer sb = new StringBuffer("Testsuite: "); | |||||
sb.append(suite.getName()); | |||||
sb.append(newLine); | |||||
sb.append("Tests run: "); | |||||
StringBuffer sb = new StringBuffer("Tests run: "); | |||||
sb.append(suite.runCount()); | sb.append(suite.runCount()); | ||||
sb.append(", Failures: "); | sb.append(", Failures: "); | ||||
sb.append(suite.failureCount()); | sb.append(suite.failureCount()); | ||||