Search in sources :

Example 1 with FilePosition

use of org.junit.platform.engine.discovery.FilePosition 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());
}
Also used : FilePosition(org.junit.platform.engine.discovery.FilePosition) DiscoverySelector(org.junit.platform.engine.DiscoverySelector) EngineDiscoveryRequest(org.junit.platform.engine.EngineDiscoveryRequest) TestDescriptor(org.junit.platform.engine.TestDescriptor) Test(org.junit.jupiter.api.Test)

Example 2 with FilePosition

use of org.junit.platform.engine.discovery.FilePosition in project cucumber-jvm by cucumber.

the class DiscoverySelectorResolverTest method resolveRequestWithFileSelectorAndPosition.

@Test
void resolveRequestWithFileSelectorAndPosition() {
    String feature = "src/test/resources/io/cucumber/junit/platform/engine/rule.feature";
    FilePosition line = FilePosition.from(5);
    DiscoverySelector resource = selectFile(feature, line);
    EngineDiscoveryRequest discoveryRequest = new SelectorRequest(resource);
    resolver.resolveSelectors(discoveryRequest, testDescriptor);
    assertEquals(1L, testDescriptor.getDescendants().stream().filter(TestDescriptor::isTest).count());
}
Also used : FilePosition(org.junit.platform.engine.discovery.FilePosition) DiscoverySelector(org.junit.platform.engine.DiscoverySelector) EngineDiscoveryRequest(org.junit.platform.engine.EngineDiscoveryRequest) TestDescriptor(org.junit.platform.engine.TestDescriptor) Test(org.junit.jupiter.api.Test)

Example 3 with FilePosition

use of org.junit.platform.engine.discovery.FilePosition in project cucumber-jvm by cucumber.

the class DiscoverySelectorResolverTest method resolveRequestWithClasspathResourceSelectorAndFilePositionOfContainer.

@Test
void resolveRequestWithClasspathResourceSelectorAndFilePositionOfContainer() {
    String feature = "io/cucumber/junit/platform/engine/rule.feature";
    FilePosition line = FilePosition.from(3);
    DiscoverySelector resource = selectClasspathResource(feature, line);
    EngineDiscoveryRequest discoveryRequest = new SelectorRequest(resource);
    resolver.resolveSelectors(discoveryRequest, testDescriptor);
    assertEquals(2L, testDescriptor.getDescendants().stream().filter(TestDescriptor::isTest).count());
}
Also used : FilePosition(org.junit.platform.engine.discovery.FilePosition) DiscoverySelector(org.junit.platform.engine.DiscoverySelector) EngineDiscoveryRequest(org.junit.platform.engine.EngineDiscoveryRequest) TestDescriptor(org.junit.platform.engine.TestDescriptor) Test(org.junit.jupiter.api.Test)

Example 4 with FilePosition

use of org.junit.platform.engine.discovery.FilePosition in project cucumber-jvm by cucumber.

the class DiscoverySelectorResolverTest method resolveRequestWithFileSelectorAndPositionOfContainer.

@Test
void resolveRequestWithFileSelectorAndPositionOfContainer() {
    String feature = "src/test/resources/io/cucumber/junit/platform/engine/rule.feature";
    FilePosition line = FilePosition.from(3);
    DiscoverySelector resource = selectFile(feature, line);
    EngineDiscoveryRequest discoveryRequest = new SelectorRequest(resource);
    resolver.resolveSelectors(discoveryRequest, testDescriptor);
    assertEquals(2L, testDescriptor.getDescendants().stream().filter(TestDescriptor::isTest).count());
}
Also used : FilePosition(org.junit.platform.engine.discovery.FilePosition) DiscoverySelector(org.junit.platform.engine.DiscoverySelector) EngineDiscoveryRequest(org.junit.platform.engine.EngineDiscoveryRequest) TestDescriptor(org.junit.platform.engine.TestDescriptor) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)4 DiscoverySelector (org.junit.platform.engine.DiscoverySelector)4 EngineDiscoveryRequest (org.junit.platform.engine.EngineDiscoveryRequest)4 TestDescriptor (org.junit.platform.engine.TestDescriptor)4 FilePosition (org.junit.platform.engine.discovery.FilePosition)4