private void fireStartTestSuite() { for (JUnitTaskMirror.JUnitResultFormatterMirror f : formatters) { ((JUnitResultFormatter) f).startTestSuite(junitTest); } }
public void startTest(Test test) { assert antf==null; try { antf = formatter.newInstance(); } catch (InstantiationException e) { throw new InstantiationError(e.getMessage()); } catch (IllegalAccessException e) { throw new IllegalAccessError(e.getMessage()); } String testName = getTestName(test); antTest = new JUnitTest(testName); antTest.setCounts(1,0,0); try { outStream = new FileOutputStream(new File(dir,getResultFileName(testName))); antf.setOutput(outStream); } catch (FileNotFoundException e) { throw new Error(e); } antf.startTestSuite(antTest); antf.startTest(test); outBuf.reset(); errBuf.reset(); startTime = System.currentTimeMillis(); }
/** {@inheritDoc}. */ @Override public void addVmExit(JUnitTest test, JUnitTaskMirror.JUnitResultFormatterMirror aFormatter, OutputStream out, String message, String testCase) { 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); }