java.lang.Object | |
↳ | org.springframework.test.context.testng.AbstractTestNGSpringContextTests |
Known Direct Subclasses |
Abstract base test class which integrates the
Spring TestContext Framework with explicit
ApplicationContext
testing support in a TestNG
environment.
Concrete subclasses:
@ContextConfiguration
annotation to configure the
application 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 to configure the appropriate
TestExecutionListeners
manually.super();
.Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
applicationContext | The ApplicationContext that was injected into this test instance
via setApplicationContext(ApplicationContext) . |
||||||||||
logger | Logger available to subclasses |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a new AbstractTestNGSpringContextTests instance and initialize
the internal
TestContextManager for the current test. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Delegates to the IHookCallBack#runTestMethod(ITestResult) test
method in the supplied
callback to execute the actual test
and then tracks the exception thrown during test execution, if any. | |||||||||||
Set the
ApplicationContext to be used by this test instance,
provided via ApplicationContextAware semantics. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Delegates to the configured
TestContextManager to call
'after test class' callbacks. | |||||||||||
Delegates to the configured
TestContextManager to
post-process the test method after the actual test has executed. | |||||||||||
Delegates to the configured
TestContextManager to call
'before test class'
callbacks. | |||||||||||
Delegates to the configured
TestContextManager to
pre-process
the test method before the actual test is executed. | |||||||||||
Delegates to the configured
TestContextManager to
prepare this test
instance prior to execution of any individual tests, for example for
injecting dependencies, etc. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.context.ApplicationContextAware
|
The ApplicationContext
that was injected into this test instance
via setApplicationContext(ApplicationContext)
.
Logger available to subclasses
Construct a new AbstractTestNGSpringContextTests instance and initialize
the internal TestContextManager
for the current test.
Delegates to the IHookCallBack#runTestMethod(ITestResult) test
method in the supplied callback
to execute the actual test
and then tracks the exception thrown during test execution, if any.
Set the ApplicationContext
to be used by this test instance,
provided via ApplicationContextAware
semantics.
applicationContext | the applicationContext to set |
---|
Delegates to the configured TestContextManager
to call
'after test class'
callbacks.
Exception | if a registered TestExecutionListener throws an exception |
---|
Delegates to the configured TestContextManager
to
post-process
the test method after the actual test has executed.
testMethod | the test method which has just been executed on the test instance |
---|
Exception | allows all exceptions to propagate |
---|
Delegates to the configured TestContextManager
to call
'before test class'
callbacks.
Exception | if a registered TestExecutionListener throws an exception |
---|
Delegates to the configured TestContextManager
to
pre-process
the test method before the actual test is executed.
testMethod | the test method which is about to be executed. |
---|
Exception | allows all exceptions to propagate. |
---|
Delegates to the configured TestContextManager
to
prepare
this test
instance prior to execution of any individual tests, for example for
injecting dependencies, etc.
Exception | if a registered TestExecutionListener throws an exception |
---|