use of org.junit.runner.Result in project junit4 by junit-team.
the class StopwatchTest method succeeded.
@Test
public void succeeded() {
Result result = runTest(SuccessfulTest.class);
assertEquals(0, result.getFailureCount());
assertThat(record.name, is("successfulTest"));
assertThat(record.name, is(finishedRecord.name));
assertThat(record.status, is(TestStatus.SUCCEEDED));
assertTrue("timeSpent > 0", record.duration > 0);
assertThat(record.duration, is(finishedRecord.duration));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class StopwatchTest method skipped.
@Test
public void skipped() {
Result result = runTest(SkippedTest.class);
assertEquals(0, result.getFailureCount());
assertThat(record.name, is("skippedTest"));
assertThat(record.name, is(finishedRecord.name));
assertThat(record.status, is(TestStatus.SKIPPED));
assertTrue("timeSpent > 0", record.duration > 0);
assertThat(record.duration, is(finishedRecord.duration));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class JUnit4ClassRunnerTest method runWithOldJUnit4ClassRunner.
@Test
public void runWithOldJUnit4ClassRunner() {
Result result = JUnitCore.runClasses(Example.class);
assertThat(result.getRunCount(), is(2));
assertThat(result.getFailureCount(), is(1));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class RuleChainTest method whenRuleChainHasNullRuleTheStacktraceShouldPointToIt.
@Test
public void whenRuleChainHasNullRuleTheStacktraceShouldPointToIt() {
Result result = JUnitCore.runClasses(RuleChainWithNullRules.class);
assertThat(result.getFailures().size(), equalTo(1));
String stacktrace = Throwables.getStacktrace(result.getFailures().get(0).getException());
assertThat(stacktrace, containsString("\tat org.junit.rules.RuleChainTest$RuleChainWithNullRules.<init>(RuleChainTest.java:"));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class AnnotationTest method testRunAllAfterClassesRegardless.
public void testRunAllAfterClassesRegardless() {
log = "";
JUnitCore core = new JUnitCore();
Result result = core.run(RunAllAfterClassesRegardless.class);
assertTrue(log.contains("one"));
assertTrue(log.contains("two"));
assertEquals(2, result.getFailureCount());
}
Aggregations