}
}
public void testErrorAdapted() {
ByteArrayOutputStream output= new ByteArrayOutputStream();
TestRunner runner= new TestRunner(new TestResultPrinter(
new PrintStream(output)));
String expected= expected(new String[] { ".E", "Time: 0",
"Errors here", "", "FAILURES!!!",
"Tests run: 1, Failures: 0, Errors: 1", "" });
ResultPrinter printer= new TestResultPrinter(new PrintStream(output)) {
@Override
public void printErrors(TestResult result) {
getWriter().println("Errors here");
}
};
runner.setPrinter(printer);
runner.doRun(new JUnit4TestAdapter(ATest.class));
assertEquals(expected, output.toString());
}