接口 ContextCache

  • 所有已知实现类:
    DefaultContextCache

    public interface ContextCache
    ContextCache defines the SPI for caching Spring ApplicationContexts within the Spring TestContext Framework.

    A ContextCache maintains a cache of ApplicationContexts keyed by MergedContextConfiguration instances, potentially configured with a maximum size and a custom eviction policy.

    Rationale

    Context caching can have significant performance benefits if context initialization is complex. Although the initialization of a Spring context itself is typically very quick, some beans in a context — for example, an embedded database or a LocalContainerEntityManagerFactoryBean for working with JPA — may take several seconds to initialize. Hence it often makes sense to perform that initialization only once per test suite or JVM process.

    从以下版本开始:
    4.2
    作者:
    Sam Brannen, Juergen Hoeller
    另请参阅:
    ContextCacheUtils.retrieveMaxCacheSize()