Move static ContextCache to DefaultCacheAwareContextLoaderDelegate

Issue: SPR-12683
This commit is contained in:
Sam Brannen
2015-04-18 20:17:20 +02:00
parent 0e287c1a90
commit 0392a88c69
3 changed files with 29 additions and 16 deletions

View File

@@ -28,14 +28,14 @@ import static org.junit.Assert.*;
public class ContextCacheTestUtils {
/**
* Reset the state of the context cache.
* Reset the state of the static context cache in {@link DefaultCacheAwareContextLoaderDelegate}.
*/
public static final void resetContextCache() {
TestContextManager.contextCache.reset();
DefaultCacheAwareContextLoaderDelegate.defaultContextCache.reset();
}
/**
* Assert the statistics of the context cache in {@link TestContextManager}.
* Assert the statistics of the static context cache in {@link DefaultCacheAwareContextLoaderDelegate}.
*
* @param usageScenario the scenario in which the statistics are used
* @param expectedSize the expected number of contexts in the cache
@@ -44,8 +44,8 @@ public class ContextCacheTestUtils {
*/
public static final void assertContextCacheStatistics(String usageScenario, int expectedSize, int expectedHitCount,
int expectedMissCount) {
assertContextCacheStatistics(TestContextManager.contextCache, usageScenario, expectedSize, expectedHitCount,
expectedMissCount);
assertContextCacheStatistics(DefaultCacheAwareContextLoaderDelegate.defaultContextCache, usageScenario,
expectedSize, expectedHitCount, expectedMissCount);
}
/**