Package | Description |
---|---|
org.springframework.test.context |
This package contains the Spring TestContext Framework
which provides annotation-driven unit and integration testing support
that is agnostic of the actual testing framework in use.
|
org.springframework.test.context.support |
Support classes for the Spring TestContext Framework.
|
org.springframework.test.context.transaction |
Transactional support classes for the Spring TestContext
Framework.
|
Modifier and Type | Method and Description |
---|---|
protected TestContext |
TestContextManager.getTestContext()
Returns the
TestContext managed by this
TestContextManager . |
Modifier and Type | Method and Description |
---|---|
void |
TestExecutionListener.afterTestClass(TestContext testContext)
Post-processes a test class after execution of all tests within
the class.
|
void |
TestExecutionListener.afterTestMethod(TestContext testContext)
Post-processes a test after execution of the
test method in the supplied
test context , for example by tearing down test
fixtures. |
void |
TestExecutionListener.beforeTestClass(TestContext testContext)
Pre-processes a test class before execution of all tests within
the class.
|
void |
TestExecutionListener.beforeTestMethod(TestContext testContext)
Pre-processes a test before execution of the
test method in the supplied
test context , for example by setting up test
fixtures. |
void |
TestExecutionListener.prepareTestInstance(TestContext testContext)
Prepares the
test instance of the supplied
test context , for example by injecting dependencies. |
Modifier and Type | Method and Description |
---|---|
void |
DirtiesContextTestExecutionListener.afterTestClass(TestContext testContext)
If the test class of the supplied
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 . |
void |
AbstractTestExecutionListener.afterTestClass(TestContext testContext)
The default implementation is empty.
|
void |
DirtiesContextTestExecutionListener.afterTestMethod(TestContext testContext)
If the current test method of the supplied
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 . |
void |
AbstractTestExecutionListener.afterTestMethod(TestContext testContext)
The default implementation is empty.
|
void |
AbstractTestExecutionListener.beforeTestClass(TestContext testContext)
The default implementation is empty.
|
void |
AbstractTestExecutionListener.beforeTestMethod(TestContext testContext)
The default implementation is empty.
|
void |
DependencyInjectionTestExecutionListener.beforeTestMethod(TestContext testContext)
If the
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. |
protected void |
DirtiesContextTestExecutionListener.dirtyContext(TestContext testContext)
Marks the
application context of the supplied
test context as
dirty , and sets the
REINJECT_DEPENDENCIES_ATTRIBUTE in the test context to true
. |
protected void |
DependencyInjectionTestExecutionListener.injectDependencies(TestContext testContext)
Performs dependency injection and bean initialization for the supplied
TestContext as described in
prepareTestInstance() . |
void |
AbstractTestExecutionListener.prepareTestInstance(TestContext testContext)
The default implementation is empty.
|
void |
DependencyInjectionTestExecutionListener.prepareTestInstance(TestContext testContext)
Performs dependency injection on the
test instance of the supplied
test context by
autowiring
and
initializing
the test instance via its own
application context (without
checking dependencies). |
Modifier and Type | Method and Description |
---|---|
void |
TransactionalTestExecutionListener.afterTestMethod(TestContext testContext)
If a transaction is currently active for the test method of the supplied
test context , this method will end the transaction
and run @AfterTransaction methods . |
void |
TransactionalTestExecutionListener.beforeTestMethod(TestContext testContext)
If the test method of the supplied
test context is
configured to run within a transaction, this method will run
@BeforeTransaction methods and start a new
transaction. |
protected PlatformTransactionManager |
TransactionalTestExecutionListener.getTransactionManager(TestContext testContext)
Get the
transaction manager to use
for the supplied test context . |
protected boolean |
TransactionalTestExecutionListener.isDefaultRollback(TestContext testContext)
Determine whether or not to rollback transactions by default for the
supplied
test context . |
protected boolean |
TransactionalTestExecutionListener.isRollback(TestContext testContext)
Determine whether or not to rollback transactions for the supplied
test context by taking into consideration the
default rollback flag and a
possible method-level override via the Rollback annotation. |
protected void |
TransactionalTestExecutionListener.runAfterTransactionMethods(TestContext testContext)
Run all
@AfterTransaction methods for the
specified test context . |
protected void |
TransactionalTestExecutionListener.runBeforeTransactionMethods(TestContext testContext)
Run all
@BeforeTransaction methods for the
specified test context . |
Copyright © 2014. All rights reserved.