Skip to content

Commit 4263858

Browse files
committed
[SPR-5963] Upgraded to JUnit 4.7
1 parent 5d17515 commit 4263858

File tree

10 files changed

+30
-25
lines changed

10 files changed

+30
-25
lines changed

build.versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
org.testng.version=5.9.0
2-
org.junit.version=4.6.0
2+
org.junit.version=4.7.0

org.springframework.test/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<classpathentry kind="var" path="IVY_CACHE/javax.servlet/com.springsource.javax.servlet/2.5.0/com.springsource.javax.servlet-2.5.0.jar" sourcepath="/IVY_CACHE/javax.servlet/com.springsource.javax.servlet/2.5.0/com.springsource.javax.servlet-sources-2.5.0.jar"/>
2121
<classpathentry kind="var" path="IVY_CACHE/javax.servlet/com.springsource.javax.servlet.jsp/2.1.0/com.springsource.javax.servlet.jsp-2.1.0.jar" sourcepath="/IVY_CACHE/javax.servlet/com.springsource.javax.servlet.jsp/2.1.0/com.springsource.javax.servlet.jsp-sources-2.1.0.jar"/>
2222
<classpathentry kind="var" path="IVY_CACHE/org.junit/com.springsource.junit/3.8.2/com.springsource.junit-3.8.2.jar" sourcepath="/IVY_CACHE/org.junit/com.springsource.junit/3.8.2/com.springsource.junit-sources-3.8.2.jar"/>
23-
<classpathentry kind="var" path="IVY_CACHE/org.junit/com.springsource.org.junit/4.6.0/com.springsource.org.junit-4.6.0.jar" sourcepath="/IVY_CACHE/org.junit/com.springsource.org.junit/4.6.0/com.springsource.org.junit-sources-4.6.0.jar"/>
23+
<classpathentry kind="var" path="IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
2424
<classpathentry kind="var" path="IVY_CACHE/org.testng/com.springsource.org.testng/5.9.0/com.springsource.org.testng-5.9.0.jar" sourcepath="/IVY_CACHE/org.testng/com.springsource.org.testng/5.9.0/com.springsource.org.testng-sources-5.9.0.jar"/>
2525
<classpathentry kind="var" path="IVY_CACHE/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar" sourcepath="/IVY_CACHE/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-sources-1.1.1.jar"/>
2626
<classpathentry kind="var" path="IVY_CACHE/org.apache.taglibs/com.springsource.org.apache.taglibs.standard/1.1.2/com.springsource.org.apache.taglibs.standard-1.1.2.jar" sourcepath="/IVY_CACHE/org.apache.taglibs/com.springsource.org.apache.taglibs.standard/1.1.2/com.springsource.org.apache.taglibs.standard-sources-1.1.2.jar"/>

org.springframework.test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<dependency>
5959
<groupId>junit</groupId>
6060
<artifactId>junit</artifactId>
61-
<version>4.6</version>
61+
<version>4.7</version>
6262
</dependency>
6363
<dependency>
6464
<groupId>commons-logging</groupId>

org.springframework.test/src/main/java/org/springframework/test/context/junit4/AbstractJUnit4SpringContextTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* <p>
3333
* Abstract base test class which integrates the <em>Spring TestContext
3434
* Framework</em> with explicit {@link ApplicationContext} testing support in a
35-
* <strong>JUnit 4.6</strong> environment.
35+
* <strong>JUnit 4.7</strong> environment.
3636
* </p>
3737
* <p>
3838
* Concrete subclasses should typically declare a class-level

org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* <p>
5151
* <code>SpringJUnit4ClassRunner</code> is a custom extension of
5252
* {@link BlockJUnit4ClassRunner} which provides functionality of the
53-
* <em>Spring TestContext Framework</em> to standard JUnit 4.6+ tests by means
53+
* <em>Spring TestContext Framework</em> to standard JUnit 4.7+ tests by means
5454
* of the {@link TestContextManager} and associated support classes and
5555
* annotations.
5656
* </p>
@@ -76,7 +76,7 @@
7676
* </ul>
7777
* <p>
7878
* <b>NOTE:</b> As of Spring 3.0, <code>SpringJUnit4ClassRunner</code> requires
79-
* JUnit 4.6.
79+
* JUnit 4.7.
8080
* </p>
8181
*
8282
* @author Sam Brannen
@@ -249,6 +249,11 @@ protected void runChild(FrameworkMethod frameworkMethod, RunNotifier notifier) {
249249
}
250250
}
251251

