Author: stevel Date: Fri Sep 8 07:22:58 2006 New Revision: 441510 URL: http://svn.apache.org/viewvc?view=rev&rev=441510 Log: use a buffered file in reporting. Added a note to tell people not to switch to ClasspathUtils because the forking junit tests promptly fail.
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java?view=diff&rev=441510&r1=441509&r2=441510 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java Fri Sep 8 07:22:58 2006 @@ -21,6 +21,8 @@ import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; +import java.io.BufferedOutputStream; + import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.EnumeratedAttribute; @@ -202,7 +204,9 @@ if (classname == null) { throw new BuildException("you must specify type or classname"); } - + //although this code appears to duplicate that of ClasspathUtils.newInstance, + //we cannot use that because this formatter may run in a forked process, + //without that class. Class f = null; try { if (loader == null) { @@ -230,12 +234,11 @@ + " is not a JUnitResultFormatter"); } JUnitTaskMirror.JUnitResultFormatterMirror r = (JUnitTaskMirror.JUnitResultFormatterMirror) o; - if (useFile && outFile != null) { try { - out = new FileOutputStream(outFile); + out = new BufferedOutputStream(new FileOutputStream(outFile)); } catch (java.io.IOException e) { - throw new BuildException(e); + throw new BuildException("Unable to open file " + outFile, e); } } r.setOutput(out); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]