[SPR-4333] TestContextManager has hidden dependency on spring-tx Created: 13/Jan/08  Updated: 19/Jun/12  Resolved: 14/Jan/08

Status: Closed
Project: Spring Framework
Component/s: None
Affects Version/s: 2.5.1
Fix Version/s: 2.5.2

Type: Improvement Priority: Major
Reporter: Dave Syer Assignee: Juergen Hoeller
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Days since last comment: 10 years, 28 weeks ago
Last commented by a User: false
Last updater: Trevor Marshall


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.


Generated at Mon Jul 16 10:11:09 UTC 2018 using JIRA 7.9.0#79000-sha1:3ca552e944c2fe83b21589bc06f155b9b428cc2b.