Skip to content

Improve documentation of the context caching mechanism in the TestContext framework [SPR-7996] #12651

@spring-projects-issues

Description

@spring-projects-issues

Caleb Jones opened SPR-7996 and commented

Overview

Unit/integration test execution libraries can sometimes be configured to execute tests in a forked manner (see surefire's forkMode configuration). When tests are run in a forked mode, in-memory @ContextConfiguration caching no longer applies, and the context will be reloaded for every forked process.

The Spring reference manual merely states that @ContextConfiguration is cached and does not go into much detail beyond that. I think it would be good to specify that the cache is in-memory and thus will only be usable for tests which run within the same JVM process / class space. Perhaps a Spring note (the ones with the little leaf icon and block quote styling) would be good to call this out in the Testing chapter.

To Document

  • cache key generation, including a discussion of the algorithm in MergedContextConfiguration
  • cache scope and implications in a test suite, including a discussion of forking

Affects: 2.5.6, 3.0.5

Reference URL: http://forum.springsource.org/showthread.php?t=104164

Issue Links:

Referenced from: commits e90c7ea

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions