Top Description Constructors Methods
org.junit.platform.engine.support.hierarchical

public abstract Class HierarchicalTestEngine<C extends EngineExecutionContext>

extends Object
implements TestEngine
Class Inheritance
All Implemented Interfaces
org.junit.platform.engine.TestEngine
Annotations
@API
status:MAINTAINED
since:1.0
Type Parameters
<C>
the type of EngineExecutionContext used by this engine
Static Imports
org.apiguardian.api.API.Status.MAINTAINED, .API.Status.STABLE

Abstract base class for all TestEngine implementations that wish to organize test suites hierarchically based on the Node abstraction.
Since
1.0
See Also
Node

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected abstract C

Returns:

the initial context that will be passed to nodes in the hierarchy
createExecutionContext
(ExecutionRequest
the request about to be executed
request
)

Create the initial execution context for executing the supplied request.

protected HierarchicalTestExecutorService
createExecutorService(ExecutionRequest
the request about to be executed
request
)

Create the executor service to use for executing the supplied request.

protected ThrowableCollector.Factory
createThrowableCollectorFactory(ExecutionRequest
the request about to be executed
request
)

Create the factory for creating ThrowableCollector instances used to handle exceptions that occur during execution of this engine's tests.

public final void
execute(ExecutionRequest request)

Implements org.junit.platform.engine.TestEngine.execute.

Create an executor service; create an initial execution context; execute the behavior of all nodes in the hierarchy starting with the supplied request's root and notify its execution listener of test execution events.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

HierarchicalTestEngineback to summary
public HierarchicalTestEngine()

Method Detail

createExecutionContextback to summary
protected abstract C createExecutionContext(ExecutionRequest request)

Create the initial execution context for executing the supplied request.

Parameters
request:ExecutionRequest

the request about to be executed

Returns:C

the initial context that will be passed to nodes in the hierarchy

createExecutorServiceback to summary
protected HierarchicalTestExecutorService createExecutorService(ExecutionRequest request)

Create the executor service to use for executing the supplied request.

An engine may use the information in the supplied request such as the contained configuration parameters to decide what kind of service to return or how to configure it.

By default, this method returns an instance of SameThreadHierarchicalTestExecutorService.

Parameters
request:ExecutionRequest

the request about to be executed

Annotations
@API
status:STABLE
since:1.10
Since
1.3
See Also
ForkJoinPoolHierarchicalTestExecutorService, SameThreadHierarchicalTestExecutorService
createThrowableCollectorFactoryback to summary
protected ThrowableCollector.Factory createThrowableCollectorFactory(ExecutionRequest request)

Create the factory for creating ThrowableCollector instances used to handle exceptions that occur during execution of this engine's tests.

An engine may use the information in the supplied request such as the contained configuration parameters to decide what kind of factory to return or how to configure it.

By default, this method returns a factory that always creates instances of OpenTest4JAwareThrowableCollector.

Parameters
request:ExecutionRequest

the request about to be executed

Annotations
@API
status:STABLE
since:1.10
Since
1.3
See Also
OpenTest4JAwareThrowableCollector, ThrowableCollector
executeback to summary
public final void execute(ExecutionRequest request)

Implements org.junit.platform.engine.TestEngine.execute.

Create an executor service; create an initial execution context; execute the behavior of all nodes in the hierarchy starting with the supplied request's root and notify its execution listener of test execution events.

Supports cancellation via the CancellationToken passed in the supplied request.

Annotations
@Override
See Also
Node, createExecutorService, createExecutionContext