use of org.junit.runner.Result in project junit4 by junit-team.
the class MethodRulesTest method ignoreNonRules.
@Test
public void ignoreNonRules() {
Result result = JUnitCore.runClasses(NoRulesTest.class);
assertEquals(0, result.getFailureCount());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class CategoryTest method oneRunnableOthersAvoided.
@Test
public void oneRunnableOthersAvoided() {
Result result = JUnitCore.runClasses(IncludedExcludedSameSuite.class);
assertEquals(1, result.getRunCount());
assertTrue(result.wasSuccessful());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class CategoryTest method testCountWithMultipleExcludeFilter.
@Test
@SuppressWarnings("unchecked")
public void testCountWithMultipleExcludeFilter() throws Throwable {
Set<Class<?>> exclusions = new HashSet<Class<?>>(2);
Collections.addAll(exclusions, SlowTests.class, FastTests.class);
CategoryFilter exclude = CategoryFilter.categoryFilter(true, null, true, exclusions);
Request baseRequest = Request.aClass(OneOfEach.class);
Result result = new JUnitCore().run(baseRequest.filterWith(exclude));
assertTrue(result.wasSuccessful());
assertEquals(1, result.getRunCount());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class CategoryTest method testCountOnAWithoutSlowTests.
@Test
public void testCountOnAWithoutSlowTests() {
Result result = JUnitCore.runClasses(SomeAreSlowSuite.class);
assertThat(testResult(SomeAreSlowSuite.class), isSuccessful());
assertEquals(2, result.getRunCount());
assertTrue(result.wasSuccessful());
}
use of org.junit.runner.Result in project junit4 by junit-team.
the class CategoryTest method testCountWithExplicitIncludeFilter.
@Test
public void testCountWithExplicitIncludeFilter() throws Throwable {
CategoryFilter include = CategoryFilter.include(SlowTests.class);
Request baseRequest = Request.aClass(TestSuiteWithNoCategories.class);
Result result = new JUnitCore().run(baseRequest.filterWith(include));
assertTrue(result.wasSuccessful());
assertEquals(2, result.getRunCount());
}
Aggregations