Skip to content

"After all tests in all containers" #3318

Answered by io7m
io7m asked this question in Q&A
Discussion options

You must be logged in to vote

Answering my own question: Register a LauncherSessionListener in the extension (from the JUnit Platform). The obtained launcher session can be used to register a TestExecutionListener, which has its testPlanExecutionFinished method called when all tests in all containers have finished.

Essentially:

public final class MiscExtension
  implements LauncherSessionListener,
  TestExecutionListener
{
  public MiscExtension()
  {

  }

  @Override
  public void launcherSessionOpened(
    final LauncherSession session)
  {
    session.getLauncher()
      .registerTestExecutionListeners(this);
  }

  @Override
  public void launcherSessionClosed(
    final LauncherSession session)
  {

  }

  @Over…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by io7m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant