类 BootstrapUtils
BootstrapUtils is a collection of utility methods to assist with
bootstrapping the TestContext Framework.
Only intended for internal use.
- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen, Phillip Webb
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明(专用程序包) static BootstrapContextcreateBootstrapContext(Class<?> testClass) Create theBootstrapContextfor the specified test class.private static CacheAwareContextLoaderDelegateprivate static Class<? extends Annotation>(专用程序包) static Class<TestContextBootstrapper>resolveDefaultTestContextBootstrapper(Class<?> testClass) (专用程序包) static Class<? extends TestContextBootstrapper>resolveExplicitTestContextBootstrapper(Class<?> testClass) (专用程序包) static TestContextBootstrapperresolveTestContextBootstrapper(BootstrapContext bootstrapContext) Resolve theTestContextBootstrappertype for the test class in the suppliedBootstrapContext, instantiate it, and provide it a reference to theBootstrapContext.static TestContextBootstrapperresolveTestContextBootstrapper(Class<?> testClass) Resolve theTestContextBootstrappertype for the supplied test class using the defaultBootstrapContext, instantiate the bootstrapper, and provide it a reference to theBootstrapContext.
-
字段详细资料
-
DEFAULT_BOOTSTRAP_CONTEXT_CLASS_NAME
- 另请参阅:
-
DEFAULT_CACHE_AWARE_CONTEXT_LOADER_DELEGATE_CLASS_NAME
- 另请参阅:
-
DEFAULT_TEST_CONTEXT_BOOTSTRAPPER_CLASS_NAME
- 另请参阅:
-
DEFAULT_WEB_TEST_CONTEXT_BOOTSTRAPPER_CLASS_NAME
- 另请参阅:
-
WEB_APP_CONFIGURATION_ANNOTATION_CLASS_NAME
- 另请参阅:
-
webAppConfigurationClass
-
log
private static final cn.taketoday.logging.Logger log
-
-
构造器详细资料
-
BootstrapUtils
public BootstrapUtils()
-
-
方法详细资料
-
createBootstrapContext
Create theBootstrapContextfor the specified test class.Uses reflection to create a
DefaultBootstrapContextthat uses a defaultCacheAwareContextLoaderDelegate— configured via theCacheAwareContextLoaderDelegate.DEFAULT_CACHE_AWARE_CONTEXT_LOADER_DELEGATE_PROPERTY_NAMEsystem property or falling back to theDefaultCacheAwareContextLoaderDelegateif the system property is not defined.- 参数:
testClass- the test class for which the bootstrap context should be created- 返回:
- a new
BootstrapContext; nevernull
-
createCacheAwareContextLoaderDelegate
-
resolveTestContextBootstrapper
Resolve theTestContextBootstrappertype for the supplied test class using the defaultBootstrapContext, instantiate the bootstrapper, and provide it a reference to theBootstrapContext.If the
@BootstrapWithannotation is present on the test class, either directly or as a meta-annotation, then itsvaluewill be used as the bootstrapper type. Otherwise, either theDefaultTestContextBootstrapperor theWebTestContextBootstrapperwill be used, depending on the presence of@WebAppConfiguration.- 参数:
testClass- the test class for which the bootstrapper should be created- 返回:
- a fully configured
TestContextBootstrapper
-
resolveTestContextBootstrapper
Resolve theTestContextBootstrappertype for the test class in the suppliedBootstrapContext, instantiate it, and provide it a reference to theBootstrapContext.If the
@BootstrapWithannotation is present on the test class, either directly or as a meta-annotation, then itsvaluewill be used as the bootstrapper type. Otherwise, either theDefaultTestContextBootstrapperor theWebTestContextBootstrapperwill be used, depending on the presence of@WebAppConfiguration.- 参数:
bootstrapContext- the bootstrap context to use- 返回:
- a fully configured
TestContextBootstrapper
-
resolveExplicitTestContextBootstrapper
@Nullable static Class<? extends TestContextBootstrapper> resolveExplicitTestContextBootstrapper(Class<?> testClass) -
resolveDefaultTestContextBootstrapper
static Class<TestContextBootstrapper> resolveDefaultTestContextBootstrapper(Class<?> testClass) throws Exception - 抛出:
Exception
-
loadWebAppConfigurationClass
-