[
https://issues.apache.org/jira/browse/SUREFIRE-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17860618#comment-17860618
]
Michael Osipov commented on SUREFIRE-2203:
------------------------------------------
OK, I believe there is no bug, but likely bad documentation in JUnit.
[[email protected]], [~marcphilipp], maybe you both can confirm the behavior:
{{LauncherFactory#openSession(LauncherConfig)}} does
{code:java}
LauncherConfigurationParameters configurationParameters =
LauncherConfigurationParameters.builder().build();
return new
DefaultLauncherSession(collectLauncherInterceptors(configurationParameters),
() -> createLauncherSessionListener(config), () ->
createDefaultLauncher(config, configurationParameters));
{code}
but does not use the parameters on {{LauncherConfig}}.
{{LauncherConfigurationParameters.builder().build();}} is
{code:java}
LauncherConfigurationParameters build() {
List<ParameterProvider> parameterProviders = new
ArrayList<>();
if (!explicitParameters.isEmpty()) {
parameterProviders.add(ParameterProvider.explicit(explicitParameters));
}
if (parentConfigurationParameters != null) {
parameterProviders.add(ParameterProvider.inherited(parentConfigurationParameters));
}
if (implicitProvidersEnabled) {
parameterProviders.add(ParameterProvider.systemProperties());
parameterProviders.add(ParameterProvider.propertiesFile(configFileName));
}
return new
LauncherConfigurationParameters(parameterProviders);
}
}
{code}
I cannot path anything to the explcit one and the cod resorts to system
properties and the properties file.
Wether it is good, bad, reasonable -- I cannot tell, but only JUnit folks can
change that for us.
> In pom.xml, the configurationParameters configuration
> junit.platform.launcher.interceptors.enabled does not work
> ----------------------------------------------------------------------------------------------------------------
>
> Key: SUREFIRE-2203
> URL: https://issues.apache.org/jira/browse/SUREFIRE-2203
> Project: Maven Surefire
> Issue Type: Bug
> Components: JUnit 5.x support
> Reporter: Hengyunabc Chen
> Priority: Trivial
> Fix For: waiting-for-feedback
>
>
> In pom.xml, the configuration
> {{junit.platform.launcher.interceptors.enabled}} does not work.
> The following configuration does not take effect:
> {code:java}
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>3.1.2</version>
> <configuration>
> <properties>
> <configurationParameters>
> junit.platform.launcher.interceptors.enabled=true
> </configurationParameters>
> </properties>
> </configuration> {code}
>
> The following configuration can work:
> {code:java}
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>3.1.2</version>
> <configuration>
> <systemPropertyVariables>
>
> <junit.platform.launcher.interceptors.enabled>true</junit.platform.launcher.interceptors.enabled>
> </systemPropertyVariables>
> </configuration> {code}
>
> Or configuring it in the {{junit-platform.properties}} file will also work.
> Reference documentation:
> *
> [https://junit.org/junit5/docs/snapshot/user-guide/#launcher-api-launcher-interceptors-custom]
> *
> [https://junit.org/junit5/docs/snapshot/user-guide/#running-tests-build-maven-config-params]
> *
> [https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html#configuration-parameters]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)