@Test public void tells_the_names_of_the_tests() { toDemuxer.onTestFound(TEST_FILE_1, TestId.ROOT, "test name"); assertThat(demuxer.getTestName(TEST_FILE_1, TestId.ROOT), is("test name")); thrown.expect(IllegalArgumentException.class); thrown.expectMessage("name not found for Test1 and TestId(0)"); demuxer.getTestName(TEST_FILE_1, TestId.of(0)); }
public String getTestName(TestFile testFile, TestId testId) { String name = testNames.get(new GlobalTestId(testFile, testId)); if (name == null) { throw new IllegalArgumentException("name not found for " + testFile + " and " + testId); } return name; }
SuiteEventDemuxer implements MessageSender<Event<SuiteListener>> { public String getTestName(TestFile testFile, TestId testId) { String name = testNames.get(new GlobalTestId(testFile, testId)); if (name == null) { throw new IllegalArgumentException("name not found for " + testFile + " and " + testId); } return name; } }
SuiteEventDemuxer implements MessageSender<Event<SuiteListener>> { public String getTestName(TestFile testFile, TestId testId) { String name = testNames.get(new GlobalTestId(testFile, testId)); if (name == null) { throw new IllegalArgumentException("name not found for " + testFile + " and " + testId); } return name; }  }
SuiteEventDemuxer implements MessageSender<Event<SuiteListener>> { public String getTestName(TestFile testFile, TestId testId) { String name = testNames.get(new GlobalTestId(testFile, testId)); if (name == null) { throw new IllegalArgumentException("name not found for " + testFile + " and " + testId); } return name; }  @Override void send(Event<SuiteListener> message); boolean isSuiteFinished(); void visitAllRuns(RunVisitor visitor); void visitAllRuns(SuiteListener visitor); void visitRun(RunId runId, RunVisitor visitor); void visitRun(RunId runId, SuiteListener visitor); String getTestName(TestFile testFile, TestId testId); }
SuiteEventDemuxer implements MessageSender<Event<SuiteListener>> { public String getTestName(TestFile testFile, TestId testId) { String name = testNames.get(new GlobalTestId(testFile, testId)); if (name == null) { throw new IllegalArgumentException("name not found for " + testFile + " and " + testId); } return name; }  @Override void send(Event<SuiteListener> message); boolean isSuiteFinished(); void visitAllRuns(RunVisitor visitor); void visitAllRuns(SuiteListener visitor); void visitRun(RunId runId, RunVisitor visitor); void visitRun(RunId runId, SuiteListener visitor); String getTestName(TestFile testFile, TestId testId);  }