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

public Interface HierarchicalTestExecutorService

extends AutoCloseable
Known Direct Implementers
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService, org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService
Annotations
@API
status:STABLE
since:1.10
Static Imports
org.apiguardian.api.API.Status.EXPERIMENTAL, .API.Status.STABLE

A closeable service that executes test tasks.
Since
1.3
See Also
HierarchicalTestEngine#createExecutorService(ExecutionRequest), SameThreadHierarchicalTestExecutorService, ForkJoinPoolHierarchicalTestExecutorService

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
HierarchicalTestExecutorService.TestTask

An executable task that represents a single test or container.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.lang.AutoCloseable.close.

Close this service and let it perform any required cleanup work.

public void
invokeAll(List<? extends HierarchicalTestExecutorService.TestTask>
the test tasks to be executed
testTasks
)

Invoke all supplied test tasks and block until their execution has finished.

public Future<@Nullable Void>

Returns:

a future that the caller can use to wait for the task's execution to be finished
submit
(HierarchicalTestExecutorService.TestTask
the test task to be executed
testTask
)

Submit the supplied test task to be executed by this service.

Method Detail

closeback to summary
public void close()

Redeclares java.lang.AutoCloseable.close.

Close this service and let it perform any required cleanup work.

For example, thread-based implementations should usually close their thread pools in this method.

Annotations
@Override
invokeAllback to summary
public void invokeAll(List<? extends HierarchicalTestExecutorService.TestTask> testTasks)

Invoke all supplied test tasks and block until their execution has finished.

Implementations may execute one or multiple of the supplied tasks in parallel as long as their execution mode is concurrent.

Implementations must generally acquire and release each task's resource lock before and after its execution unless they execute all tests in the same thread which upholds the same guarantees.

Parameters
testTasks:List<? extends HierarchicalTestExecutorService.TestTask>

the test tasks to be executed

See Also
submit(TestTask)
submitback to summary
public Future<@Nullable Void> submit(HierarchicalTestExecutorService.TestTask testTask)

Submit the supplied test task to be executed by this service.

Implementations may execute the task asynchronously as long as its execution mode is concurrent.

Implementations must generally acquire and release the task's resource lock before and after its execution unless they execute all tests in the same thread which upholds the same guarantees.

Parameters
testTask:HierarchicalTestExecutorService.TestTask

the test task to be executed

Returns:Future<@Nullable Void>

a future that the caller can use to wait for the task's execution to be finished

See Also
invokeAll(List)
org.junit.platform.engine.support.hierarchical back to summary

public Interface HierarchicalTestExecutorService.TestTask

Known Direct Implementers
org.junit.platform.engine.support.hierarchical.NodeTestTask

An executable task that represents a single test or container.

Method Summary

Modifier and TypeMethod and Description
public void
execute()

Execute this task.

public Node.ExecutionMode
getExecutionMode()

Get the execution mode of this task.

public ResourceLock
getResourceLock()

Get the resource lock of this task.

public default TestDescriptor
getTestDescriptor()

Get the test descriptor of this task.

Method Detail

executeback to summary
public void execute()

Execute this task.

getExecutionModeback to summary
public Node.ExecutionMode getExecutionMode()

Get the execution mode of this task.

getResourceLockback to summary
public ResourceLock getResourceLock()

Get the resource lock of this task.

getTestDescriptorback to summary
public default TestDescriptor getTestDescriptor()

Get the test descriptor of this task.

Annotations
@API
status:EXPERIMENTAL
since:6.0
Exceptions
UnsupportedOperationException:
if not supported for this TestTask implementation
Since
6.0