[SPR-4333] TestContextManager has hidden dependency on spring-tx Created: 13/Jan/08 Updated: 19/Jun/12 Resolved: 14/Jan/08
|Reporter:||Dave Syer||Assignee:||Juergen Hoeller|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Days since last comment:||10 years, 11 weeks, 2 days ago|
|Last commented by a User:||false|
TestContextManager has hidden dependency on spring-tx. I can't run a test with @RunWith(SpringJUnit4ClassRunner.class) without putting spring-tx.jar on the classpath, which isn't actually required by the test case.
|Comment by Juergen Hoeller [ 14/Jan/08 ]|
This is not really a "hidden" dependency - it's simply the default TransactionalTestExecutionListener doing its work. If you don't specify explicit @TestExecutionListeners, the defaults will kick in... implying the dependencies of those defaults.
Anyway, this is easy enough to solve through a catch block when instantiating the default TestExecutionListeners. If a default listener cannot be instantiated, we'll simply assume that it isn't needed since its underlying dependencies aren't present - which means that the application's test code cannot make use of those underlying facilities (e.g. @Transactional) either.