use of org.junit.runner.Description in project junit4 by junit-team.
the class SingleMethodTest method eliminateUnnecessaryTreeBranches.
@Test
public void eliminateUnnecessaryTreeBranches() throws Exception {
Runner runner = Request.aClass(OneTwoSuite.class).filterWith(Description.createTestDescription(TestOne.class, "a")).getRunner();
Description description = runner.getDescription();
assertEquals(1, description.getChildren().size());
}
use of org.junit.runner.Description in project junit4 by junit-team.
the class ParentRunnerClassLoaderTest method testDescriptionContainCorrectTestClass.
@Test
public void testDescriptionContainCorrectTestClass() throws Exception {
Class<?> testClassWithOwnClassLoader = wrapToClassLoader(TestWithClassRule.class);
ParentRunner<?> runner = new BlockJUnit4ClassRunner(testClassWithOwnClassLoader);
Description description = runner.getDescription();
assertEquals("ParentRunner accept already instantiate Class<?> with tests, if we lost it instance, and will " + "use Class.forName we can not find test class again, because tests can be " + "located in different ClassLoader", description.getTestClass(), testClassWithOwnClassLoader);
}
use of org.junit.runner.Description in project junit4 by junit-team.
the class JUnit38SortingTest method preferRecentlyFailed38Test.
@Test
public void preferRecentlyFailed38Test() {
Request request = Request.classes(JUnit4Test.class, JUnit38Test.class);
fMax.run(request);
List<Description> tests = fMax.sortedLeavesForTest(request);
Description dontSucceed = Description.createTestDescription(JUnit38Test.class, "testFails");
assertEquals(dontSucceed, tests.get(0));
}
use of org.junit.runner.Description in project junit4 by junit-team.
the class MaxStarterTest method preferFast.
@Test
public void preferFast() {
Request request = Request.aClass(TwoUnEqualTests.class);
fMax.run(request);
Description thing = fMax.sortedLeavesForTest(request).get(1);
assertEquals(Description.createTestDescription(TwoUnEqualTests.class, "slow"), thing);
}
use of org.junit.runner.Description in project junit4 by junit-team.
the class MaxStarterTest method preferRecentlyFailed.
@Test
public void preferRecentlyFailed() {
Request request = Request.aClass(TwoTests.class);
fMax.run(request);
List<Description> tests = fMax.sortedLeavesForTest(request);
Description dontSucceed = Description.createTestDescription(TwoTests.class, "dontSucceed");
assertEquals(dontSucceed, tests.get(0));
}
Aggregations