/*
 * Copyright 2015-2016 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v10.html
 */

package org.junit.gen5.engine.support.hierarchical;

import static org.junit.gen5.commons.meta.API.Usage.Experimental;

import org.junit.gen5.commons.meta.API;
import org.junit.gen5.engine.ExecutionRequest;
import org.junit.gen5.engine.TestEngine;

/**
 * Abstract base class for all {@link TestEngine} implementations that wish
 * to organize test suites hierarchically based on the {@link Node} abstraction.
 *
 * @param <C> the type of {@code EngineExecutionContext} used by this engine
 * @since 5.0
 * @see Node
 */
@API(Experimental)
public abstract class HierarchicalTestEngine<C extends EngineExecutionContext> implements TestEngine {

	@Override
	public final void execute(ExecutionRequest request) {
		new HierarchicalTestExecutor<>(request, createExecutionContext(request)).execute();
	}

	/**
	 * Create the initial execution context for executing the supplied
	 * {@link ExecutionRequest request}.
	 *
	 * @param request the request about to be executed
	 * @return the initial context that will be passed to nodes in the hierarchy
	 */
	protected abstract C createExecutionContext(ExecutionRequest request);

}

@@ -951,16 +951,467 @@
 gine %7B%0A%0A
+%09/**%0A%09 * Create an initial %7B@linkplain #createExecutionContext execution%0A%09 * context%7D, execute the behavior of all %7B@linkplain Node nodes%7D in the%0A%09 * hierarchy starting with the supplied %7B@code request%7D's%0A%09 * %7B@linkplain ExecutionRequest#getRootTestDescriptor() root%7D and notify%0A%09 * its %7B@linkplain ExecutionRequest#getEngineExecutionListener() execution%0A%09 * listener%7D of test execution events.%0A%09 *%0A%09 * @see Node%0A%09 * @see #createExecutionContext%0A%09 */%0A
 %09@Overri

Document HierarchicalTestEngine#execute (#234)