[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: 9 years, 50 weeks ago
Last commented by a User: false
Last updater: Trevor Marshall

 Description   

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.



 Comments   
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.

Juergen

Generated at Mon Dec 18 01:22:11 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.