Browse Source

formatters need to know about VM exits, no matter whether they use a file or not. PR 37312.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@689104 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
2ef2968240
2 changed files with 22 additions and 9 deletions
  1. +4
    -0
      WHATSNEW
  2. +18
    -9
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

+ 4
- 0
WHATSNEW View File

@@ -176,6 +176,10 @@ Fixed bugs:
working directory.
Bugzilla Report 45607.

* only <formatter>s that logged to a file were notified if forked VM
crashed or a timeout occured in <junit>.
Bugzilla Report 37312.

Other changes:
--------------



+ 18
- 9
src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java View File

@@ -1553,15 +1553,24 @@ public class JUnitTask extends Task {
test.setProperties(getProject().getProperties());
for (int i = 0; i < feArray.length; i++) {
FormatterElement fe = feArray[i];
File outFile = getOutput(fe, test);
JUnitTaskMirror.JUnitResultFormatterMirror formatter =
fe.createFormatter(classLoader);
if (outFile != null && formatter != null) {
try {
OutputStream out = new FileOutputStream(outFile);
delegate.addVmExit(test, formatter, out, message, testCase);
} catch (IOException e) {
// ignore
if (fe.shouldUse(this)) {
JUnitTaskMirror.JUnitResultFormatterMirror formatter =
fe.createFormatter(classLoader);
if (formatter != null) {
OutputStream out = null;
File outFile = getOutput(fe, test);
if (outFile != null) {
try {
out = new FileOutputStream(outFile);
} catch (IOException e) {
// ignore
}
}
if (out == null) {
out = getDefaultOutput();
}
delegate.addVmExit(test, formatter, out, message,
testCase);
}
}
}


Loading…
Cancel
Save