All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.junit.jupiter.engine.descriptor.DynamicExtensionContext Maven / Gradle / Ivy

There is a newer version: 5.11.3
Show newest version
/*
 * Copyright 2015-2024 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 v2.0 which
 * accompanies this distribution and is available at
 *
 * https://www.eclipse.org/legal/epl-v20.html
 */

package org.junit.jupiter.engine.descriptor;

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.util.Optional;
import java.util.function.Function;

import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExecutableInvoker;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.TestInstances;
import org.junit.jupiter.engine.config.JupiterConfiguration;
import org.junit.platform.engine.EngineExecutionListener;
import org.junit.platform.engine.support.hierarchical.Node;

class DynamicExtensionContext extends AbstractExtensionContext {

	DynamicExtensionContext(ExtensionContext parent, EngineExecutionListener engineExecutionListener,
			DynamicNodeTestDescriptor testDescriptor, JupiterConfiguration configuration,
			Function executableInvokerFactory) {
		super(parent, engineExecutionListener, testDescriptor, configuration, executableInvokerFactory);
	}

	@Override
	public Optional getElement() {
		return Optional.empty();
	}

	@Override
	public Optional> getTestClass() {
		return Optional.empty();
	}

	@Override
	public Optional getTestInstanceLifecycle() {
		return Optional.empty();
	}

	@Override
	public Optional getTestInstance() {
		return Optional.empty();
	}

	@Override
	public Optional getTestInstances() {
		return Optional.empty();
	}

	@Override
	public Optional getTestMethod() {
		return Optional.empty();
	}

	@Override
	public Optional getExecutionException() {
		return Optional.empty();
	}

	@Override
	protected Node.ExecutionMode getPlatformExecutionMode() {
		return getTestDescriptor().getExecutionMode();
	}

}