Skip to content

Commit 14c6971

Browse files
Document inheritance support - part 2 (#5765)
Signed-off-by: Swati Chauhan <swati.chauhan814@gmail.com>
1 parent f4c6eae commit 14c6971

10 files changed

Lines changed: 60 additions & 1 deletion

File tree

junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@
4444
* <p>Display names are typically used for test reporting in IDEs and build
4545
* tools and may contain spaces, special characters, and even emoji.
4646
*
47+
* <h2>Extensibility</h2>
48+
*
49+
* <p>This interface is designed to be implemented by clients.
50+
*
4751
* <p>Concrete implementations must have a <em>default constructor</em>.
4852
*
53+
* <h2>Configuration</h2>
54+
*
4955
* <p>A {@link DisplayNameGenerator} can be configured <em>globally</em> for the
5056
* entire test suite via the {@value #DEFAULT_GENERATOR_PROPERTY_NAME}
5157
* configuration parameter (see the User Guide for details) or <em>locally</em>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
* Thrown if an error is encountered regarding the configuration of an
2323
* extension.
2424
*
25+
* <h2>Extensibility</h2>
26+
*
27+
* <p>Although it is technically possible to extend this class, extension is
28+
* strongly discouraged.
29+
*
2530
* @since 5.0
2631
*/
2732
@API(status = STABLE, since = "5.0")

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
* Thrown if an error is encountered regarding the use of an
2525
* {@link ExtensionContext} or {@link Store}.
2626
*
27+
* <h2>Extensibility</h2>
28+
*
29+
* <p>Although it is technically possible to extend this class, extension is
30+
* strongly discouraged.
31+
*
2732
* @since 5.0
2833
*/
2934
@API(status = STABLE, since = "5.0")

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
* Thrown if an error is encountered in the configuration or execution of a
2323
* {@link ParameterResolver}.
2424
*
25+
* <h2>Extensibility</h2>
26+
*
27+
* <p>Although it is technically possible to extend this class, extension is
28+
* strongly discouraged.
29+
*
2530
* @since 5.0
2631
* @see ParameterResolver
2732
*/

junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
* often they are called. Since instances may potentially be cached and called
4545
* from different threads, they should be thread-safe.
4646
*
47+
* <h2>Extensibility</h2>
48+
*
49+
* <p>This interface is designed to be implemented by clients.
50+
*
4751
* @since 5.2
4852
* @see AggregateWith
4953
* @see ArgumentsAccessor

junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/SimpleArgumentsAggregator.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* {@link ArgumentsAggregator} implementations that do not need to distinguish
2424
* between fields and method/constructor parameters.
2525
*
26+
* <h2>Extensibility</h2>
27+
*
28+
* <p>This class is designed for extension.
29+
*
2630
* @since 5.0
2731
* @see ArgumentsAggregator
2832
*/
@@ -32,12 +36,18 @@ public abstract class SimpleArgumentsAggregator implements ArgumentsAggregator {
3236
public SimpleArgumentsAggregator() {
3337
}
3438

39+
/**
40+
* By default, this method delegates to {@link #aggregateArguments(ArgumentsAccessor, Class, AnnotatedElementContext, int)}.
41+
*/
3542
@Override
3643
public @Nullable Object aggregateArguments(ArgumentsAccessor accessor, ParameterContext context)
3744
throws ArgumentsAggregationException {
3845
return aggregateArguments(accessor, context.getParameter().getType(), context, context.getIndex());
3946
}
4047

48+
/**
49+
* By default, this method delegates to {@link #aggregateArguments(ArgumentsAccessor, Class, AnnotatedElementContext, int)}.
50+
*/
4151
@Override
4252
public @Nullable Object aggregateArguments(ArgumentsAccessor accessor, FieldContext context)
4353
throws ArgumentsAggregationException {

junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParsingException.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
/**
2121
* Thrown if an error is encountered while parsing CSV input.
2222
*
23+
* <h2>Extensibility</h2>
24+
*
25+
* <p>Although it is technically possible to extend this class, extension is
26+
* strongly discouraged.
27+
*
2328
* @since 5.3
2429
* @see CsvSource
2530
* @see CsvFileSource

junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
* An exclusive resource identified by a key with a lock mode that is used to
2828
* synchronize access to shared resources when executing nodes in parallel.
2929
*
30+
* <h2>Extensibility</h2>
31+
*
32+
* <p>Although it is technically possible to extend this class, extension is
33+
* strongly discouraged.
34+
*
3035
* @since 1.3
3136
* @see Node#getExecutionMode()
3237
*/

junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* Abstract base class for all {@link TestEngine} implementations that wish
2424
* to organize test suites hierarchically based on the {@link Node} abstraction.
2525
*
26+
* <h2>Extensibility</h2>
27+
*
28+
* <p>This class is designed for extension by test engine implementations.
29+
*
2630
* @param <C> the type of {@code EngineExecutionContext} used by this engine
2731
* @since 1.0
2832
* @see Node
@@ -38,7 +42,11 @@ public HierarchicalTestEngine() {
3842
* service}; create an initial {@linkplain #createExecutionContext execution
3943
* context}; execute the behavior of all {@linkplain Node nodes} in the
4044
* hierarchy starting with the supplied {@code request}'s
41-
* {@linkplain ExecutionRequest#getRootTestDescriptor() root} and notify
45+
* {@linkplain ExecutionRequest#getRootTestDescriptor() root}, collecting
46+
* every thrown throwable using the
47+
* {@linkplain org.junit.platform.engine.support.hierarchical.ThrowableCollector
48+
* throwable collector} returned by
49+
* {@linkplain #createThrowableCollectorFactory(ExecutionRequest)}; and notify
4250
* its {@linkplain ExecutionRequest#getEngineExecutionListener() execution
4351
* listener} of test execution events.
4452
*
@@ -48,6 +56,7 @@ public HierarchicalTestEngine() {
4856
* @see Node
4957
* @see #createExecutorService
5058
* @see #createExecutionContext
59+
* @see #createThrowableCollectorFactory
5160
*/
5261
@Override
5362
public final void execute(ExecutionRequest request) {

junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
* Simple {@link TestExecutionListener} that generates a
3030
* {@linkplain TestExecutionSummary summary} of the test execution.
3131
*
32+
* <h2>Extensibility</h2>
33+
*
34+
* <p>Although it is technically possible to extend this class, extension is
35+
* strongly discouraged.
36+
*
3237
* @since 1.0
3338
* @see #getSummary()
3439
*/

0 commit comments

Comments
 (0)