@Test public void does_not_capture_what_is_printed_outside_a_run() { stdout.print("before"); TestNotifier tn1 = notifier.fireTestStarted(TestId.ROOT); tn1.fireTestFinished(); stdout.print("after"); verify(listener, never()).onPrintedOut(Matchers.any(RunId.class), anyString()); }
@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);  }