FileDocCategorySizeDatePackage
JUnitTaskMirrorImpl.javaAPI DocApache Ant 1.703686Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs.optional.junit

JUnitTaskMirrorImpl

public final class JUnitTaskMirrorImpl extends Object implements JUnitTaskMirror
Implementation of the part of the junit task which can directly refer to junit.* classes. Public only to permit use of reflection; do not use directly.
see
JUnitTaskMirror
see
"bug #38799"
since
1.7

Fields Summary
private final JUnitTask
task
Constructors Summary
public JUnitTaskMirrorImpl(JUnitTask task)
Constructor.

param
task the junittask that uses this mirror.

        this.task = task;
    
Methods Summary
public voidaddVmExit(JUnitTest test, JUnitTaskMirror.JUnitResultFormatterMirror aFormatter, java.io.OutputStream out, java.lang.String message, java.lang.String testCase)
{@inheritDoc}.

        JUnitResultFormatter formatter = (JUnitResultFormatter) aFormatter;
        formatter.setOutput(out);
        formatter.startTestSuite(test);
        //the trick to integrating test output to the formatter, is to
        //create a special test class that asserts an error
        //and tell the formatter that it raised.
        TestCase t = new VmExitErrorTest(message, test, testCase);
        formatter.startTest(t);
        formatter.addError(t, new AssertionFailedError(message));
        formatter.endTestSuite(test);
    
public JUnitTaskMirror.JUnitTestRunnerMirrornewJUnitTestRunner(JUnitTest test, boolean haltOnError, boolean filterTrace, boolean haltOnFailure, boolean showOutput, boolean logTestListenerEvents, org.apache.tools.ant.AntClassLoader classLoader)
{@inheritDoc}.

        return new JUnitTestRunner(test, haltOnError, filterTrace, haltOnFailure,
                showOutput, logTestListenerEvents, classLoader);
    
public JUnitTaskMirror.SummaryJUnitResultFormatterMirrornewSummaryJUnitResultFormatter()
{@inheritDoc}.

        return new SummaryJUnitResultFormatter();