252+
private EachTestNotifier makeNotifier(FrameworkMethod method, RunNotifier notifier) {
253+
Description description = describeChild(method);
254+
return new EachTestNotifier(notifier, description);
255+
}
256+
252257
/**
253258
* Augments the default JUnit behavior
254259
* {@link #withPotentialRepeat(FrameworkMethod, Object, Statement) with

org.springframework.test/src/main/java/org/springframework/test/context/junit4/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* <p>Support classes for ApplicationContext-based and transactional
3-
* tests run with JUnit 4.6 and the <em>Spring TestContext Framework</em>.</p>
3+
* tests run with JUnit 4.7 and the <em>Spring TestContext Framework</em>.</p>
44
*/
55

66
package org.springframework.test.context.junit4;

org.springframework.test/src/main/java/org/springframework/test/context/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* that is agnostic of the actual testing framework in use. The same
55
* techniques and annotation-based configuration used in, for example, a
66
* JUnit 3.8 environment can also be applied to tests written with JUnit
7-
* 4.6, TestNG, etc.</p>
7+
* 4.7, TestNG, etc.</p>
88
*
99
* <p>In addition to providing generic and extensible testing
1010
* infrastructure, the Spring TestContext Framework provides out-of-the-box

org.springframework.test/template.mf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Import-Template:
1717
org.apache.commons.logging.*;version="[1.1.1, 2.0.0)",
1818
org.apache.taglibs.standard.*;version="[1.1.0, 2.0.0)";resolution:=optional,
1919
org.aspectj.weaver.*;version="[1.5.4, 2.0.0)";resolution:=optional,
20-
org.junit.*;version="[4.6.0, 5.0.0)";resolution:=optional,
20+
org.junit.*;version="[4.7.0, 5.0.0)";resolution:=optional,
2121
org.springframework.*;version="[3.0.0, 3.0.1)";resolution:=optional,
2222
org.testng.*;version="[5.9.0, 6.0.0)";resolution:=optional,
2323
org.w3c.dom.*;version="0";resolution:=optional

org.springframework.test/test.iml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@
7878
<orderEntry type="module-library">
7979
<library>
8080
<CLASSES>
81-
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.6.0/com.springsource.org.junit-4.6.0.jar!/" />
81+
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar!/" />
8282
</CLASSES>
8383
<JAVADOC />
8484
<SOURCES>
85-
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.6.0/com.springsource.org.junit-sources-4.6.0.jar!/" />
85+
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar!/" />
8686
</SOURCES>
8787
</library>
8888
</orderEntry>

