@Test public void notifies_about_the_beginning_and_end_of_a_run() { TestNotifier tn1 = notifier.fireTestStarted(TestId.ROOT); TestNotifier tn2 = notifier.fireTestStarted(TestId.of(0)); tn2.fireTestFinished(); tn1.fireTestFinished(); InOrder inOrder = inOrder(listener); inOrder.verify(listener).onRunStarted(FIRST_RUN_ID); inOrder.verify(listener).onTestStarted(FIRST_RUN_ID, TestId.ROOT); inOrder.verify(listener).onTestStarted(FIRST_RUN_ID, TestId.of(0)); inOrder.verify(listener).onTestFinished(FIRST_RUN_ID, TestId.of(0)); inOrder.verify(listener).onTestFinished(FIRST_RUN_ID, TestId.ROOT); inOrder.verify(listener).onRunFinished(FIRST_RUN_ID); verifyNoMoreInteractions(listener); }
@Override public TestNotifier fireTestStarted(TestId testId) { Run run = this.currentRun.get(); if (run == null || run.isRunFinished()) { run = new Run(listener, outputCapturer, runIdSequence.nextRunId()); run.fireRunStarted(); this.currentRun.set(run); } return run.fireTestStarted(testId); }
ThreadBoundSuiteNotifier implements SuiteNotifier { @Override public TestNotifier fireTestStarted(TestId testId) { Run run = this.currentRun.get(); if (run == null || run.isRunFinished()) { run = new Run(listener, outputCapturer, runIdSequence.nextRunId()); run.fireRunStarted(); this.currentRun.set(run); } return run.fireTestStarted(testId); } }
ThreadBoundSuiteNotifier implements SuiteNotifier { @Override public TestNotifier fireTestStarted(TestId testId) { Run run = this.currentRun.get(); if (run == null || run.isRunFinished()) { run = new Run(listener, outputCapturer, runIdSequence.nextRunId()); run.fireRunStarted(); this.currentRun.set(run); } return run.fireTestStarted(testId); } ThreadBoundSuiteNotifier(ActorRef<RunListener> listener, RunIdSequence runIdSequence, OutputCapturer outputCapturer); }
ThreadBoundSuiteNotifier implements SuiteNotifier { @Override public TestNotifier fireTestStarted(TestId testId) { Run run = this.currentRun.get(); if (run == null || run.isRunFinished()) { run = new Run(listener, outputCapturer, runIdSequence.nextRunId()); run.fireRunStarted(); this.currentRun.set(run); } return run.fireTestStarted(testId); } ThreadBoundSuiteNotifier(ActorRef<RunListener> listener, RunIdSequence runIdSequence, OutputCapturer outputCapturer); @Override void fireTestFound(TestId testId, String name); @Override TestNotifier fireTestStarted(TestId testId); @Override void fireInternalError(String message, Throwable cause); }
ThreadBoundSuiteNotifier implements SuiteNotifier { @Override public TestNotifier fireTestStarted(TestId testId) { Run run = this.currentRun.get(); if (run == null || run.isRunFinished()) { run = new Run(listener, outputCapturer, runIdSequence.nextRunId()); run.fireRunStarted(); this.currentRun.set(run); } return run.fireTestStarted(testId); } ThreadBoundSuiteNotifier(ActorRef<RunListener> listener, RunIdSequence runIdSequence, OutputCapturer outputCapturer); @Override void fireTestFound(TestId testId, String name); @Override TestNotifier fireTestStarted(TestId testId); @Override void fireInternalError(String message, Throwable cause);  }