Search in sources :

Example 1 with DiscoverySelectorResolver

use of org.junit.jupiter.engine.discovery.DiscoverySelectorResolver in project junit5 by junit-team.

the class JupiterTestEngine method discover.

@Override
public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) {
    JupiterEngineDescriptor engineDescriptor = new JupiterEngineDescriptor(uniqueId);
    new DiscoverySelectorResolver().resolveSelectors(discoveryRequest, engineDescriptor);
    return engineDescriptor;
}
Also used : DiscoverySelectorResolver(org.junit.jupiter.engine.discovery.DiscoverySelectorResolver) JupiterEngineDescriptor(org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor)

Example 2 with DiscoverySelectorResolver

use of org.junit.jupiter.engine.discovery.DiscoverySelectorResolver in project junit5 by junit-team.

the class JupiterIntegrationTests method resolve.

@Test
void resolve() {
    assumeTrue(getClass().getModule().isNamed(), "not running on the module-path");
    ModuleSelector selector = DiscoverySelectors.selectModule(getClass().getModule().getName());
    assertEquals(getClass().getModule().getName(), selector.getModuleName());
    EngineDescriptor engine = new JupiterEngineDescriptor(UniqueId.forEngine(JupiterTestEngine.ENGINE_ID));
    DiscoverySelectorResolver resolver = new DiscoverySelectorResolver();
    resolver.resolveSelectors(request().selectors(selector).build(), engine);
    // JupiterIntegrationTests.class
    assertEquals(1, engine.getChildren().size());
    // 5 test methods
    assertEquals(5, getOnlyElement(engine.getChildren()).getChildren().size());
}
Also used : ModuleSelector(org.junit.platform.engine.discovery.ModuleSelector) DiscoverySelectorResolver(org.junit.jupiter.engine.discovery.DiscoverySelectorResolver) EngineDescriptor(org.junit.platform.engine.support.descriptor.EngineDescriptor) JupiterEngineDescriptor(org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor) JupiterEngineDescriptor(org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor) Test(org.junit.jupiter.api.Test)

Aggregations

JupiterEngineDescriptor (org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor)2 DiscoverySelectorResolver (org.junit.jupiter.engine.discovery.DiscoverySelectorResolver)2 Test (org.junit.jupiter.api.Test)1 ModuleSelector (org.junit.platform.engine.discovery.ModuleSelector)1 EngineDescriptor (org.junit.platform.engine.support.descriptor.EngineDescriptor)1