Module org.junit.platform.engine
Interface HierarchicalTestExecutorService
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ForkJoinPoolHierarchicalTestExecutorService
,SameThreadHierarchicalTestExecutorService
@API(status=EXPERIMENTAL,
since="1.3")
public interface HierarchicalTestExecutorService
extends AutoCloseable
A closeable service that executes test tasks.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
An executable task that represents a single test or container. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this service and let it perform any required cleanup work.void
invokeAll(List<? extends HierarchicalTestExecutorService.TestTask> testTasks)
Invoke all supplied test tasks and block until their execution has finished.submit(HierarchicalTestExecutorService.TestTask testTask)
Submit the supplied test task to be executed by this service.
-
Method Details
-
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
- the test task to be executed- Returns:
- a future that the caller can use to wait for the task's execution to be finished
- See Also:
invokeAll(List)
-
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:
testTasks
- the test tasks to be executed- See Also:
submit(TestTask)
-
close
void 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.
- Specified by:
close
in interfaceAutoCloseable
-