The Spring TestContext Framework (TCF) has always cached ApplicationContexts loaded for tests; however, it's always been a bit of a black art knowing (or finding out) exactly how many contexts are loaded within a given test suite.
The information, however, has always been tracked internally within the ContextCache class, and some developers have used reflection to acquire this information. It would therefore be beneficial to many development teams if the context cache statistics were made publicly available, at least as log output.
Log context cache statistics whenever an ApplicationContext is loaded by the TCF.
In the course of backporting this, I've also streamlined synchronization within ContextCache: loadContext was already going through a full lock on the ContextCache itself for all operations. Doing DefaultTestContext's remove operation within an the same lock allows for dropping the internal monitor within ContextCache completely.