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

public Class SameThreadHierarchicalTestExecutorService

extends Object
implements HierarchicalTestExecutorService
Class Inheritance
All Implemented Interfaces
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService, java.lang.AutoCloseable
Annotations
@API
status:STABLE
since:1.10
Static Imports
java.util.concurrent.CompletableFuture.completedFuture, org.apiguardian.api.API.Status.STABLE

A simple executor service that executes all test tasks in the caller's thread.
Since
1.3

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.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
tasks
)

Implements org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.invokeAll.

Invoke all supplied test tasks and block until their execution has finished.
public Future<Void>
submit(HierarchicalTestExecutorService.TestTask
the test task to be executed
testTask
)

Implements org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.submit.

Submit the supplied test task to be executed by this service.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SameThreadHierarchicalTestExecutorServiceback to summary
public SameThreadHierarchicalTestExecutorService()

Method Detail

closeback to summary
public void close()

Implements org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.close.

Doc from org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.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> tasks)

Implements org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.invokeAll.

Doc from org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.invokeAll.

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
tasks:List<? extends HierarchicalTestExecutorService.TestTask>

the test tasks to be executed

Annotations
@Override
submitback to summary
public Future<Void> submit(HierarchicalTestExecutorService.TestTask testTask)

Implements org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.submit.

Doc from org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.submit.

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<Void>

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

Annotations
@Override