Module org.junit.platform.engine
Class SameThreadHierarchicalTestExecutorService
java.lang.Object
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService
- All Implemented Interfaces:
AutoCloseable
,HierarchicalTestExecutorService
@API(status=STABLE,
since="1.10")
public class SameThreadHierarchicalTestExecutorService
extends Object
implements HierarchicalTestExecutorService
A simple executor service that
executes all test tasks in the caller's thread.
- Since:
- 1.3
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService
HierarchicalTestExecutorService.TestTask
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this service and let it perform any required cleanup work.void
invokeAll
(List<? extends HierarchicalTestExecutorService.TestTask> tasks) Invoke all supplied test tasks and block until their execution has finished.Submit the supplied test task to be executed by this service.
-
Constructor Details
-
SameThreadHierarchicalTestExecutorService
public SameThreadHierarchicalTestExecutorService()
-
-
Method Details
-
submit
Description copied from interface:HierarchicalTestExecutorService
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.
- Specified by:
submit
in interfaceHierarchicalTestExecutorService
- 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
Description copied from interface:HierarchicalTestExecutorService
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.
- Specified by:
invokeAll
in interfaceHierarchicalTestExecutorService
- Parameters:
tasks
- the test tasks to be executed- See Also:
-
close
public void close()Description copied from interface:HierarchicalTestExecutorService
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
- Specified by:
close
in interfaceHierarchicalTestExecutorService
-