@Test public void error_in_fireFailure_will_not_lose_the_original_test_failure_being_reported() { TestNotifier tn1 = notifier.fireTestStarted(TestId.ROOT); TestNotifier tn2 = notifier.fireTestStarted(TestId.of(0)); Exception originalTestFailure = new Exception("original test failure"); Exception thrownException = catchException(() -> tn1.fireFailure(originalTestFailure)); assertThat("chained exception", thrownException, allOf(instanceOf(IllegalStateException.class), hasCause(equalTo(originalTestFailure)))); }
@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);  }