How to implement RunListener a JUnit Listener example

You may also like...

  • Nejc Dezelak

    Great tutorial!
    Note that notification) is actually the main execution method and is called only once so make sure you attach a Listener before calling it.

  • Buzz2Buzz

    Great, thanks.
    But I’ve got a question, this way it produces a report for each annotated class. How to avoid this and only have one report ?

  • Arjen den Hartog


    Why is the “testRunStarted” method not called?

    I am currently creating integration tests with JUnit. I want to setup the environment (e.g. init database with some data) in the

    testRunStarted() method.