View | Details | Raw Unified | Return to bug 35866
Collapse All | Expand All

(-)/tmp/apache-ant-1.6.5/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java (+23 lines)
Lines 19-27 Link Here
19
19
20
import java.io.IOException;
20
import java.io.IOException;
21
import java.io.OutputStream;
21
import java.io.OutputStream;
22
import java.io.PrintWriter;
22
import java.text.NumberFormat;
23
import java.text.NumberFormat;
24
23
import junit.framework.AssertionFailedError;
25
import junit.framework.AssertionFailedError;
24
import junit.framework.Test;
26
import junit.framework.Test;
27
25
import org.apache.tools.ant.BuildException;
28
import org.apache.tools.ant.BuildException;
26
29
27
/**
30
/**
Lines 64-73 Link Here
64
     */
67
     */
65
    public void endTest(Test test) {
68
    public void endTest(Test test) {
66
    }
69
    }
70
    
71
    /**
72
     * Formats the test failure for logging. Used by addFailure and addError
73
     */
74
    private void formatError(String type, Test test, Throwable throwable)
75
    {
76
        PrintWriter pw = new PrintWriter(out);
77
        pw.print(type);
78
        pw.print(": ");
79
        pw.print(test.getClass().getName());
80
        pw.print(" ");
81
        pw.print(JUnitVersionHelper.getTestCaseName(test));
82
        pw.print(": ");
83
        pw.print(throwable.toString());
84
        pw.println();
85
        pw.close();
86
    }
87
    
67
    /**
88
    /**
68
     * Empty
89
     * Empty
69
     */
90
     */
70
    public void addFailure(Test test, Throwable t) {
91
    public void addFailure(Test test, Throwable t) {
92
        formatError("FAILED", test, t);
71
    }
93
    }
72
    /**
94
    /**
73
     * Interface TestListener for JUnit > 3.4.
95
     * Interface TestListener for JUnit > 3.4.
Lines 81-86 Link Here
81
     * Empty
103
     * Empty
82
     */
104
     */
83
    public void addError(Test test, Throwable t) {
105
    public void addError(Test test, Throwable t) {
106
        formatError("ERROR", test, t);
84
    }
107
    }
85
108
86
    public void setOutput(OutputStream out) {
109
    public void setOutput(OutputStream out) {

Return to bug 35866