use of org.junit.runner.Result in project junit4 by junit-team.
the class MultiCategoryTest method runSuite.
/**
* This test is mentioned in {@code Categories} and any changes
* must be reflected.
*/
@Test
public void runSuite() {
// Targeting Test:
Result testResult = JUnitCore.runClasses(MultiCategorySuite.class);
assertThat("unexpected run count", testResult.getRunCount(), is(equalTo(2)));
assertThat("unexpected failure count", testResult.getFailureCount(), is(equalTo(0)));
assertThat("unexpected failure count", testResult.getIgnoreCount(), is(equalTo(0)));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class MultiCategoryTest method inheritanceAnyAll.
@Test
public void inheritanceAnyAll() {
//any included, all excluded
Result testResult = JUnitCore.runClasses(InheritanceAnyAll.class);
assertThat("unexpected run count", testResult.getRunCount(), is(equalTo(3)));
assertThat("unexpected failure count", testResult.getFailureCount(), is(equalTo(0)));
assertThat("unexpected failure count", testResult.getIgnoreCount(), is(equalTo(0)));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class MultiCategoryTest method inheritanceAnyIncluded.
@Test
public void inheritanceAnyIncluded() {
Result testResult = JUnitCore.runClasses(InheritanceAny.class);
assertThat("unexpected run count", testResult.getRunCount(), is(equalTo(3)));
assertThat("unexpected failure count", testResult.getFailureCount(), is(equalTo(0)));
assertThat("unexpected failure count", testResult.getIgnoreCount(), is(equalTo(0)));
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class AssumingInTheoriesTest method theoryMeansOnlyAssumeShouldFail.
@Test
public void theoryMeansOnlyAssumeShouldFail() throws InitializationError {
Result result = runTheoryClass(TheoryWithNoUnassumedParameters.class);
Assert.assertEquals(1, result.getFailureCount());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class ParentRunnerTest method assertClassHasFailureMessage.
private void assertClassHasFailureMessage(Class<?> klass, String message) {
JUnitCore junitCore = new JUnitCore();
Request request = Request.aClass(klass);
Result result = junitCore.run(request);
assertThat(result.getFailureCount(), is(1));
assertThat(result.getFailures().get(0).getMessage(), containsString(message));
}
Aggregations