[SPR-5963] Upgraded to JUnit 4.7

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1731 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Sam Brannen 2009-08-11 10:12:20 +00:00
parent 91727b2feb
commit 2dda490944
10 changed files with 30 additions and 25 deletions

View File

@ -1,2 +1,2 @@
org.testng.version=5.9.0
org.junit.version=4.6.0
org.junit.version=4.7.0

View File

@ -20,7 +20,7 @@
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>

View File

@ -58,7 +58,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.6</version>
<version>4.7</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>

View File

@ -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.6</strong> environment.
* <strong>JUnit 4.7</strong> environment.
* </p>
* <p>
* Concrete subclasses should typically declare a class-level

View File

@ -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.6+ tests by means
* <em>Spring TestContext Framework</em> to standard JUnit 4.7+ 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.6.
* JUnit 4.7.
* </p>
*
* @author Sam Brannen
@ -249,6 +249,11 @@ public class SpringJUnit4ClassRunner extends BlockJUnit4ClassRunner {
}
}
private EachTestNotifier makeNotifier(FrameworkMethod method, RunNotifier notifier) {
Description description = describeChild(method);
return new EachTestNotifier(notifier, description);
}
/**
* Augments the default JUnit behavior
* {@link #withPotentialRepeat(FrameworkMethod, Object, Statement) with

View File

@ -1,6 +1,6 @@
/**
* <p>Support classes for ApplicationContext-based and transactional
* tests run with JUnit 4.6 and the <em>Spring TestContext Framework</em>.</p>
* tests run with JUnit 4.7 and the <em>Spring TestContext Framework</em>.</p>
*/
package org.springframework.test.context.junit4;

View File

@ -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.6, TestNG, etc.</p>
* 4.7, TestNG, etc.</p>
*
* <p>In addition to providing generic and extensible testing
* infrastructure, the Spring TestContext Framework provides out-of-the-box

View File

@ -17,7 +17,7 @@ Import-Template:
org.apache.commons.logging.*;version="[1.1.1, 2.0.0)",
org.apache.taglibs.standard.*;version="[1.1.0, 2.0.0)";resolution:=optional,
org.aspectj.weaver.*;version="[1.5.4, 2.0.0)";resolution:=optional,
org.junit.*;version="[4.6.0, 5.0.0)";resolution:=optional,
org.junit.*;version="[4.7.0, 5.0.0)";resolution:=optional,
org.springframework.*;version="[3.0.0, 3.0.1)";resolution:=optional,
org.testng.*;version="[5.9.0, 6.0.0)";resolution:=optional,
org.w3c.dom.*;version="0";resolution:=optional

View File

@ -78,11 +78,11 @@
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.6.0/com.springsource.org.junit-4.6.0.jar!/" />
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.6.0/com.springsource.org.junit-sources-4.6.0.jar!/" />
<root url="jar://$IVY_CACHE$/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar!/" />
</SOURCES>
</library>
</orderEntry>

View File

@ -622,7 +622,7 @@ public void testProcessWithoutTransaction() {
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.6</link>
and <link linkend="testcontext-support-classes-junit4">JUnit 4.7</link>
support classes.</para>
<itemizedlist>
@ -813,15 +813,15 @@ public void testProcessRepeatedly() {
<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.6, TestNG 5.9, etc. The TestContext framework also places a
JUnit 4.7, TestNG 5.9, 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.6, and
framework provides explicit support for JUnit 3.8, JUnit 4.7, and
TestNG 5.9 in the form of <literal>abstract</literal> support
classes. For JUnit 4.6, the framework also provides a custom
classes. For JUnit 4.7, 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.6 based implementation of the test class itself which
at a JUnit 4.7 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.6.
the following code listings is not in any way specific to JUnit 4.7.
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.6 support classes</title>
<title>JUnit 4.7 support classes</title>
<para>The <literal>org.springframework.test.context.junit4</literal>
package provides support classes for JUnit 4.6 based test
package provides support classes for JUnit 4.7 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.6 environment.</para>
JUnit 4.7 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.6 Runner</title>
<title>Custom JUnit 4.7 Runner</title>
<para>The <emphasis>Spring TestContext Framework</emphasis> offers
full integration with JUnit 4.6 via a custom runner. By annotating
full integration with JUnit 4.7 via a custom runner. By annotating
test classes with
<literal>@Runwith(SpringJUnit4ClassRunner.class)</literal>,
developers can implement standard JUnit 4.6 unit and integration
developers can implement standard JUnit 4.7 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.6 environment. Most test
TestContext Framework</emphasis> in a JUnit 4.7 environment. Most test
functionality is included in the
<classname>AbstractClinicTests</classname>, for which a partial listing
is shown below:</para>
@ -1876,7 +1876,7 @@ public class HibernateClinicTests extends AbstractClinicTests { }
<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
and JUnit 4.6 as the testing framework.</para>
and JUnit 4.7 as the testing framework.</para>
</listitem>
<listitem>