Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
57ca8f53
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
57ca8f53
编写于
6月 09, 2016
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Document TestContext bootstrapping in the reference manual
Issue: SPR-11683
上级
7c96059c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
0 deletion
+31
-0
src/asciidoc/testing.adoc
src/asciidoc/testing.adoc
+31
-0
未找到文件。
src/asciidoc/testing.adoc
浏览文件 @
57ca8f53
...
@@ -331,6 +331,12 @@ you can use in your unit and integration tests in conjunction with the TestConte
...
@@ -331,6 +331,12 @@ you can use in your unit and integration tests in conjunction with the TestConte
framework
.
Refer
to
the
corresponding
javadocs
for
further
information
,
including
framework
.
Refer
to
the
corresponding
javadocs
for
further
information
,
including
default
attribute
values
,
attribute
aliases
,
and
so
on
.
default
attribute
values
,
attribute
aliases
,
and
so
on
.
=====
@
BootstrapWith
`@
BootstrapWith
`
is
a
class
-
level
annotation
that
is
used
to
configure
how
the
_Spring
TestContext
Framework_
is
bootstrapped
.
Specifically
,
`@
BootstrapWith
`
is
used
to
specify
a
custom
`
TestContextBootstrapper
`.
Consult
the
<<
testcontext
-
bootstrapping
,
Bootstrapping
the
TestContext
framework
>>
section
for
further
details
.
=====
@
ContextConfiguration
=====
@
ContextConfiguration
`@
ContextConfiguration
`
defines
class
-
level
metadata
that
is
used
to
determine
how
to
`@
ContextConfiguration
`
defines
class
-
level
metadata
that
is
used
to
determine
how
to
load
and
configure
an
`
ApplicationContext
`
for
integration
tests
.
Specifically
,
load
and
configure
an
`
ApplicationContext
`
for
integration
tests
.
Specifically
,
...
@@ -980,6 +986,7 @@ annotations_ and reduce configuration duplication across a test suite.
...
@@ -980,6 +986,7 @@ annotations_ and reduce configuration duplication across a test suite.
Each of the following may be used as meta-annotations in conjunction with the
Each of the following may be used as meta-annotations in conjunction with the
<<testcontext-framework,TestContext framework>>.
<<testcontext-framework,TestContext framework>>.
* `@BootstrapWith`
* `@ContextConfiguration`
* `@ContextConfiguration`
* `@ContextHierarchy`
* `@ContextHierarchy`
* `@ActiveProfiles`
* `@ActiveProfiles`
...
@@ -1153,6 +1160,30 @@ locations__.
...
@@ -1153,6 +1160,30 @@ locations__.
* `GenericPropertiesContextLoader`: loads a standard `ApplicationContext` from Java
* `GenericPropertiesContextLoader`: loads a standard `ApplicationContext` from Java
Properties files.
Properties files.
[[testcontext-bootstrapping]]
==== Bootstrapping the TestContext framework
The default configuration for the internals of the Spring TestContext Framework is
sufficient for all common use cases. However, there are times when a development team or
third party framework would like to change the default `ContextLoader`, implement a
custom `TestContext` or `ContextCache`, augment the default sets of
`ContextCustomizerFactory` and `TestExecutionListener` implementations, etc. For such low
level control over how the TestContext framework operates, Spring provides a
bootstrapping strategy.
`TestContextBootstrapper` defines the SPI for _bootstrapping_ the TestContext framework.
A `TestContextBootstrapper` is used by the `TestContextManager` to load the
`TestExecutionListener` implementations for the current test and to build the
`TestContext` that it manages. A custom bootstrapping strategy can be configured for a
test class (or test class hierarchy) via `@BootstrapWith`, either directly or as a
meta-annotation. If a bootstrapper is not explicitly configured via `@BootstrapWith`,
either the `DefaultTestContextBootstrapper` or the `WebTestContextBootstrapper` will be
used, depending on the presence of `@WebAppConfiguration`.
Since the `TestContextBootstrapper` SPI is likely to change in the future in order to
accommodate new requirements, implementers are strongly encouraged not to implement this
interface directly but rather to extend `AbstractTestContextBootstrapper` or one of its
concrete subclasses instead.
[[testcontext-tel-config]]
[[testcontext-tel-config]]
==== TestExecutionListener configuration
==== TestExecutionListener configuration
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录