类 TestContextFactoriesUtils
java.lang.Object
cn.taketoday.test.context.util.TestContextFactoriesUtils
Collection of utilities for working with
TodayStrategies within
the Infra TestContext Framework.
Primarily intended for use within the TestContext framework.
- 从以下版本开始:
- 4.0 2023/6/15 21:14
- 作者:
- Sam Brannen, Harry Yang
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明classNames(Collection<?> components) static <T> List<T>loadFactoryImplementations(Class<T> factoryType) Load factory implementations of the given type via theTodayStrategiesmechanism.
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger
-
-
构造器详细资料
-
TestContextFactoriesUtils
public TestContextFactoriesUtils()
-
-
方法详细资料
-
loadFactoryImplementations
Load factory implementations of the given type via theTodayStrategiesmechanism.This method utilizes a custom
TodayStrategies.FailureHandlerand DEBUG/TRACE logging that are specific to the needs of the Infra TestContext Framework.Specifically, this method looks up and instantiates all
factoryTypeentries configured in allMETA-INF/today.strategiesfiles on the classpath.If a particular factory implementation cannot be loaded due to a
LinkageErrororClassNotFoundException, aDEBUGmessage will be logged, but the associated exception will not be rethrown. ARuntimeExceptionor any otherErrorwill be rethrown. Any other exception will be thrown wrapped in anIllegalStateException.- 类型参数:
T- the factory type- 参数:
factoryType- the interface or abstract class representing the factory- 返回:
- an unmodifiable list of factory implementations
- 另请参阅:
-
TodayStrategies.forDefaultResourceLocation(ClassLoader)TodayStrategies.load(Class, TodayStrategies.FailureHandler)
-
classNames
-