use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class ClassLevelMethodsWithIgnoredTestsTest method beforeClassShouldNotRunWhenAllTestsAreFiltered.
@Test
public void beforeClassShouldNotRunWhenAllTestsAreFiltered() {
Result result = new JUnitCore().run(Request.classes(BeforeClassWithFilteredTest.class, HasUnfilteredTest.class).filterWith(CategoryFilter.exclude(FilteredTests.class)));
analyseResult(result, "BeforeClass should not have been executed because the test method is filtered!");
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class AnnotationTest method testOldTest.
public void testOldTest() throws Exception {
JUnitCore runner = new JUnitCore();
runner.run(OldTest.class);
assertTrue(run);
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class AnnotationTest method testRunAllAfterClasses.
public void testRunAllAfterClasses() {
log = "";
JUnitCore core = new JUnitCore();
core.run(RunAllAfterClasses.class);
assertTrue(log.contains("one"));
assertTrue(log.contains("two"));
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class AnnotationTest method testRunFailure.
public void testRunFailure() throws Exception {
JUnitCore runner = new JUnitCore();
Result result = runner.run(FailureTest.class);
assertEquals(1, result.getRunCount());
assertEquals(1, result.getFailureCount());
assertEquals(AssertionError.class, result.getFailures().get(0).getException().getClass());
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class AnnotationTest method testTestInheritance.
public void testTestInheritance() throws Exception {
log = "";
JUnitCore core = new JUnitCore();
core.run(SubTest.class);
// The order in which the test methods are called is unspecified
assertTrue(log.contains("Sub"));
assertTrue(log.contains("Two"));
assertFalse(log.contains("Super"));
}
Aggregations