spring-framework-reference/src/testing.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ public void testProcessWithoutTransaction() {
622622
when used in conjunction with JUnit (i.e., with the <link
623623
linkend="testcontext-junit4-runner">SpringJUnit4ClassRunner</link> or
624624
the <link linkend="testcontext-support-classes-junit38">JUnit 3.8</link>
625-
and <link linkend="testcontext-support-classes-junit4">JUnit 4.6</link>
625+
and <link linkend="testcontext-support-classes-junit4">JUnit 4.7</link>
626626
support classes.</para>
627627

628628
<itemizedlist>
@@ -813,15 +813,15 @@ public void testProcessRepeatedly() {
813813
<literal>org.springframework.test.context</literal> package) provides
814814
generic, annotation-driven unit and integration testing support that
815815
is agnostic of the testing framework in use, for example JUnit 3.8,
816-
JUnit 4.6, TestNG 5.9, etc. The TestContext framework also places a
816+
JUnit 4.7, TestNG 5.9, etc. The TestContext framework also places a
817817
great deal of importance on <emphasis>convention over
818818
configuration</emphasis> with reasonable defaults that can be
819819
overridden via annotation-based configuration.</para>
820820

821821
<para>In addition to generic testing infrastructure, the TestContext
822-
framework provides explicit support for JUnit 3.8, JUnit 4.6, and
822+
framework provides explicit support for JUnit 3.8, JUnit 4.7, and
823823
TestNG 5.9 in the form of <literal>abstract</literal> support
824-
classes. For JUnit 4.6, the framework also provides a custom
824+
classes. For JUnit 4.7, the framework also provides a custom
825825
<interfacename>Runner</interfacename> which allows one to write test
826826
classes that are not required to extend a particular class
827827
hierarchy.</para>
@@ -1112,11 +1112,11 @@ public class ExtendedTest extends BaseTest {
11121112
<para>Consider the scenario where we have a class,
11131113
<classname>HibernateTitleDao</classname> (as outlined in the <link
11141114
linkend="testing-fixture-di">Goals</link> section). First, let's look
1115-
at a JUnit 4.6 based implementation of the test class itself which
1115+
at a JUnit 4.7 based implementation of the test class itself which
11161116
uses <interfacename>@Autowired</interfacename> for field injection (we
11171117
will look at the application context configuration after all sample
11181118
code listings). <emphasis>Note: The dependency injection behavior in
1119-
the following code listings is not in any way specific to JUnit 4.6.
1119+
the following code listings is not in any way specific to JUnit 4.7.
11201120
The same DI techniques can be used in conjunction with any testing
11211121
framework.</emphasis></para>
11221122

@@ -1525,10 +1525,10 @@ public void updateWithSessionFlush() {
15251525
</section>
15261526

15271527
<section id="testcontext-support-classes-junit4">
1528-
<title>JUnit 4.6 support classes</title>
1528+
<title>JUnit 4.7 support classes</title>
15291529

15301530
<para>The <literal>org.springframework.test.context.junit4</literal>
1531-
package provides support classes for JUnit 4.6 based test
1531+
package provides support classes for JUnit 4.7 based test
15321532
cases.</para>
15331533

15341534
<itemizedlist>
@@ -1538,7 +1538,7 @@ public void updateWithSessionFlush() {
15381538
<para>Abstract base test class which integrates the
15391539
<emphasis>Spring TestContext Framework</emphasis> with explicit
15401540
<classname>ApplicationContext</classname> testing support in a
1541-
JUnit 4.6 environment.</para>
1541+
JUnit 4.7 environment.</para>
15421542

15431543
<para>When you extend
15441544
<classname>AbstractJUnit4SpringContextTests</classname> you will
@@ -1608,13 +1608,13 @@ public void updateWithSessionFlush() {
16081608
</section>
16091609

16101610
<section id="testcontext-junit4-runner">
1611-
<title>Custom JUnit 4.6 Runner</title>
1611+
<title>Custom JUnit 4.7 Runner</title>
16121612

16131613
<para>The <emphasis>Spring TestContext Framework</emphasis> offers
1614-
full integration with JUnit 4.6 via a custom runner. By annotating
1614+
full integration with JUnit 4.7 via a custom runner. By annotating
16151615
test classes with
16161616
<literal>@Runwith(SpringJUnit4ClassRunner.class)</literal>,
1617-
developers can implement standard JUnit 4.6 unit and integration
1617+
developers can implement standard JUnit 4.7 unit and integration
16181618
tests and simultaneously reap the benefits of the TestContext
16191619
framework such as support for loading application contexts,
16201620
dependency injection of test instances, transactional test method
@@ -1733,7 +1733,7 @@ public class SimpleTest {
17331733

17341734
<para>The PetClinic sample application included with the full Spring
17351735
distribution illustrates several features of the <emphasis>Spring
1736-
TestContext Framework</emphasis> in a JUnit 4.6 environment. Most test
1736+
TestContext Framework</emphasis> in a JUnit 4.7 environment. Most test
17371737
functionality is included in the
17381738
<classname>AbstractClinicTests</classname>, for which a partial listing
17391739
is shown below:</para>
@@ -1876,7 +1876,7 @@ public class HibernateClinicTests extends AbstractClinicTests { }
18761876
<listitem>
18771877
<para><ulink url="http://www.junit.org/">JUnit</ulink>: the Spring
18781878
Framework's unit and integration test suite is written using JUnit 3.8
1879-
and JUnit 4.6 as the testing framework.</para>
1879+
and JUnit 4.7 as the testing framework.</para>
18801880
</listitem>
18811881

18821882
<listitem>

0 commit comments

Comments
 (0)