Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
8fb53c80
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,发现更多精彩内容 >>
提交
8fb53c80
编写于
8月 26, 2009
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPR-5995] Updated documentation regarding compatibility with JUnit 4.5, 4.6, and 4.7.
上级
da3eb580
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
22 deletion
+22
-22
org.springframework.test/src/main/java/org/springframework/test/context/junit4/AbstractJUnit4SpringContextTests.java
...test/context/junit4/AbstractJUnit4SpringContextTests.java
+1
-1
org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java
...ramework/test/context/junit4/SpringJUnit4ClassRunner.java
+2
-2
org.springframework.test/src/main/java/org/springframework/test/context/junit4/package-info.java
...org/springframework/test/context/junit4/package-info.java
+1
-1
org.springframework.test/src/main/java/org/springframework/test/context/package-info.java
...n/java/org/springframework/test/context/package-info.java
+1
-1
spring-framework-reference/src/testing.xml
spring-framework-reference/src/testing.xml
+17
-17
未找到文件。
org.springframework.test/src/main/java/org/springframework/test/context/junit4/AbstractJUnit4SpringContextTests.java
浏览文件 @
8fb53c80
...
...
@@ -32,7 +32,7 @@ import org.springframework.test.context.support.DirtiesContextTestExecutionListe
* <p>
* Abstract base test class which integrates the <em>Spring TestContext
* Framework</em> with explicit {@link ApplicationContext} testing support in a
* <strong>JUnit 4.
7
</strong> environment.
* <strong>JUnit 4.
5+
</strong> environment.
* </p>
* <p>
* Concrete subclasses should typically declare a class-level
...
...
org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java
浏览文件 @
8fb53c80
...
...
@@ -50,7 +50,7 @@ import org.springframework.test.context.junit4.statements.SpringRepeat;
* <p>
* <code>SpringJUnit4ClassRunner</code> is a custom extension of
* {@link BlockJUnit4ClassRunner} which provides functionality of the
* <em>Spring TestContext Framework</em> to standard JUnit 4.
7
+ tests by means
* <em>Spring TestContext Framework</em> to standard JUnit 4.
5
+ tests by means
* of the {@link TestContextManager} and associated support classes and
* annotations.
* </p>
...
...
@@ -76,7 +76,7 @@ import org.springframework.test.context.junit4.statements.SpringRepeat;
* </ul>
* <p>
* <b>NOTE:</b> As of Spring 3.0, <code>SpringJUnit4ClassRunner</code> requires
* JUnit 4.
7
.
* JUnit 4.
5+
.
* </p>
*
* @author Sam Brannen
...
...
org.springframework.test/src/main/java/org/springframework/test/context/junit4/package-info.java
浏览文件 @
8fb53c80
/**
* <p>Support classes for ApplicationContext-based and transactional
* tests run with JUnit 4.
7
and the <em>Spring TestContext Framework</em>.</p>
* tests run with JUnit 4.
5+
and the <em>Spring TestContext Framework</em>.</p>
*/
package
org.springframework.test.context.junit4
;
...
...
org.springframework.test/src/main/java/org/springframework/test/context/package-info.java
浏览文件 @
8fb53c80
...
...
@@ -4,7 +4,7 @@
* that is agnostic of the actual testing framework in use. The same
* techniques and annotation-based configuration used in, for example, a
* JUnit 3.8 environment can also be applied to tests written with JUnit
* 4.
7
, TestNG, etc.</p>
* 4.
5+
, TestNG, etc.</p>
*
* <p>In addition to providing generic and extensible testing
* infrastructure, the Spring TestContext Framework provides out-of-the-box
...
...
spring-framework-reference/src/testing.xml
浏览文件 @
8fb53c80
...
...
@@ -621,8 +621,8 @@ public void testProcessWithoutTransaction() {
<para>
The following annotations are
<emphasis>
only
</emphasis>
supported
when used in conjunction with JUnit (i.e., with the
<link
linkend=
"testcontext-junit4-runner"
>
SpringJUnit4ClassRunner
</link>
or
the
<link
linkend=
"testcontext-support-classes-junit38"
>
JUnit 3.8
</link>
and
<link
linkend=
"testcontext-support-classes-junit4"
>
JUnit 4.
7
</link>
the
<link
linkend=
"testcontext-support-classes-junit38"
>
JUnit 3.8
.2
</link>
and
<link
linkend=
"testcontext-support-classes-junit4"
>
JUnit 4.
5+
</link>
support classes.
</para>
<itemizedlist>
...
...
@@ -812,16 +812,16 @@ public void testProcessRepeatedly() {
Framework
</emphasis>
(located in the
<literal>
org.springframework.test.context
</literal>
package) provides
generic, annotation-driven unit and integration testing support that
is agnostic of the testing framework in use, for example JUnit 3.8,
JUnit 4.
7
, TestNG 5.10, etc. The TestContext framework also places a
is agnostic of the testing framework in use, for example JUnit 3.8
.2
,
JUnit 4.
5+
, TestNG 5.10, etc. The TestContext framework also places a
great deal of importance on
<emphasis>
convention over
configuration
</emphasis>
with reasonable defaults that can be
overridden via annotation-based configuration.
</para>
<para>
In addition to generic testing infrastructure, the TestContext
framework provides explicit support for JUnit 3.8
, JUnit 4.7
, and
framework provides explicit support for JUnit 3.8
.2, JUnit 4.5+
, and
TestNG 5.10 in the form of
<literal>
abstract
</literal>
support
classes. For JUnit 4.
7
, the framework also provides a custom
classes. For JUnit 4.
5+
, the framework also provides a custom
<interfacename>
Runner
</interfacename>
which allows one to write test
classes that are not required to extend a particular class
hierarchy.
</para>
...
...
@@ -1112,11 +1112,11 @@ public class ExtendedTest extends BaseTest {
<para>
Consider the scenario where we have a class,
<classname>
HibernateTitleDao
</classname>
(as outlined in the
<link
linkend=
"testing-fixture-di"
>
Goals
</link>
section). First, let's look
at a JUnit 4
.7
based implementation of the test class itself which
at a JUnit 4 based implementation of the test class itself which
uses
<interfacename>
@Autowired
</interfacename>
for field injection (we
will look at the application context configuration after all sample
code listings).
<emphasis>
Note: The dependency injection behavior in
the following code listings is not in any way specific to JUnit 4.
7.
the following code listings is not in any way specific to JUnit 4.
The same DI techniques can be used in conjunction with any testing
framework.
</emphasis></para>
...
...
@@ -1525,10 +1525,10 @@ public void updateWithSessionFlush() {
</section>
<section
id=
"testcontext-support-classes-junit4"
>
<title>
JUnit 4.
7
support classes
</title>
<title>
JUnit 4.
5+
support classes
</title>
<para>
The
<literal>
org.springframework.test.context.junit4
</literal>
package provides support classes for JUnit 4.
7
based test
package provides support classes for JUnit 4.
5+
based test
cases.
</para>
<itemizedlist>
...
...
@@ -1538,7 +1538,7 @@ public void updateWithSessionFlush() {
<para>
Abstract base test class which integrates the
<emphasis>
Spring TestContext Framework
</emphasis>
with explicit
<classname>
ApplicationContext
</classname>
testing support in a
JUnit 4.
7
environment.
</para>
JUnit 4.
5+
environment.
</para>
<para>
When you extend
<classname>
AbstractJUnit4SpringContextTests
</classname>
you will
...
...
@@ -1608,13 +1608,13 @@ public void updateWithSessionFlush() {
</section>
<section
id=
"testcontext-junit4-runner"
>
<title>
Custom JUnit 4.
7
Runner
</title>
<title>
Custom JUnit 4.
5+
Runner
</title>
<para>
The
<emphasis>
Spring TestContext Framework
</emphasis>
offers
full integration with JUnit 4.
7 via a custom runner. By annotating
test classes with
full integration with JUnit 4.
5+ via a custom runner (tested on
JUnit 4.5, 4.6, and 4.7). By annotating
test classes with
<literal>
@Runwith(SpringJUnit4ClassRunner.class)
</literal>
,
developers can implement standard JUnit 4.
7
unit and integration
developers can implement standard JUnit 4.
5+
unit and integration
tests and simultaneously reap the benefits of the TestContext
framework such as support for loading application contexts,
dependency injection of test instances, transactional test method
...
...
@@ -1733,7 +1733,7 @@ public class SimpleTest {
<para>
The PetClinic sample application included with the full Spring
distribution illustrates several features of the
<emphasis>
Spring
TestContext Framework
</emphasis>
in a JUnit 4.
7
environment. Most test
TestContext Framework
</emphasis>
in a JUnit 4.
5+
environment. Most test
functionality is included in the
<classname>
AbstractClinicTests
</classname>
, for which a partial listing
is shown below:
</para>
...
...
@@ -1875,7 +1875,7 @@ public class HibernateClinicTests extends AbstractClinicTests { }
<itemizedlist>
<listitem>
<para><ulink
url=
"http://www.junit.org/"
>
JUnit
</ulink>
: the Spring
Framework's unit and integration test suite is written using JUnit 3.8
Framework's unit and integration test suite is written using JUnit 3.8
.2
and JUnit 4.7 as the testing framework.
</para>
</listitem>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录