use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class ExpectedExceptionTest method runTestAndVerifyResult.
@Test
public void runTestAndVerifyResult() {
EventCollector collector = new EventCollector();
JUnitCore core = new JUnitCore();
core.addListener(collector);
core.run(classUnderTest);
assertThat(collector, matcher);
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class CategoriesAndParameterizedTest method doesNotRunTestsWithoutCategory.
@Test
public void doesNotRunTestsWithoutCategory() {
Result result = new JUnitCore().run(SuiteWithParameterizedTestWithoutCategory.class);
assertEquals(1, result.getRunCount());
assertEquals(0, result.getFailureCount());
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class CategoriesAndParameterizedTest method runsTestsWithoutCategory.
@Test
public void runsTestsWithoutCategory() {
Result result = new JUnitCore().run(SuiteWithParameterizedTestWithCategory.class);
assertEquals(2, result.getRunCount());
assertEquals(0, result.getFailureCount());
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class CategoryTest method testCountWithExplicitExcludeFilter_usingConstructor.
@Test
public void testCountWithExplicitExcludeFilter_usingConstructor() throws Throwable {
CategoryFilter include = new CategoryFilter(null, SlowTests.class);
Request baseRequest = Request.aClass(TestSuiteWithNoCategories.class);
Result result = new JUnitCore().run(baseRequest.filterWith(include));
assertEquals(2, result.getFailureCount());
assertEquals(2, result.getRunCount());
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class CategoryTest method testCountWithMultipleIncludeFilter.
@Test
public void testCountWithMultipleIncludeFilter() throws Throwable {
CategoryFilter exclude = CategoryFilter.include(true, SlowTests.class, FastTests.class);
Request baseRequest = Request.aClass(OneOfEach.class);
Result result = new JUnitCore().run(baseRequest.filterWith(exclude));
assertTrue(result.wasSuccessful());
assertEquals(2, result.getRunCount());
}
Aggregations