org.springframework.test |
Superclasses for tests requiring Spring application contexts,
including support for transactional execution of test cases,
with automatic rollback on completion.
Useful as base classes for application-specific tests.
The superclasses in this package are ideal for integration testing.
Unit testing should not normally involve the Spring container,
but should test classes in isolation.
|
Java Source File Name | Type | Comment |
AbstractDependencyInjectionSpringContextTests.java | Class | Convenient superclass for tests depending on a Spring context.
The test instance itself is populated by Dependency Injection.
Really for integration testing, not unit testing.
You should not normally use the Spring container
for unit tests: simply populate your POJOs in plain JUnit tests!
This supports two modes of populating the test:
- Via Setter Dependency Injection.
|
AbstractSingleSpringContextTests.java | Class | Abstract JUnit test class that holds and exposes a single Spring
org.springframework.context.ApplicationContext ApplicationContext .
This class will cache contexts based on a context key: normally the
config locations String array describing the Spring resource descriptors making
up the context. |
AbstractSpringContextTests.java | Class | Superclass for JUnit test cases using Spring
org.springframework.context.ApplicationContext ApplicationContexts .
Maintains a static cache of contexts by key. |
AbstractTransactionalDataSourceSpringContextTests.java | Class | Subclass of AbstractTransactionalSpringContextTests that adds some convenience
functionality for JDBC access. |
AbstractTransactionalSpringContextTests.java | Class | Convenient base class for tests that should occur in a transaction, but normally
will roll the transaction back on the completion of each test.
This is useful in a range of circumstances, allowing the following benefits:
- Ability to delete or insert any data in the database, without affecting other tests
- Providing a transactional context for any code requiring a transaction
- Ability to write anything to the database without any need to clean up.
This class is typically very fast, compared to traditional setup/teardown scripts.
If data should be left in the database, call the
AbstractTransactionalSpringContextTests.setComplete() method in each test. |
AssertThrows.java | Class | Simple method object encapsulation of the 'test-for-Exception' scenario (for JUnit). |
ConditionalTestCase.java | Class | Superclass for tests that allows conditional test execution
at individual test method level.
The isDisabledInThisEnvironment method is invoked before the
execution of each test method. |