java.lang.Object | |||
↳ | junit.framework.Assert | ||
↳ | junit.framework.TestCase | ||
↳ | org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests |
Known Direct Subclasses |
Abstract base TestCase which integrates the Spring TestContext
Framework and explicit ApplicationContext
testing support in a
JUnit 3.8 environment.
Concrete subclasses:
@ContextConfiguration
annotation to configure the
application context
org.springframework.test.context.ContextConfiguration#locations()
resource locations. If your test does not need to load an application
context, you may choose to omit the
@ContextConfiguration
declaration and configure the appropriate
TestExecutionListeners
manually.AbstractJUnit38SpringContextTests()
and
AbstractJUnit38SpringContextTests(String)
and delegate to
super();
and super(name);
respectively.
The following list constitutes all annotations currently supported directly
by AbstractJUnit38SpringContextTests
. (Note that additional
annotations may be supported by various
TestExecutionListeners
)
@DirtiesContext
(via the configured
DirtiesContextTestExecutionListener
; only supported on methods for
JUnit 3.8)@ProfileValueSourceConfiguration
@IfProfileValue
@ExpectedException
@Timed
@Repeat
JUnit 3.8 does not support before class or after class
lifecycle callbacks. The following
TestExecutionListener
methods are therefore unsupported in a JUnit 3.8
environment:
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
applicationContext | The ApplicationContext that was injected into this test instance
via setApplicationContext(ApplicationContext) . |
||||||||||
logger | Logger available to subclasses. | ||||||||||
profileValueSource | ProfileValueSource available to subclasses but primarily intended
for internal use to provide support for @IfProfileValue . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new AbstractJUnit38SpringContextTests instance; initializes
the internal
TestContextManager for the current test; and
retrieves the configured (or default) ProfileValueSource . | |||||||||||
Constructs a new AbstractJUnit38SpringContextTests instance with the
supplied
name ; initializes the internal
TestContextManager for the current test; and retrieves the
configured (or default) ProfileValueSource . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the number of tests disabled in this environment.
| |||||||||||
Runs the Spring TestContext Framework test sequence.
| |||||||||||
Sets the
ApplicationContext to be used by this test instance,
provided via ApplicationContextAware semantics. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Records the supplied test method as disabled in the current
environment by incrementing the total number of disabled tests and
logging a debug message.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
junit.framework.TestCase
| |||||||||||
From class
junit.framework.Assert
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
junit.framework.Test
| |||||||||||
From interface
org.springframework.context.ApplicationContextAware
|
The ApplicationContext
that was injected into this test instance
via setApplicationContext(ApplicationContext)
.
Logger available to subclasses.
ProfileValueSource
available to subclasses but primarily intended
for internal use to provide support for @IfProfileValue
.
Constructs a new AbstractJUnit38SpringContextTests instance; initializes
the internal TestContextManager
for the current test; and
retrieves the configured (or default) ProfileValueSource
.
Constructs a new AbstractJUnit38SpringContextTests instance with the
supplied name
; initializes the internal
TestContextManager
for the current test; and retrieves the
configured (or default) ProfileValueSource
.
name | the name of the current test to execute |
---|
Return the number of tests disabled in this environment.
Runs the Spring TestContext Framework test sequence.
In addition to standard runBare()
semantics, this
implementation performs the following:
prepareTestInstance()
,
beforeTestMethod()
, and
afterTestMethod()
on this test's TestContextManager
at the
appropriate test execution points.@IfProfileValue
.@Repeat
.@Timed
.@ExpectedException
.Throwable |
---|
Sets the ApplicationContext
to be used by this test instance,
provided via ApplicationContextAware
semantics.
applicationContext | the ApplicationContext object to be used by this object |
---|
Records the supplied test method as disabled in the current environment by incrementing the total number of disabled tests and logging a debug message.
testMethod | the test method that is disabled. |
---|