org.junit.runners.BlockJUnit4ClassRunner seems to be the best choice. From the documentation:
"BlockJUnit4ClassRunner has advantages for writers of custom JUnit
runners that are slight changes to the default behavior"
Brett
--- In
junit@..., "eclipse.beginner" <eclipse.beginner@...> wrote:
>
> Hello,
>
> I want to write my own junit4 runner, to add my testListener.
>
> I want to extend the TestclassRunner, because this class contains a lot of functionality, which I want to have. And so I must only override the run(RunNotifier)methode to add my own testListener.
>
> But the problem is, that this class is in the org.junit.internal.runners package, which is be discouraged.
>
> When I now use this I get a classDefNotFoundException.
>
> Which not internal runner has a similar functionality?
> Or how can I also use my own listener (extends RunListener).
>