use of org.junit.platform.engine.TestDescriptor in project cucumber-jvm by cucumber.
the class FeatureResolverTest method scenario.
@Test
void scenario() {
TestDescriptor scenario = getScenario();
assertEquals("A scenario", scenario.getDisplayName());
assertEquals(asSet(create("FeatureTag"), create("ScenarioTag"), create("ResourceA"), create("ResourceAReadOnly")), scenario.getTags());
assertEquals(of(from(featurePath, from(5, 3))), scenario.getSource());
assertEquals(TEST, scenario.getType());
assertEquals(id.append("feature", featureSegmentValue).append("scenario", "5"), scenario.getUniqueId());
PickleDescriptor pickleDescriptor = (PickleDescriptor) scenario;
assertEquals(Optional.of("io.cucumber.junit.platform.engine"), pickleDescriptor.getPackage());
}
use of org.junit.platform.engine.TestDescriptor in project cucumber-jvm by cucumber.
the class FeatureResolverTest method feature.
@Test
void feature() {
TestDescriptor feature = getFeature();
assertEquals("A feature with scenario outlines", feature.getDisplayName());
assertEquals(emptySet(), feature.getTags());
assertEquals(of(from(featurePath)), feature.getSource());
assertEquals(CONTAINER, feature.getType());
assertEquals(id.append("feature", featureSegmentValue), feature.getUniqueId());
}
use of org.junit.platform.engine.TestDescriptor in project cucumber-jvm by cucumber.
the class FeatureResolverTest method longNames.
@Test
void longNames() {
configurationParameters = new MapConfigurationParameters(JUNIT_PLATFORM_NAMING_STRATEGY_PROPERTY_NAME, "long");
TestDescriptor example = getExample();
assertEquals("A feature with scenario outlines - A scenario outline - With some text - Example #1", example.getDisplayName());
}
use of org.junit.platform.engine.TestDescriptor in project cucumber-jvm by cucumber.
the class CucumberTestEngineTest method createExecutionContext.
@Test
void createExecutionContext() {
EngineExecutionListener listener = new EmptyEngineExecutionListener();
ConfigurationParameters configuration = new EmptyConfigurationParameters();
EngineDiscoveryRequest discoveryRequest = new EmptyEngineDiscoveryRequest(configuration);
UniqueId id = UniqueId.forEngine(engine.getId());
TestDescriptor testDescriptor = engine.discover(discoveryRequest, id);
ExecutionRequest execution = new ExecutionRequest(testDescriptor, listener, configuration);
assertNotNull(engine.createExecutionContext(execution));
}
use of org.junit.platform.engine.TestDescriptor in project cucumber-jvm by cucumber.
the class DiscoverySelectorResolverTest method resolveRequestWithClasspathResourceSelectorAndFilePosition.
@Test
void resolveRequestWithClasspathResourceSelectorAndFilePosition() {
String feature = "io/cucumber/junit/platform/engine/rule.feature";
FilePosition line = FilePosition.from(5);
DiscoverySelector resource = selectClasspathResource(feature, line);
EngineDiscoveryRequest discoveryRequest = new SelectorRequest(resource);
resolver.resolveSelectors(discoveryRequest, testDescriptor);
assertEquals(1L, testDescriptor.getDescendants().stream().filter(TestDescriptor::isTest).count());
}
Aggregations