Package org.junit.tests

Examples of org.junit.tests.TestSystem


public class JUnitCoreTest {
    @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));
    }
View Full Code Here


        assertThat("runCount does not match", result.getRunCount(), is(1));
        assertThat("failureCount does not match", result.getFailureCount(), is(0));
    }

    private Result runJUnit(final String... args) {
        return jUnitCore.runMain(new TestSystem(), args);
    }
View Full Code Here

    private OutputStream results;

    @Override
    public void setUp() {
        runner = new JUnitCore();
        TestSystem system = new TestSystem();
        results = system.outContents();
        runner.addListener(new TextListener(system));
    }
View Full Code Here

  @Test public void successCausesExitCodeOf0() throws Exception {
    runClass(getClass().getName() + "$Succeed", 0);
  }

  private void runClass(String className, int returnCode) {
    TestSystem system= new TestSystem();
    JUnitCore.runMainAndExit(system, className);
    assertEquals(returnCode, system.fCode);
  }
View Full Code Here

  private TextListener listener;

  @Override
  public void setUp() {
    runner= new JUnitCore();
    TestSystem system= new TestSystem();
    results= system.outContents();
    listener= new TextListener(system);
    runner.addListener(listener);
  }
View Full Code Here

TOP

Related Classes of org.junit.tests.TestSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.