Search in sources :

Example 1 with ConfigurationParameters

use of org.junit.platform.engine.ConfigurationParameters in project junit5 by junit-team.

the class DefaultLauncherTests method withoutConfigurationParameters_launcherPassesEmptyConfigurationParametersIntoTheExecutionRequest.

@Test
void withoutConfigurationParameters_launcherPassesEmptyConfigurationParametersIntoTheExecutionRequest() {
    TestEngineSpy engine = new TestEngineSpy();
    DefaultLauncher launcher = createLauncher(engine);
    launcher.execute(request().build());
    ConfigurationParameters configurationParameters = engine.requestForExecution.getConfigurationParameters();
    assertThat(configurationParameters.get("key").isPresent()).isFalse();
    assertThat(configurationParameters.size()).isEqualTo(0);
}
Also used : ConfigurationParameters(org.junit.platform.engine.ConfigurationParameters) TestEngineSpy(org.junit.platform.engine.test.TestEngineSpy) Test(org.junit.jupiter.api.Test)

Example 2 with ConfigurationParameters

use of org.junit.platform.engine.ConfigurationParameters in project junit5 by junit-team.

the class LauncherConfigurationParametersTests method configFile.

@Test
void configFile() {
    ConfigurationParameters configParams = fromMap(emptyMap(), CONFIG_FILE_NAME);
    assertThat(configParams.get(KEY)).contains(CONFIG_FILE);
    assertThat(configParams.toString()).contains(CONFIG_FILE);
}
Also used : ConfigurationParameters(org.junit.platform.engine.ConfigurationParameters) Test(org.junit.jupiter.api.Test)

Example 3 with ConfigurationParameters

use of org.junit.platform.engine.ConfigurationParameters in project junit5 by junit-team.

the class LauncherConfigurationParametersTests method explicitConfigParam.

@Test
void explicitConfigParam() {
    ConfigurationParameters configParams = fromMap(singletonMap(KEY, CONFIG_PARAM));
    assertThat(configParams.get(KEY)).contains(CONFIG_PARAM);
    assertThat(configParams.toString()).contains(CONFIG_PARAM);
}
Also used : ConfigurationParameters(org.junit.platform.engine.ConfigurationParameters) Test(org.junit.jupiter.api.Test)

Example 4 with ConfigurationParameters

use of org.junit.platform.engine.ConfigurationParameters in project junit5 by junit-team.

the class LauncherConfigurationParametersTests method systemPropertyOverridesConfigFile.

@Test
void systemPropertyOverridesConfigFile() {
    System.setProperty(KEY, SYSTEM_PROPERTY);
    ConfigurationParameters configParams = fromMap(emptyMap(), CONFIG_FILE_NAME);
    assertThat(configParams.get(KEY)).contains(SYSTEM_PROPERTY);
    assertThat(configParams.toString()).contains(CONFIG_FILE);
}
Also used : ConfigurationParameters(org.junit.platform.engine.ConfigurationParameters) Test(org.junit.jupiter.api.Test)

Example 5 with ConfigurationParameters

use of org.junit.platform.engine.ConfigurationParameters in project junit5 by junit-team.

the class LauncherConfigurationParametersTests method explicitConfigParamOverridesConfigFile.

@Test
void explicitConfigParamOverridesConfigFile() {
    ConfigurationParameters configParams = fromMap(singletonMap(KEY, CONFIG_PARAM), CONFIG_FILE_NAME);
    assertThat(configParams.get(KEY)).contains(CONFIG_PARAM);
    assertThat(configParams.toString()).contains(CONFIG_PARAM);
    assertThat(configParams.toString()).doesNotContain(CONFIG_FILE);
}
Also used : ConfigurationParameters(org.junit.platform.engine.ConfigurationParameters) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigurationParameters (org.junit.platform.engine.ConfigurationParameters)16 Test (org.junit.jupiter.api.Test)14 Lifecycle (org.junit.jupiter.api.TestInstance.Lifecycle)3 TestInstanceLifecycleUtils.getDefaultTestInstanceLifecycle (org.junit.jupiter.engine.descriptor.TestInstanceLifecycleUtils.getDefaultTestInstanceLifecycle)3 TestInstanceLifecycleUtils.getTestInstanceLifecycle (org.junit.jupiter.engine.descriptor.TestInstanceLifecycleUtils.getTestInstanceLifecycle)3 TestEngineSpy (org.junit.platform.engine.test.TestEngineSpy)3 Method (java.lang.reflect.Method)1 TestFactory (org.junit.jupiter.api.TestFactory)1 ExtensionContext (org.junit.jupiter.api.extension.ExtensionContext)1 ClassExtensionContext (org.junit.jupiter.engine.descriptor.ClassExtensionContext)1 ClassTestDescriptor (org.junit.jupiter.engine.descriptor.ClassTestDescriptor)1 JupiterEngineDescriptor (org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor)1 JupiterEngineExtensionContext (org.junit.jupiter.engine.descriptor.JupiterEngineExtensionContext)1 MethodExtensionContext (org.junit.jupiter.engine.descriptor.MethodExtensionContext)1 NestedClassTestDescriptor (org.junit.jupiter.engine.descriptor.NestedClassTestDescriptor)1 TestMethodTestDescriptor (org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor)1 UniqueId (org.junit.platform.engine.UniqueId)1 LauncherDiscoveryRequest (org.junit.platform.launcher.LauncherDiscoveryRequest)1