Skip to content

Commit

Permalink
Use junit.jupiter as prefix for Jupiter config params
Browse files Browse the repository at this point in the history
Prior to this commit, configuration parameters that were specific to
JUnit Jupiter used a prefix of "junit" instead of "junit.jupiter" which
could lead to confusion regarding scope of applicability and future
conflicts between various test engines.

This issue addresses these issues by renaming junit.conditions.deactivate
and junit.extensions.autodetection.enabled to
junit.jupiter.conditions.deactivate and
junit.jupiter.extensions.autodetection.enabled, respectively.

Issue: junit-team#1004
  • Loading branch information
sbrannen authored and Andrei94 committed Jun 23, 2018
1 parent 366924a commit 2bbf381
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
34 changes: 17 additions & 17 deletions documentation/src/docs/asciidoc/extensions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ name in a file named `org.junit.jupiter.api.extension.Extension` within the
===== Enabling Automatic Extension Detection

Auto-detection is an advanced feature and is therefore not enabled by default. To enable
it, simply set the `junit.extensions.autodetection.enabled` configuration key to `true`.
This can be supplied as a JVM system property or as a _configuration parameter_ in the
`LauncherDiscoveryRequest` that is passed to the `Launcher`.
it, simply set the `junit.jupiter.extensions.autodetection.enabled` configuration
parameter to `true`. This can be supplied as a JVM system property or as a _configuration
parameter_ in the `LauncherDiscoveryRequest` that is passed to the `Launcher`.

For example, to enable auto-detection of extensions, you can start your JVM with the
following system property.

`-Djunit.extensions.autodetection.enabled=true`
`-Djunit.jupiter.extensions.autodetection.enabled=true`

When auto-detection is enabled, extensions discovered via the `ServiceLoader` mechanism
will be added to the extension registry after JUnit Jupiter's global extensions (e.g.,
Expand Down Expand Up @@ -134,25 +134,25 @@ See the source code of `{DisabledCondition}` and `{Disabled}` for concrete examp
Sometimes it can be useful to run a test suite _without_ certain conditions being active.
For example, you may wish to run tests even if they are annotated with `@Disabled` in
order to see if they are still _broken_. To do this, simply provide a pattern for the
`junit.conditions.deactivate` configuration key to specify which conditions should be
deactivated (i.e., not evaluated) for the current test run. The pattern can be supplied
as a JVM system property or as a _configuration parameter_ in the `LauncherDiscoveryRequest`
that is passed to the `Launcher`.
`junit.jupiter.conditions.deactivate` configuration parameter to specify which conditions
should be deactivated (i.e., not evaluated) for the current test run. The pattern can be
supplied as a JVM system property or as a _configuration parameter_ in the
`LauncherDiscoveryRequest` that is passed to the `Launcher`.

For example, to deactivate JUnit's `@Disabled` condition, you can start your JVM with
the following system property.
For example, to deactivate JUnit's `@Disabled` condition, you can start your JVM with the
following system property.

`-Djunit.conditions.deactivate=org.junit.*DisabledCondition`
`-Djunit.jupiter.conditions.deactivate=org.junit.*DisabledCondition`

[[extensions-conditions-deactivation-patterns]]
===== Pattern Matching Syntax

If the `junit.conditions.deactivate` pattern consists solely of an asterisk (`+*+`), all
conditions will be deactivated. Otherwise, the pattern will be used to match against the
fully qualified class name (_FQCN_) of each registered condition. Any dot (`.`) in the
pattern will match against a dot (`.`) or a dollar sign (`$`) in the FQCN. Any asterisk
(`+*+`) will match against one or more characters in the FQCN. All other characters in the
pattern will be matched one-to-one against the FQCN.
If the `junit.jupiter.conditions.deactivate` pattern consists solely of an asterisk
(`+*+`), all conditions will be deactivated. Otherwise, the pattern will be used to match
against the fully qualified class name (_FQCN_) of each registered condition. Any dot
(`.`) in the pattern will match against a dot (`.`) or a dollar sign (`$`) in the FQCN.
Any asterisk (`+*+`) will match against one or more characters in the FQCN. All other
characters in the pattern will be matched one-to-one against the FQCN.

Examples:

Expand Down
11 changes: 11 additions & 0 deletions documentation/src/docs/asciidoc/release-notes-5.0.0-RC3.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ on GitHub.

* Source JARs no longer contain every source file twice.

===== Deprecations and Breaking Changes

* The `junit.conditions.deactivate` configuration parameter has been renamed to
`junit.jupiter.conditions.deactivate`.
* The `junit.extensions.autodetection.enabled` configuration parameter has been renamed
to `junit.jupiter.extensions.autodetection.enabled`.

===== New Features and Improvements

* ❓


[[release-notes-5.0.0-rc3-junit-vintage]]
==== JUnit Vintage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public final class Constants {
* @see #DEACTIVATE_ALL_CONDITIONS_PATTERN
* @see org.junit.jupiter.api.extension.ExecutionCondition
*/
public static final String DEACTIVATE_CONDITIONS_PATTERN_PROPERTY_NAME = "junit.conditions.deactivate";
public static final String DEACTIVATE_CONDITIONS_PATTERN_PROPERTY_NAME = "junit.jupiter.conditions.deactivate";

/**
* Wildcard pattern which signals that all conditions should be deactivated: {@value}
Expand All @@ -68,7 +68,7 @@ public final class Constants {
*
* <p>The default behavior is not to perform auto-detection.
*/
public static final String EXTENSIONS_AUTODETECTION_ENABLED_PROPERTY_NAME = "junit.extensions.autodetection.enabled";
public static final String EXTENSIONS_AUTODETECTION_ENABLED_PROPERTY_NAME = "junit.jupiter.extensions.autodetection.enabled";

private Constants() {
/* no-op */
Expand Down

0 comments on commit 2bbf381

Please sign in to comment.