Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.execution;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList;
import static org.apiguardian.api.API.Status.INTERNAL;
import static org.junit.platform.commons.util.ReflectionUtils.isAssignableTo;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.List;
import java.util.Optional;
import org.apiguardian.api.API;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.jupiter.api.extension.ParameterResolver;
import org.junit.jupiter.engine.extension.ExtensionRegistry;
import org.junit.platform.commons.logging.Logger;
import org.junit.platform.commons.logging.LoggerFactory;
import org.junit.platform.commons.util.Preconditions;
import org.junit.platform.commons.util.StringUtils;
import org.junit.platform.commons.util.UnrecoverableExceptions;
/**
* {@code ParameterResolutionUtils} provides support for dynamic resolution
* of executable parameters via {@link ParameterResolver ParameterResolvers}.
*
* @since 5.9
*/
@API(status = INTERNAL, since = "5.9")
public class ParameterResolutionUtils {
private static final Logger logger = LoggerFactory.getLogger(ParameterResolutionUtils.class);
/**
* Resolve the array of parameters for the supplied method and target.
*
* @param method the method for which to resolve parameters
* @param target an {@code Optional} containing the target on which the
* executable will be invoked; never {@code null} but should be empty for
* static methods and constructors
* @param extensionContext the current {@code ExtensionContext}
* @param extensionRegistry the {@code ExtensionRegistry} to retrieve
* {@code ParameterResolvers} from
* @return the array of Objects to be used as parameters in the executable
* invocation; never {@code null} though potentially empty
*/
public static Object[] resolveParameters(Method method, Optional