Search in sources :

Example 1 with TestSystem

use of org.junit.tests.TestSystem in project junit4 by junit-team.

the class JUnitCoreTest method shouldAddFailuresToResult.

@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));
}
Also used : TestSystem(org.junit.tests.TestSystem) Test(org.junit.Test)

Example 2 with TestSystem

use of org.junit.tests.TestSystem in project junit4 by junit-team.

the class TextListenerTest method setUp.

@Override
public void setUp() {
    runner = new JUnitCore();
    TestSystem system = new TestSystem();
    results = system.outContents();
    runner.addListener(new TextListener(system));
}
Also used : JUnitCore(org.junit.runner.JUnitCore) TestSystem(org.junit.tests.TestSystem) TextListener(org.junit.internal.TextListener)

Aggregations

TestSystem (org.junit.tests.TestSystem)2 Test (org.junit.Test)1 TextListener (org.junit.internal.TextListener)1 JUnitCore (org.junit.runner.JUnitCore)1