Skip to content

Commit 6e5b161

Browse files
committed
Document new configuration parameters
1 parent 13c1b19 commit 6e5b161

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

documentation/src/docs/asciidoc/user-guide/extensions.adoc

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,6 @@ Specifically, a custom extension can be registered by supplying its fully qualif
289289
name in a file named `org.junit.jupiter.api.extension.Extension` within the
290290
`/META-INF/services` folder in its enclosing JAR file.
291291

292-
[[automatic-extension-registration-pattern-matching]]
293-
===== Pattern Matching Syntax
294-
295-
Refer to <<running-tests-config-params-deactivation-pattern>> for details.
296-
297292
[[extensions-registration-automatic-enabling]]
298293
===== Enabling Automatic Extension Detection
299294

@@ -312,6 +307,25 @@ When auto-detection is enabled, extensions discovered via the `{ServiceLoader}`
312307
will be added to the extension registry after JUnit Jupiter's global extensions (e.g.,
313308
support for `TestInfo`, `TestReporter`, etc.).
314309

310+
[[extensions-registration-automatic-filtering]]
311+
===== Filtering Auto-detected Extensions
312+
313+
The list of auto-detected extensions can be filtered using include and exclude patterns
314+
via the following <<running-tests-config-params, configuration parameters>>:
315+
316+
`junit.jupiter.extensions.autodetection.include=<patterns>`::
317+
Comma-separated list of _include_ patterns for auto-detected extensions.
318+
`junit.jupiter.extensions.autodetection.exclude=<patterns>`::
319+
Comma-separated list of _exclude_ patterns for auto-detected extensions.
320+
321+
Include patterns are applied _before_ exclude patterns. If both include and exclude
322+
patterns are provided, only extensions that match at least one include pattern and do not
323+
match any exclude pattern will be auto-detected.
324+
325+
See <<running-tests-config-params-deactivation-pattern>> for details on the pattern syntax.
326+
327+
[[extensions-registration-automatic-conditional]]
328+
315329
[[extensions-registration-inheritance]]
316330
==== Extension Inheritance
317331

@@ -373,7 +387,7 @@ following system property.
373387
[[extensions-conditions-deactivation-patterns]]
374388
===== Pattern Matching Syntax
375389

376-
Pattern matching syntax is used to automatically detect and register extensions. For more details, refer to the <<automatic-extension-registration-pattern-matching,Pattern Matching Syntax>> section.
390+
Refer to <<running-tests-config-params-deactivation-pattern>> for details.
377391

378392
[[extensions-test-instance-pre-construct-callback]]
379393
=== Test Instance Pre-construct Callback

documentation/src/docs/asciidoc/user-guide/running-tests.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@ parameters_ used for the following features.
975975
- <<extensions-conditions-deactivation>>
976976
- <<launcher-api-listeners-custom-deactivation>>
977977
- <<stacktrace-pruning>>
978+
- <<extensions-registration-automatic-filtering>>
978979

979980
If the value for the given _configuration parameter_ consists solely of an asterisk
980981
(`+++*+++`), the pattern will match against all candidate classes. Otherwise, the value

0 commit comments

Comments
 (0)