use of org.junit.platform.engine.support.descriptor.AbstractTestDescriptor in project junit5 by junit-team.
the class TestPlanTests method doesNotContainTestsForEmptyContainers.
@Test
void doesNotContainTestsForEmptyContainers() {
engineDescriptor.addChild(new AbstractTestDescriptor(engineDescriptor.getUniqueId().append("test", "bar"), "Bar") {
@Override
public Type getType() {
return Type.CONTAINER;
}
});
TestPlan testPlan = TestPlan.from(singleton(engineDescriptor));
assertThat(testPlan.containsTests()).as("contains tests").isFalse();
}
use of org.junit.platform.engine.support.descriptor.AbstractTestDescriptor in project junit5 by junit-team.
the class TestPlanTests method containsTestsForTests.
@Test
void containsTestsForTests() {
engineDescriptor.addChild(new AbstractTestDescriptor(engineDescriptor.getUniqueId().append("test", "bar"), "Bar") {
@Override
public Type getType() {
return Type.TEST;
}
});
TestPlan testPlan = TestPlan.from(singleton(engineDescriptor));
assertThat(testPlan.containsTests()).as("contains tests").isTrue();
}
use of org.junit.platform.engine.support.descriptor.AbstractTestDescriptor in project junit5 by junit-team.
the class TestTemplateTestDescriptorTests method inheritsTagsFromParent.
@Test
void inheritsTagsFromParent() throws Exception {
UniqueId rootUniqueId = UniqueId.root("segment", "template");
UniqueId parentUniqueId = rootUniqueId.append("class", "myClass");
AbstractTestDescriptor parent = containerTestDescriptorWithTags(parentUniqueId, singleton(TestTag.create("foo")));
TestTemplateTestDescriptor testDescriptor = new TestTemplateTestDescriptor(parentUniqueId.append("tmp", "testTemplate()"), MyTestCase.class, MyTestCase.class.getDeclaredMethod("testTemplate"));
parent.addChild(testDescriptor);
assertThat(testDescriptor.getTags()).containsExactlyInAnyOrder(TestTag.create("foo"), TestTag.create("bar"), TestTag.create("baz"));
}
use of org.junit.platform.engine.support.descriptor.AbstractTestDescriptor in project junit5 by junit-team.
the class TestPlanTests method containsTestsForContainersThatMayRegisterTests.
@Test
void containsTestsForContainersThatMayRegisterTests() {
engineDescriptor.addChild(new AbstractTestDescriptor(engineDescriptor.getUniqueId().append("test", "bar"), "Bar") {
@Override
public Type getType() {
return Type.CONTAINER;
}
@Override
public boolean mayRegisterTests() {
return true;
}
});
TestPlan testPlan = TestPlan.from(singleton(engineDescriptor));
assertThat(testPlan.containsTests()).as("contains tests").isTrue();
}
Aggregations