With jUnit3 I'd try subclassing Test
and overwrite the run
method. That would provide me with access to the TestResult
instance. Something like this:
public class MyTest extends Test {
@Overwrite
public void run(TestResult result) {
super.run(result);
doSomethingWithResults(result);
}
// ...
}
With jUnit4 I'd look into implementing a TestRunner (based on the standard runner). It sounds difficult but actually isn't. Subclass the default one and simply add the @RunWith
annotation to use your own runner (that can do something with the results)