Skip to content

Commit 01fea17

Browse files
committed
Reformat javadoc and adoc to meet formatting conventions
Issue: #1454
1 parent 083a233 commit 01fea17

File tree

5 files changed

+62
-44
lines changed

5 files changed

+62
-44
lines changed

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -450,26 +450,28 @@ but rethrow any other type of exception.
450450
include::{testDir}/example/exception/IgnoreIOExceptionExtension.java[tags=user_guide]
451451
----
452452

453-
Another example shows how to record the state of application under test exactly at the point of
454-
unexpected exception being thrown during setup and cleanup. Note that unlike relying on
455-
lifecycle callbacks, which may or may not be executed depending on the test status, this solution
456-
guarantees execution immediately after failing `@BeforeAll`, `@BeforeEach`, `@AfterEach` or `@AfterAll`.
453+
Another example shows how to record the state of application under test exactly at the
454+
point of unexpected exception being thrown during setup and cleanup. Note that unlike
455+
relying on lifecycle callbacks, which may or may not be executed depending on the test
456+
status, this solution guarantees execution immediately after failing `@BeforeAll`,
457+
`@BeforeEach`, `@AfterEach` or `@AfterAll`.
457458

458459
[source,java,indent=0]
459460
.An exception handling extension that records application state on error
460461
----
461462
include::{testDir}/example/exception/RecordStateOnErrorExtension.java[tags=user_guide]
462463
----
463464

464-
Multiple execution exception handlers may be invoked for the same lifecycle method in order of
465-
declaration. If one of the handlers swallows the handled exception, subsequent ones will not be executed,
466-
and no failure will be propagated to JUnit engine, as if the exception was never thrown. Handlers may also
467-
choose to rethrow the exception or throw a different one, potentially wrapping the original.
465+
Multiple execution exception handlers may be invoked for the same lifecycle method in
466+
order of declaration. If one of the handlers swallows the handled exception, subsequent
467+
ones will not be executed, and no failure will be propagated to JUnit engine, as if the
468+
exception was never thrown. Handlers may also choose to rethrow the exception or throw
469+
a different one, potentially wrapping the original.
468470

469-
Extensions implementing `{BeforeAllExecutionExceptionHandler}` and `{AfterAllExecutionExceptionHandler}`
470-
need to be registered on a class level, while `{BeforeEachExecutionExceptionHandler}`,
471-
`{TestExecutionExceptionHandler}` and `{AfterEachExecutionExceptionHandler}` may be also registered for
472-
individual test methods.
471+
Extensions implementing `{BeforeAllExecutionExceptionHandler}` and
472+
`{AfterAllExecutionExceptionHandler}`need to be registered on a class level, while
473+
`{BeforeEachExecutionExceptionHandler}`, `{TestExecutionExceptionHandler}` and
474+
`{AfterEachExecutionExceptionHandler}` may be also registered for individual test methods.
473475

474476
[source,java,indent=0]
475477
.An exception handling extension that records application state on error

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterAllExecutionExceptionHandler.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@
1515
import org.apiguardian.api.API;
1616

