|
spring-test | ||||||||
PREV NEXT | FRAMES NO FRAMES |
AbstractTransactionalJUnit4SpringContextTests
)AbstractAnnotationAwareTransactionalTests.AbstractAnnotationAwareTransactionalTests(String)
.
name
and retrieves the configured (or
default) ProfileValueSource
.
AbstractJUnit38SpringContextTests
)ContextLoader
SPI.AbstractJUnit4SpringContextTests
)AbstractContextLoader
that loads a
GenericApplicationContext
.AbstractJUnit38SpringContextTests
)AbstractJUnit4SpringContextTests
TestContextManager
for the current test; and
retrieves the configured (or default) ProfileValueSource
.
name
; initializes the internal
TestContextManager
for the current test; and retrieves the
configured (or default) ProfileValueSource
.
ApplicationContext
testing support in a
JUnit 4.5+ environment.AbstractJUnit38SpringContextTests
)
or ModelAndViewAssert
with JUnit 4 and TestNG.AbstractJUnit4SpringContextTests
)AbstractJUnit4SpringContextTests
)TestExecutionListener
interface which
provides empty method stubs.ApplicationContext
testing support in a TestNG
environment.TestContextManager
for the current test.
AbstractTransactionalJUnit4SpringContextTests
)AbstractTransactionalJUnit4SpringContextTests
name
.
transactional
extension of
AbstractJUnit4SpringContextTests
which adds convenience functionality
for JDBC access.AbstractTransactionalJUnit4SpringContextTests
)transactional
extension of
AbstractTestNGSpringContextTests
which adds convenience functionality
for JDBC access.ActiveProfiles
is a class-level annotation that is used to declare
which active bean definition profiles should be used when loading
an ApplicationContext
for test classes.test context
is
annotated with @DirtiesContext
, the
application context
of the test context will
be marked as dirty
,
and the
REINJECT_DEPENDENCIES_ATTRIBUTE
in the test context will be set to
true
.
test
context
is annotated with @DirtiesContext
,
or if the test class is annotated with @DirtiesContext
and the class
mode
is set to AFTER_EACH_TEST_METHOD
, the application
context
of the test context will be
marked as dirty
and the
REINJECT_DEPENDENCIES_ATTRIBUTE
in the test context will be set to
true
.
test method
, for example for tearing down test fixtures,
ending a transaction, etc.
test method
in the supplied
test context
, for example by tearing down test
fixtures.
test context
, this method will end the transaction
and run @AfterTransaction methods
.
public void
method should be executed after a transaction is ended for test
methods configured to run within a transaction via the
@Transactional
annotation.AbstractGenericContextLoader
that loads
bean definitions from annotated classes.ApplicationContext
that was injected into this test instance
via AbstractJUnit38SpringContextTests.setApplicationContext(ApplicationContext)
.
ApplicationContext
that was injected into this test instance
via AbstractJUnit4SpringContextTests.setApplicationContext(ApplicationContext)
.
ApplicationContext
that was injected into this test instance
via AbstractTestNGSpringContextTests.setApplicationContext(ApplicationContext)
.
modelName
exists and checks it type, based on the expectedType
.
modelName
exists and checks it type, based on the expectedType
.
expectedValue
to the value from the model
bound under the given modelName
.
expectedValue
to the value from the model
bound under the given modelName
.
expectedModel
to see if all elements in the
model appear and are equal.
expectedModel
to see if all elements in the
model appear and are equal.
@Test(expected=...)
supportAssertThrows
class.
AssertThrows
class.
expectedName
.
expectedName
.
DependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE
in the supplied
test context
has a value of Boolean.TRUE
,
this method will have the same effect as
prepareTestInstance()
;
otherwise, this method will have no effect.
test method
, for example for setting up test fixtures,
starting a transaction, etc.
test method
in the supplied
test context
, for example by setting up test
fixtures.
test context
is
configured to run within a transaction, this method will run
@BeforeTransaction methods
and start a new
transaction.
public void
method should be executed before a transaction is started for test
methods configured to run within a transaction via the
@Transactional
annotation.Exception
that was thrown in the body of a test is
an instance of the AssertThrows.getExpectedException()
class (or an
instance of a subclass).
AbstractJUnit4SpringContextTests
)ContextConfiguration
defines class-level metadata that is
used to determine how to load and configure an
ApplicationContext
for test classes.ContextConfigurationAttributes
encapsulates the context
configuration attributes declared on a test class via
@ContextConfiguration
.ContextConfigurationAttributes
instance for the
supplied @ContextConfiguration
annotation and
the test class
that declared it.
ContextConfigurationAttributes
instance for the
test class
that declared the
@ContextConfiguration
annotation and its
corresponding attributes.
application context
for an integration test managed by the Spring TestContext Framework.ConfigurableApplicationContext
for use by this test.
BeanDefinitionReader
s for
loading bean definitions into the supplied
context
.
BeanDefinitionReader
for loading
bean definitions into the supplied context
.
AnnotationConfigContextLoader
should be used as a
SmartContextLoader
,
not as a legacy ContextLoader
.
PropertiesBeanDefinitionReader
.
XmlBeanDefinitionReader
.
EntityManagerFactory.createEntityManager()
(which requires an explicit joinTransaction()
call).
Exception
is thrown in the body of the test.
TestContextManager
to
prepare the test instance before returning it.
TestContextManager
for the supplied test class and
the configured default ContextLoader
class name.
ContextLoader
.
GenericApplicationContext
created by this
ContextLoader
after bean definitions have been
loaded into the context but before the context is refreshed.
aop.xml
file in the class path:
"META-INF/aop.xml"
ServletInputStream
.ServletOutputStream
.DelegatingSmartContextLoader
is an implementation of the SmartContextLoader
SPI that delegates to a set of candidate SmartContextLoaders (i.e.,
GenericXmlContextLoader
and AnnotationConfigContextLoader
) to
determine which context loader is appropriate for a given test class's configuration.TestExecutionListener
which provides support for dependency
injection and initialization of test instances.MockHttpSession.serializeState()
.
ApplicationContext
associated with a test is dirty and should be closed:
after the current test, when declared at the method level
after each test method in the current test class, when declared at the
class level with class mode set to AFTER_EACH_TEST_METHOD
after the current test class, when declared at the class level with class
mode set to AFTER_CLASS
@DirtiesContext
is interpreted when used to annotate a test class.TestExecutionListener
which provides support for marking the
ApplicationContext
associated with a test as dirty for
both test classes and test methods configured with the @DirtiesContext
annotation.application context
of the supplied
test context
as
dirty
, and sets the
REINJECT_DEPENDENCIES_ATTRIBUTE
in the test context to true
.
MockHttpServletResponse.encodeURL(java.lang.String)
,
returning the given URL String as-is.
complete
and rollback
flags.
MergedContextConfiguration
instance by comparing both object's locations
,
annotated classes
, active profiles
, and the fully qualified names of their
ContextLoaders
.
Statement
in the execution chain (typically an
instance of RunAfters
), catching any exceptions thrown, and then calls
TestContextManager.afterTestClass()
.
Statement
in the execution chain (typically an
instance of RunAfters
), catching any exceptions thrown, and then calls
TestContextManager.afterTestMethod(Object, Method, Throwable)
with the first
caught exception (if any).
TestContextManager.beforeTestClass()
and then invokes the
next Statement
in the execution chain (typically an instance of
RunBefores
).
TestContextManager.beforeTestMethod(Object, Method)
and
then invokes the next Statement
in the execution chain (typically
an instance of RunBefores
).
statement
in the execution chain
(typically an instance of
InvokeMethod
or ExpectException
) and throws an exception if the next
statement
takes more than the specified timeout
.
statement
in the execution chain for
the specified repeat count.
@ProfileValueSourceConfiguration
instead.
AnnotationConfigContextLoader
should be used as a
SmartContextLoader
,
not as a legacy ContextLoader
.
AbstractGenericContextLoader
that reads
bean definitions from Java Properties
resources.AbstractGenericContextLoader
that reads
bean definitions from XML resources.test class
.
aop.xml
file
in the class path.
AssertThrows.test()
, if any.
null
.
application context
for this test
context, possibly cached.
@ContextConfiguration
.
test class
.
AbstractSingleSpringContextTests.contextKey()
and
AbstractSingleSpringContextTests.loadContext(Object)
instead.
ContextLoader
for the test class
.
ContextLoader
class that was declared via
@ContextConfiguration
.
class
that declared the
@ContextConfiguration
annotation.
ContextLoader
class to use for
the supplied test class.
TestExecutionListener
classes.
@IfProfileValue
at the class-level, and
otherwise delegates to the parent implementation.
Exception
expected to be thrown during
the execution of the surrounding test.
exception
that the supplied test method
is expected to throw.
name
from the provided target object.
timeout
from the @Test
annotation on the supplied test method
.
@ContextConfiguration
.
test class
.
HttpServletResponseWrapper
decorators if necessary.
MockFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
has been called with.
ApplicationContext
resource locations
when generating default locations.
AnnotationConfigContextLoader
should be used as a
SmartContextLoader
,
not as a legacy ContextLoader
.
-context.properties
".
-context.xml
".
MockFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
has been called with.
null
).
timeout
from the
@Timed
annotation on the supplied
test method
.
null
).
test class
associated with this MergedContextConfiguration
.
test class
for this test context.
TestContext
managed by this
TestContextManager
.
TestContextManager
associated with this runner.
exception
that was thrown during execution of
the test method
.
TestExecutionListeners
registered for this TestContextManager
.
test instance
for this test context.
test method
for this test context.
transaction manager
to use
for the supplied test context
.
PlatformTransactionManager
that is to
be used to drive transactions.
ContextConfigurationAttributes
instance has
class-based resources.
MergedContextConfiguration
excluding the
test class
.
ContextConfigurationAttributes
instance has
path-based resource locations.
ContextConfigurationAttributes
instance has
either path-based resource locations or class-based resources.
TestContext
as described in
prepareTestInstance()
.
name
on the supplied
target object with the supplied value
.
name
on the supplied target
object with the supplied arguments.
name
on the supplied
target object with the supplied value
.
name
on the supplied
target object with the supplied value
.
key
is empty.
test context
.
testMethod
should
run in the current environment.
locations
provided to
AbstractContextLoader.processLocations(Class, String...)
are null
or empty.
inheritLocations
flag that was declared via
@ContextConfiguration
.
MockHttpServletResponse.getOutputStream()
access is allowed.
default rollback
flag and a possible
method-level override via the @Rollback
annotation.
test context
by taking into consideration the
default rollback
flag and a
possible method-level override via the Rollback
annotation.
testClass
is enabled in
the current environment, as specified by the @IfProfileValue
annotation at the class level.
testMethod
is enabled in
the current environment, as specified by the @IfProfileValue
annotation, which may be declared on the test
method itself or at the class level.
testMethod
is enabled in
the current environment, as specified by the @IfProfileValue
annotation, which may be declared on the test
method itself or at the class level.
true
if @Ignore
is present for
the supplied test method
or if the test method is
disabled via @IfProfileValue
.
MockHttpServletResponse.getOutputStream()
access is allowed.
context
from the locations or classes in the supplied MergedContextConfiguration
.
context
from the classes in the supplied MergedContextConfiguration
.
context
based on the supplied
locations
, configures the context, and finally returns
the context in fully refreshed state.
context
based on the supplied
merged context configuration
,
configures the context, and finally returns the context in a fully
refreshed state.
MergedContextConfiguration
.
locations
.
SmartContextLoader
to load
an ApplicationContext
.
DelegatingSmartContextLoader
does not support the
ContextLoader.loadContext(String...)
method.
application
context
associated with this test context is dirty and should
be reloaded.
MergedContextConfiguration
encapsulates the merged
context configuration declared on a test class and all of its superclasses
via @ContextConfiguration
and
@ActiveProfiles
.MergedContextConfiguration
instance for the
supplied test class, resource locations, annotated classes, active
profiles, and ContextLoader
.
with
potential repeats
of the entire execution chain.
MockPropertySource
instances not
otherwise given an explicit name.
ActionRequest
interface.MockPortalContext
and a default MockPortletContext
.
MockPortalContext
and a default MockPortletContext
.
MockPortalContext
and a default MockPortletContext
.
MockPortalContext
.
ActionResponse
interface.MockPortalContext
.
BaseURL
interface.BodyContent
class.CacheControl
interface.ClientDataRequest
interface.MockPortalContext
and a default MockPortletContext
.
MockPortalContext
.
Event
interface.EventRequest
interface.MockPortalContext
and a default MockPortletContext
.
MockPortalContext
.
EventResponse
interface.ExpressionEvaluator
interface, delegating to the
Jakarta JSTL ExpressionEvaluatorManager.FilterConfig
interface.FilterConfig
interface.MockServletContext
.
MockServletContext
.
HttpServletRequest
interface.MockServletContext
.
MockServletContext
.
HttpServletResponse
interface.HttpSession
interface.MockServletContext
.
JspWriter
class.MimeResponse
interface.MockPortalContext
.
MultipartActionRequest
interface.MultipartFile
interface.MultipartHttpServletRequest
interface.PageContext
interface.MockServletContext
,
MockHttpServletRequest
, MockHttpServletResponse
,
MockServletConfig
.
MockHttpServletRequest
,
MockHttpServletResponse
, MockServletConfig
.
PortalContext
interface.PortletConfig
interface.MockPortletContext
.
MockPortletContext
.
PortletContext
interface.PortletPreferences
interface.PortletRequest
interface.MockPortalContext
and a default MockPortletContext
.
MockPortalContext
.
PortletRequestDispatcher
interface.PortletResponse
interface.MockPortalContext
.
PortletSession
interface.MockPortletContext
.
PortletURL
interface.PropertySource
implementation for use in testing.MockPropertySource
named "mockProperties"
that will maintain its own internal Properties
instance.
MockPropertySource
with the given name that will
maintain its own internal Properties
instance.
MockPropertySource
named "mockProperties"
and backed by the given Properties
object.
MockPropertySource
with with the given name and backed by the given
Properties
object
RenderRequest
interface.MockPortalContext
and a default MockPortletContext
.
MockPortalContext
and a default MockPortletContext
.
MockPortalContext
and a default MockPortletContext
.
MockPortalContext
.
RenderResponse
interface.MockPortalContext
.
RequestDispatcher
interface.ResourceRequest
interface.MockPortalContext
and a default MockPortletContext
.
MockPortalContext
and a default MockPortletContext
.
MockPortalContext
and a default MockPortletContext
.
MockPortalContext
.
ResourceResponse
interface.ResourceURL
interface.ServletConfig
interface.MockServletContext
.
MockServletContext
.
ServletContext
interface.StateAwareResponse
interface.MockPortalContext
.
ModelAndView
objects.AnnotationConfigContextLoader
should be used as a
SmartContextLoader
,
not as a legacy ContextLoader
.
@BeforeTransaction
or
@AfterTransaction
method.setUp()
method, which is final in this class.
statements
used in the Spring TestContext Framework.FilterConfig
interface which
simply passes the call through to a given Filter/FilterChain combination
(indicating the next Filter in the chain along with the FilterChain that it is
supposed to work on) or to a given Servlet (indicating the end of the chain).BlockJUnit4ClassRunner.possiblyExpectingExceptions(FrameworkMethod, Object, Statement)
except that the expected exception is retrieved using
SpringJUnit4ClassRunner.getExpectedException(FrameworkMethod)
.
GenericApplicationContext
created by this ContextLoader
.
test instance
of the supplied
test context
by
autowiring
and
initializing
the test instance via its own
application context
(without
checking dependencies).
test instance
of the supplied
test context
, for example by injecting dependencies.
ConditionalTestCase.runBare()
method to prevent
transactional execution.
ContextConfigurationAttributes
for a given test class.
ContextLoader
SPI, the
default implementation simply delegates to AbstractContextLoader.processLocations(Class, String...)
,
passing it the declaring class
and resource locations
retrieved from the supplied
configuration attributes
.
ContextConfigurationAttributes
.
SmartContextLoaders
to process the supplied
ContextConfigurationAttributes
.
locations
are null
or
empty and AbstractContextLoader.isGenerateDefaultLocations()
returns
true
, default locations will be
generated
for the specified
class
and the configured
resource suffix
; otherwise, the supplied
locations
will be modified
if
necessary and returned.
DelegatingSmartContextLoader
does not support the
ContextLoader.processLocations(Class, String...)
method.
ProfileValueSource
available to subclasses but primarily intended
for use in AbstractAnnotationAwareTransactionalTests.isDisabledInThisEnvironment(Method)
.
ProfileValueSource
available to subclasses but primarily intended
for internal use to provide support for @IfProfileValue
.
ProfileValueSource
to use when retrieving
profile values configured via the @IfProfileValue
annotation.ReflectionTestUtils
is a collection of reflection-based utility
methods for use in unit and integration testing scenarios.TestExecutionListeners
by appending them to the set of listeners used by this TestContextManager
.
TestContext
attribute which indicates
whether or not the dependencies of a test instance should be
reinjected in
beforeTestMethod()
.
ProfileValueSource
type for the specified
test class
as configured via the
@ProfileValueSourceConfiguration
annotation and instantiates a new
instance of that type.
test
method
in the supplied callback
to execute the actual test
and then tracks the exception thrown during test execution, if any.
RunAfterTestClassCallbacks
is a custom JUnit 4.5+
Statement
which allows the Spring TestContext Framework to
be plugged into the JUnit execution chain by calling
afterTestClass()
on the supplied
TestContextManager
.RunAfterTestClassCallbacks
statement.
RunAfterTestMethodCallbacks
is a custom JUnit 4.5+
Statement
which allows the Spring TestContext Framework to
be plugged into the JUnit execution chain by calling
afterTestMethod()
on the supplied TestContextManager
.RunAfterTestMethodCallbacks
statement.
@AfterTransaction methods
for the
specified test context
.
RunBeforeTestClassCallbacks
is a custom JUnit 4.5+
Statement
which allows the Spring TestContext Framework to
be plugged into the JUnit execution chain by calling
beforeTestClass()
on the
supplied TestContextManager
.RunBeforeTestClassCallbacks
statement.
RunBeforeTestMethodCallbacks
is a custom JUnit 4.5+
Statement
which allows the Spring TestContext Framework to
be plugged into the JUnit execution chain by calling
beforeTestMethod()
on the supplied TestContextManager
.RunBeforeTestMethodCallbacks
statement.
@BeforeTransaction methods
for the
specified test context
.
BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier)
,
except that tests are determined to be ignored by
SpringJUnit4ClassRunner.isTestMethodIgnored(FrameworkMethod)
.
test logic
and the
checking
of the
resulting (expected) Exception
.
PortletContext
interface,
wrapping an underlying ServletContext
.ApplicationContext
to be used by this test instance,
provided via ApplicationContextAware
semantics.
ApplicationContext
to be used by this test instance,
provided via ApplicationContextAware
semantics.
ApplicationContext
to be used by this test instance,
provided via ApplicationContextAware
semantics.
@ContextConfiguration
.
rollback
.
field
with the given name
on the provided
target object
to the supplied value
.
field
with the given name
on the provided
target object
to the supplied value
.
@ContextConfiguration
.
MockHttpServletResponse.getOutputStream()
access is allowed.
Properties
object.
ConditionalTestCase.runBare()
method to override
the transaction attributes that will be used, so that AbstractSingleSpringContextTests.setUp()
and AbstractSingleSpringContextTests.tearDown()
behavior is modified.
MockHttpServletResponse.getWriter()
access is allowed.
application context
for an integration test managed by the Spring TestContext Framework.SpringFailOnTimeout
is a custom JUnit 4.5+ Statement
which adds support for Spring's @Timed
annotation by throwing
an exception if the next statement in the execution chain takes more than the
specified number of milliseconds.SpringFailOnTimeout
statement.
SpringJUnit4ClassRunner
is a custom extension of
BlockJUnit4ClassRunner
which provides functionality of the
Spring TestContext Framework to standard JUnit 4.5+ tests by means
of the TestContextManager
and associated support classes and
annotations.SpringJUnit4ClassRunner
and initializes a
TestContextManager
to provide Spring testing functionality to
standard JUnit tests.
SpringRepeat
is a custom JUnit 4.5+ Statement
which adds
support for Spring's @Repeat
annotation by repeating the
test for the specified number of times.SpringRepeat
statement.
TestContextManager
to call
'after test class'
callbacks.
TestContextManager
to
post-process
the test method after the actual test has executed.
TestContextManager
to call
'before test class'
callbacks.
TestContextManager
to
pre-process
the test method before the actual test is executed.
TestContextManager
to
prepare
this test
instance prior to execution of any individual tests, for example for
injecting dependencies, etc.
ProfileValueSource
which uses system properties as
the underlying source.abstract
method and
provide the test logic.
TestContext
encapsulates the context in which a test is executed,
agnostic of the actual testing framework in use.TestContextManager
is the main entry point into the
Spring TestContext Framework, which provides support for loading and
accessing application contexts
, dependency
injection of test instances,
transactional
execution of test methods, etc.TestContextManager.TestContextManager(Class, String)
with a value of
null
for the default ContextLoader
class name.
TestContextManager
for the specified test class
and automatically registers
the
TestExecutionListeners
configured for the test class
via the @TestExecutionListeners
annotation.
TestExecutionListener
defines a listener API for
reacting to test execution events published by the TestContextManager
with which the listener is registered.TestExecutionListeners
defines class-level metadata for
configuring which TestExecutionListeners
should
be registered with a TestContextManager
.specified time period
.test class
,
locations
, annotated classes
,
active profiles
, and the name of the
ContextLoader
.
TestExecutionListener
that provides support for executing
tests within transactions by using the
@Transactional
and @NotTransactional
annotations.Statement
returned by the parent implementation with a
RunAfterTestClassCallbacks
statement, thus preserving the default
functionality but adding support for the Spring TestContext Framework.
Statement
returned by the parent implementation with a
RunAfterTestMethodCallbacks
statement, thus preserving the
default functionality but adding support for the Spring TestContext
Framework.
Statement
returned by the parent implementation with a
RunBeforeTestClassCallbacks
statement, thus preserving the
default functionality but adding support for the Spring TestContext
Framework.
Statement
returned by the parent implementation with a
RunBeforeTestMethodCallbacks
statement, thus preserving the
default functionality but adding support for the Spring TestContext
Framework.
@Repeat
annotation by returning a
SpringRepeat
statement initialized with the configured repeat
count or 1
if no repeat count is configured.
@Timed
and JUnit's
@Test(timeout=...)
annotations, but not both
simultaneously.
setProperty(java.lang.String, java.lang.Object)
that returns the current instance.
|
spring-test | ||||||||
PREV NEXT | FRAMES NO FRAMES |