SpringSource/spring-framework — pull request #277 by gpitteloud (2013-04-22 09:54:38+00:00)
Title: Add support for @Parameters in SpringJUnit4ClassRunner

Prior to this commit, it was not possible to use JUnit's @Parameters
annotation in a test that runs within the Spring TestContext
framework, in order to run each test multiple times with values
defined by the invocation of the @Parameters static method, as it is
the case with JUnit's Parameterized runner.

This commit introduces such support, by delegating either to a
parameters-aware spring runner, or to the standard Spring runner,
depending on the presence or absence of a public static method
annotated with @Parameters.

SpringJUnit4ClassRunner now just makes the decision and delegates
to another runner. The code that was once in SpringJUnit4ClassRunner
is now in a package-protected internal runner
(InternalSpringJUnit4ClassRunner), which is used either directly or
through the package-protected, parameters-aware spring runner
(SpringJUnit4ParameterizedClassRunner).

The TestContextManager is created once and reused for each set of
parameters. If @IfProfileValue is present on the class level and the
criteria is not matched, the TestContextManager is not created,
other annotations (@ContextConfiguration, @TestExecutionListeners)
are not parsed, and the test class is immediately ignored.

@BeforeClass/@AfterClass methods and TestExecutionListener's
beforeTestClass/afterTestClass methods are each executed once for
a parameterized test class.

Issue: SPR-5292

I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.
--
Gaëtan