1717
/**
18-
* {@code AfterAllExecutionExceptionHandler} defines the API for {@link Extension Extensions} that wish to
19-
* handle exceptions thrown during execution of lifecycle methods annotated with {@code @AfterAll}.
18+
* {@code AfterAllExecutionExceptionHandler} defines the API for
19+
* {@link Extension Extensions} that wish to handle exceptions thrown during
20+
* execution of lifecycle methods annotated with {@code @AfterAll}.
2021
*
21-
* <p>Common use cases include swallowing an exception if it's anticipated or rolling back a transaction
22-
* in certain error scenarios.
22+
* <p>Common use cases include swallowing an exception if it's anticipated or
23+
* rolling back a transaction in certain error scenarios.
2324
*
2425
* <p>This extension needs to be declared on a class level
2526
*
2627
* <h3>Constructor Requirements</h3>
2728
*
28-
* <p>Consult the documentation in {@link Extension} for details on constructor requirements.
29+
* <p>Consult the documentation in {@link Extension} for details on constructor
30+
* requirements.
2931
*
3032
* @see TestExecutionExceptionHandler
3133
* @see BeforeAllExecutionExceptionHandler
@@ -48,9 +50,10 @@ public interface AfterAllExecutionExceptionHandler extends Extension {
4850
* <li>Throw a new exception, potentially wrapping the supplied {@code throwable}.</li>
4951
* </ol>
5052
*
51-
* <p>If the supplied {@code throwable} is swallowed, subsequent {@code AfterAllExecutionExceptionHandler}
52-
* will not be invoked; otherwise, the next registered {@code AfterAllExecutionExceptionHandler} (if there is one)
53-
* will be invoked with any {@link Throwable} thrown by this handler.
53+
* <p>If the supplied {@code throwable} is swallowed, subsequent
54+
* {@code AfterAllExecutionExceptionHandler} will not be invoked; otherwise,
55+
* the next registered {@code AfterAllExecutionExceptionHandler} (if there
56+
* is one) will be invoked with any {@link Throwable} thrown by this handler.
5457
*
5558
* @param context the current extension context; never {@code null}
5659
* @param throwable the {@code Throwable} to handle; never {@code null}

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterEachExecutionExceptionHandler.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@
1515
import org.apiguardian.api.API;
1616

1717
/**
18-
* {@code AfterEachExecutionExceptionHandler} defines the API for {@link Extension Extensions} that wish to
19-
* handle exceptions thrown during execution of lifecycle methods annotated with {@code @AfterEach}.
18+
* {@code AfterEachExecutionExceptionHandler} defines the API for
19+
* {@link Extension Extensions} that wish to handle exceptions thrown during
20+
* execution of lifecycle methods annotated with {@code @AfterEach}.
2021
*
21-
* <p>Common use cases include swallowing an exception if it's anticipated or rolling back a transaction
22-
* in certain error scenarios.
22+
* <p>Common use cases include swallowing an exception if it's anticipated or
23+
* rolling back a transaction in certain error scenarios.
2324
*
2425
* <h3>Constructor Requirements</h3>
2526
*
26-
* <p>Consult the documentation in {@link Extension} for details on constructor requirements.
27+
* <p>Consult the documentation in {@link Extension} for details on constructor
28+
* requirements.
2729
*
2830
* @see TestExecutionExceptionHandler
2931
* @see BeforeAllExecutionExceptionHandler
@@ -46,9 +48,11 @@ public interface AfterEachExecutionExceptionHandler extends Extension {
4648
* <li>Throw a new exception, potentially wrapping the supplied {@code throwable}.</li>
4749
* </ol>
4850
*
49-
* <p>If the supplied {@code throwable} is swallowed, subsequent {@code AfterEachExecutionExceptionHandler}
50-
* will not be invoked; otherwise, the next registered {@code AfterEachExecutionExceptionHandler} (if there is one)
51-
* will be invoked with any {@link Throwable} thrown by this handler.
51+
* <p>If the supplied {@code throwable} is swallowed, subsequent
52+
* {@code AfterEachExecutionExceptionHandler} will not be invoked;
53+
* otherwise, the next registered {@code AfterEachExecutionExceptionHandler}
54+
* (if there is one) will be invoked with any {@link Throwable} thrown by
55+
* this handler.
5256
*
5357
* @param context the current extension context; never {@code null}
5458
* @param throwable the {@code Throwable} to handle; never {@code null}

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeAllExecutionExceptionHandler.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@
1515
import org.apiguardian.api.API;
1616

1717
/**
18-
* {@code BeforeAllExecutionExceptionHandler} defines the API for {@link Extension Extensions} that wish to
19-
* handle exceptions thrown during execution of lifecycle methods annotated with {@code @BeforeAll}.
18+
* {@code BeforeAllExecutionExceptionHandler} defines the API for
19+
* {@link Extension Extensions} that wish to handle exceptions thrown during
20+
* execution of lifecycle methods annotated with {@code @BeforeAll}.
2021
*
21-
* <p>Common use cases include swallowing an exception if it's anticipated or rolling back a transaction
22-
* in certain error scenarios.
22+
* <p>Common use cases include swallowing an exception if it's anticipated or
23+
* rolling back a transaction in certain error scenarios.
2324
*
2425
* <p>This extension needs to be declared on a class level
2526
*
2627
* <h3>Constructor Requirements</h3>
2728
*
28-
* <p>Consult the documentation in {@link Extension} for details on constructor requirements.
29+
* <p>Consult the documentation in {@link Extension} for details on constructor
30+
* requirements.
2931
*
3032
* @see TestExecutionExceptionHandler
3133
* @see BeforeEachExecutionExceptionHandler
@@ -48,9 +50,11 @@ public interface BeforeAllExecutionExceptionHandler extends Extension {
4850
* <li>Throw a new exception, potentially wrapping the supplied {@code throwable}.</li>
4951
* </ol>
5052
*
51-
* <p>If the supplied {@code throwable} is swallowed, subsequent {@code BeforeAllExecutionExceptionHandler}
52-
* will not be invoked; otherwise, the next registered {@code BeforeAllExecutionExceptionHandler} (if there is one)
53-
* will be invoked with any {@link Throwable} thrown by this handler.
53+
* <p>If the supplied {@code throwable} is swallowed, subsequent
54+
* {@code BeforeAllExecutionExceptionHandler} will not be invoked;
55+
* otherwise, the next registered {@code BeforeAllExecutionExceptionHandler}
56+
* (if there is one) will be invoked with any {@link Throwable} thrown by
57+
* this handler.
5458
*
5559
* @param context the current extension context; never {@code null}
5660
* @param throwable the {@code Throwable} to handle; never {@code null}

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeEachExecutionExceptionHandler.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@
1515
import org.apiguardian.api.API;
1616

1717
/**
18-
* {@code BeforeEachExecutionExceptionHandler} defines the API for {@link Extension Extensions} that wish to
19-
* handle exceptions thrown during execution of lifecycle methods annotated with {@code @BeforeEach}.
18+
* {@code BeforeEachExecutionExceptionHandler} defines the API for
19+
* {@link Extension Extensions} that wish to handle exceptions thrown during
20+
* execution of lifecycle methods annotated with {@code @BeforeEach}.
2021
*
21-
* <p>Common use cases include swallowing an exception if it's anticipated or rolling back a transaction
22-
* in certain error scenarios.
22+
* <p>Common use cases include swallowing an exception if it's anticipated or
23+
* rolling back a transaction in certain error scenarios.
2324
*
2425
* <h3>Constructor Requirements</h3>
2526
*
26-
* <p>Consult the documentation in {@link Extension} for details on constructor requirements.
27+
* <p>Consult the documentation in {@link Extension} for details on constructor
28+
* requirements.
2729
*
2830
* @see TestExecutionExceptionHandler
2931
* @see BeforeAllExecutionExceptionHandler
@@ -41,13 +43,16 @@ public interface BeforeEachExecutionExceptionHandler extends Extension {
4143
*
4244
* <p>Implementors must perform one of the following.
4345
* <ol>
44-
* <li>Swallow the supplied {@code throwable}, thereby preventing propagation.</li>
46+
* <li>Swallow the supplied {@code throwable}, thereby preventing
47+
* propagation.</li>
4548
* <li>Rethrow the supplied {@code throwable} <em>as is</em>.</li>
4649
* <li>Throw a new exception, potentially wrapping the supplied {@code throwable}.</li>
4750
* </ol>
4851
*
49-
* <p>If the supplied {@code throwable} is swallowed, subsequent {@code BeforeEachExecutionExceptionHandler}
50-
* will not be invoked; otherwise, the next registered {@code BeforeEachExecutionExceptionHandler} (if there is one)
52+
* <p>If the supplied {@code throwable} is swallowed, subsequent
53+
* {@code BeforeEachExecutionExceptionHandler}
54+
* will not be invoked; otherwise, the next registered
55+
* {@code BeforeEachExecutionExceptionHandler} (if there is one)
5156
* will be invoked with any {@link Throwable} thrown by this handler.
5257
*
5358
* @param context the current extension context; never {@code null}

0 commit comments

Comments
 (0)