Skip to content

Commit 744eb9b

Browse files
committed
Update User Guide regarding renamed and new extensions
Issue: #232
1 parent aa32c53 commit 744eb9b

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

documentation/src/docs/asciidoc/extensions.adoc

+12-9
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ initialization methods on the test instance, etc.
8585
For concrete examples, consult the source code for the `{MockitoExtension}` and the
8686
`{SpringExtension}`.
8787

88+
8889
=== Parameter Resolution
8990

9091
`{MethodParameterResolver}` is an `Extension` strategy for dynamically resolving
@@ -98,25 +99,29 @@ resolved by _name_, _type_, _annotation_, or any combination thereof. For concre
9899
consult the source code for `{CustomTypeParameterResolver}` and
99100
`{CustomAnnotationParameterResolver}`.
100101

102+
101103
=== Test Lifecycle Callbacks
102104

103105
The following interfaces define the APIs for extending tests at various points in the
104106
test execution lifecycle. Consult the Javadoc for each of these in the
105-
`{extension-api-package}` package.
107+
`{extension-api-package}` package for further details.
106108

107-
* `BeforeEachExtensionPoint`
108-
* `AfterEachExtensionPoint`
109-
* `BeforeAllExtensionPoint`
110-
* `AfterAllExtensionPoint`
109+
* `BeforeAllCallback`
110+
* `AfterAllCallback`
111+
* `BeforeEachCallback`
112+
* `AfterEachCallback`
113+
* `BeforeTestMethodCallback`
114+
* `AfterTestMethodCallback`
111115

112116
Note that extension developers may choose to implement any number of these interfaces
113117
within a single extension. Consult the source code of the `{SpringExtension}` for a
114118
concrete example.
115119

120+
116121
=== Exception Handling
117122

118-
`{ExceptionHandlerExtensionPoint}` defines the API for `Extensions` that wish to _react to
119-
exceptions_ thrown in a test.
123+
`{ExceptionHandler}` defines the API for `Extensions` that wish to handle exceptions
124+
thrown from tests.
120125

121126
The following example shows an extension which will swallow all instances of `IOException`
122127
but rethrow any other type of exception:
@@ -129,14 +134,12 @@ include::{testDir}/example/exception/IgnoreIOExceptionExtension.java[tags=user_g
129134
----
130135

131136

132-
133137
=== Keeping State in Extensions
134138

135139
Usually, an extension is instantiated only once. So the question becomes relevant: How do you keep the state
136140
from one invocation of an extension point to the next? ...
137141

138142

139-
140143
=== Additional Planned Extensions
141144

142145
Several additional extensions are planned, including but not limited to the following:

documentation/src/docs/asciidoc/index.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Stefan Bechtold; Sam Brannen; Johannes Link; Matthias Merdes; Marc Philipp
2828
:CustomTypeParameterResolver: {master-branch}/junit-tests/src/test/java/org/junit/gen5/engine/junit5/execution/injection/sample/CustomTypeParameterResolver.java[CustomTypeParameterResolver]
2929
:Disabled: {master-branch}/junit5-api/src/main/java/org/junit/gen5/api/Disabled.java[@Disabled]
3030
:DisabledCondition: {master-branch}/junit5-engine/src/main/java/org/junit/gen5/engine/junit5/extension/DisabledCondition.java[DisabledCondition]
31-
:ExceptionHandlerExtensionPoint: {master-branch}/junit5-api/src/main/java/org/junit/gen5/api/extension/ExceptionHandlerExtensionPoint.java[ExceptionHandlerExtensionPoint]
31+
:ExceptionHandler: {master-branch}/junit5-api/src/main/java/org/junit/gen5/api/extension/ExceptionHandler.java[ExceptionHandler]
3232
:ExtendWith: {master-branch}/junit5-api/src/main/java/org/junit/gen5/api/extension/ExtendWith.java[@ExtendWith]
3333
:ExtensionRegistrar: {master-branch}/junit5-api/src/main/java/org/junit/gen5/api/extension/ExtensionRegistrar.java[ExtensionRegistrar]
3434
:InstancePostProcessor: {master-branch}/junit5-api/src/main/java/org/junit/gen5/api/extension/InstancePostProcessor.java[InstancePostProcessor]

0 commit comments

Comments
 (0)