@Override public void setUp() { runner = new JUnitCore(); TestSystem system = new TestSystem(); results = system.outContents(); runner.addListener(new TextListener(system)); }
@Test public void shouldAddFailuresToResult() { JUnitCore jUnitCore = new JUnitCore(); Result result = jUnitCore.runMain(new TestSystem(), "NonExistentTest"); assertThat(result.getFailureCount(), is(1)); assertThat(result.getFailures().get(0).getException(), instanceOf(IllegalArgumentException.class)); }
private Result runJUnit(final String... args) { return jUnitCore.runMain(new TestSystem(), args); }