use of org.junit.runner.Result in project junit4 by junit-team.
the class ParallelMethodTest method testsRunInParallel.
@Test
public void testsRunInParallel() {
Result result = JUnitCore.runClasses(ParallelComputer.methods(), Example.class);
assertTrue(result.wasSuccessful());
assertNotNull(fOne);
assertNotNull(fTwo);
assertThat(fOne, is(not(fTwo)));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class TestRuleTest method onFailure.
@Test
public void onFailure() {
log = "";
Result result = JUnitCore.runClasses(OnFailureTest.class);
assertEquals(String.format("nothing(%s) AssertionError", OnFailureTest.class.getName()), log);
assertEquals(1, result.getFailureCount());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class TestRuleTest method methodIgnoreNonRules.
@Test
public void methodIgnoreNonRules() {
Result result = JUnitCore.runClasses(MethodNoRulesTest.class);
assertEquals(0, result.getFailureCount());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class TimeoutRuleTest method nullTimeUnit.
@Test
public void nullTimeUnit() {
Result result = JUnitCore.runClasses(HasNullTimeUnit.class);
assertEquals(1, result.getFailureCount());
Failure failure = result.getFailures().get(0);
assertThat(failure.getException().getMessage(), containsString("Invalid parameters for Timeout"));
Throwable cause = failure.getException().getCause();
assertThat(cause.getMessage(), containsString("TimeUnit cannot be null"));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class StopwatchTest method runtimeDuringTestShouldReturnTimeSinceStart.
@Test
public void runtimeDuringTestShouldReturnTimeSinceStart() {
Result result = runTest(DurationDuringTestTest.class);
assertTrue(result.wasSuccessful());
}
Aggregations