Skip to content

AbstractSingleSpringContextTests - runBare vs final setUp() [SPR-3191] #7876

@spring-projects-issues

Description

@spring-projects-issues

Costin Leau opened SPR-3191 and commented

Me again :)

I'm working on the OSGi test support which is similar to the one provided by Spring - however, I see that for some reason the setup and tearDown methods are final in c. Is there any reason for that?
Why not add the functionality inside runBare and leave setUp and tearDown methods untouched.

See http://www.martinfowler.com/bliki/CallSuper.html for an example - basically move the special test functionality inside runBare instead of setUp and tearDown which are quite heavily by application developers.

Another separate issue would be to extract the junit functionality into helper classes which can be reused by third parties - for example AbstractSpringContextTests adds caching functionality that could be extracted so if one has its own junit hierarchy it can reuse these instead of copying.
This has been mentioned a number of times by various customers/users which have their own infrastructure and can't easily reuse the context functionality.


Issue Links:

Metadata

Metadata

Assignees

Labels

status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions