use of org.junit.runner.Result in project junit4 by junit-team.
the class AnnotationTest method testRunFailure.
public void testRunFailure() throws Exception {
JUnitCore runner = new JUnitCore();
Result result = runner.run(FailureTest.class);
assertEquals(1, result.getRunCount());
assertEquals(1, result.getFailureCount());
assertEquals(AssertionError.class, result.getFailures().get(0).getException().getClass());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class MaxStarterTest method correctErrorFromMalformedTest.
@Test
public void correctErrorFromMalformedTest() {
Request request = Request.aClass(MalformedJUnit38TestMethod.class);
JUnitCore core = new JUnitCore();
Request sorted = fMax.sortRequest(request);
Runner runner = sorted.getRunner();
Result result = core.run(runner);
Failure failure = result.getFailures().get(0);
assertThat(failure.toString(), containsString("MalformedJUnit38TestMethod"));
assertThat(failure.toString(), containsString("testNothing"));
assertThat(failure.toString(), containsString("isn't public"));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class MaxStarterTest method correctErrorFromHalfMalformedTest.
@Test
public void correctErrorFromHalfMalformedTest() {
Request request = Request.aClass(HalfMalformedJUnit38TestMethod.class);
JUnitCore core = new JUnitCore();
Request sorted = fMax.sortRequest(request);
Runner runner = sorted.getRunner();
Result result = core.run(runner);
Failure failure = result.getFailures().get(0);
assertThat(failure.toString(), containsString("MalformedJUnit38TestMethod"));
assertThat(failure.toString(), containsString("testNothing"));
assertThat(failure.toString(), containsString("isn't public"));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class MaxStarterTest method junit3TestsAreRunOnce.
@Test
public void junit3TestsAreRunOnce() throws Exception {
Result result = fMax.run(Request.aClass(TwoOldTests.class), new JUnitCore());
assertEquals(2, result.getRunCount());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class MaxStarterTest method testsAreOnlyIncludedOnceWhenExpandingForSorting.
@Test
public void testsAreOnlyIncludedOnceWhenExpandingForSorting() throws Exception {
Result result = fMax.run(Request.aClass(TwoTests.class));
assertEquals(2, result.getRunCount());
}
Aggregations