Search in sources :

Example 1 with ModuleSelector

use of org.junit.platform.engine.discovery.ModuleSelector 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

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