|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.test.context.testng.AbstractTestNGSpringContextTests
@TestExecutionListeners(value={DependencyInjectionTestExecutionListener.class,DirtiesContextTestExecutionListener.class}) public abstract class AbstractTestNGSpringContextTests
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
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();
.
TestContext
,
TestContextManager
,
TestExecutionListeners
,
AbstractTransactionalTestNGSpringContextTests
,
AbstractJUnit38SpringContextTests
,
AbstractJUnit4SpringContextTests
Field Summary | |
---|---|
protected ApplicationContext |
applicationContext
The ApplicationContext that was injected into this test instance
via setApplicationContext(ApplicationContext) . |
protected Log |
logger
Logger available to subclasses |
private TestContextManager |
testContextManager
|
private java.lang.Throwable |
testException
|
Constructor Summary | |
---|---|
AbstractTestNGSpringContextTests()
Construct a new AbstractTestNGSpringContextTests instance and initialize the internal TestContextManager for the current test. |
Method Summary | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
void |
run(IHookCallBack callBack,
ITestResult testResult)
Delegates to the test
method in the supplied callback to execute the actual test
and then tracks the exception thrown during test execution, if any. |
|||||||||||||||||||
void |
setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext to be used by this test instance,
provided via ApplicationContextAware semantics. |
|||||||||||||||||||
protected void |
springTestContextAfterTestClass()
loggerprotected final Log logger
applicationContextprotected ApplicationContext applicationContext
testContextManagerprivate final TestContextManager testContextManager testExceptionprivate java.lang.Throwable testException
AbstractTestNGSpringContextTestspublic AbstractTestNGSpringContextTests()
setApplicationContextpublic final void setApplicationContext(ApplicationContext applicationContext)
springTestContextBeforeTestClassTestContextManager to call
'before test class'
callbacks.
springTestContextPrepareTestInstanceTestContextManager to
prepare this test
instance prior to execution of any individual tests, for example for
injecting dependencies, etc.
springTestContextBeforeTestMethodTestContextManager to
pre-process
the test method before the actual test is executed.
runpublic void run(IHookCallBack callBack, ITestResult testResult)
springTestContextAfterTestMethodTestContextManager to
post-process the test method after the actual test has executed.
springTestContextAfterTestClassTestContextManager to call
'after test class' callbacks.
|