Skip to content

TestContext should generate cache keys based on all metadata that uniquely identify ApplicationContext configuration [SPR-7326] #11984

@spring-projects-issues

Description

@spring-projects-issues

Daniel IfCore opened SPR-7326 and commented

I have a test suite where different test classes use the same context configuration file but different context loader. The use case for this is to be able to inject a session and request scope via the customizeBeanFactory method in the GenericXmlContextLoader class.

Since only some test cases rely on those scopes I have a @ContextConfiguration annotation on those classes that need those scopes.

Since the contextCache relies only on the locations property of the ContextConfiguration annotation the special context loader is not invoked if another test cases with the same context location has been executed before.

Could you please add the classname of the loader to the cache key as well? In Spring 3.0.2 it is in line 301 in the org.springframework.test.context.TestContext.java file.

Thanks!


Affects: 3.0.2

Issue Links:

Referenced from: commits dbe96b5, 3f58da1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions