in junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java [122:152]
private void executeRecursively() {
taskContext.getListener().executionStarted(testDescriptor);
started = true;
throwableCollector.execute(() -> {
node.around(context, ctx -> {
context = ctx;
throwableCollector.execute(() -> {
// @formatter:off
List<NodeTestTask<C>> children = testDescriptor.getChildren().stream()
.map(descriptor -> new NodeTestTask<C>(taskContext, descriptor))
.collect(toCollection(ArrayList::new));
// @formatter:on
context = node.before(context);
final DynamicTestExecutor dynamicTestExecutor = new DefaultDynamicTestExecutor();
context = node.execute(context, dynamicTestExecutor);
if (!children.isEmpty()) {
children.forEach(child -> child.setParentContext(context));
taskContext.getExecutorService().invokeAll(children);
}
throwableCollector.execute(dynamicTestExecutor::awaitFinished);
});
throwableCollector.execute(() -> node.after(context));
});
});
}