use of org.junit.platform.engine.TestDescriptor in project junit5 by junit-team.
the class VintageDiscovererTests method doesNotResolve.
private void doesNotResolve(LogRecordListener listener, Class<?> testClass) {
LauncherDiscoveryRequest request = request().selectors(selectClass(testClass)).build();
VintageDiscoverer discoverer = new VintageDiscoverer();
TestDescriptor testDescriptor = discoverer.discover(request, engineId());
assertThat(testDescriptor.getChildren()).isEmpty();
assertThat(listener.stream(VintageDiscoverer.class)).isEmpty();
}
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));
}
Aggregations