use of org.xwiki.cache.Cache in project xwiki-platform by xwiki.
the class DefaultLESSResourcesCacheTest method setUp.
@Before
public void setUp() throws Exception {
cacheManager = mocker.getInstance(CacheManager.class);
cache = mock(Cache.class);
CacheFactory cacheFactory = mock(CacheFactory.class);
when(cacheManager.getCacheFactory()).thenReturn(cacheFactory);
CacheConfiguration configuration = new CacheConfiguration("lesscss.skinfiles.cache");
when(cacheFactory.<String>newCache(eq(configuration))).thenReturn(cache);
cacheKeyFactory = mocker.getInstance(CacheKeyFactory.class);
LESSSkinFileResourceReference lessSkinFileResourceReference = new LESSSkinFileResourceReference("lessResource", null, null);
when(cacheKeyFactory.getCacheKey(eq(lessSkinFileResourceReference), eq(new FSSkinReference("skin")), eq(new NamedColorThemeReference("colorTheme")), eq(true))).thenReturn("12_lessResource_4_skin_10_colorTheme");
}
use of org.xwiki.cache.Cache in project xwiki-platform by xwiki.
the class DefaultIconSetCacheTest method setUp.
@Before
public void setUp() throws Exception {
cacheManager = mocker.getInstance(CacheManager.class);
entityReferenceSerializer = mocker.getInstance(new DefaultParameterizedType(null, EntityReferenceSerializer.class, String.class));
cache = mock(Cache.class);
CacheFactory cacheFactory = mock(CacheFactory.class);
when(cacheManager.getCacheFactory()).thenReturn(cacheFactory);
CacheConfiguration configuration = new CacheConfiguration("iconset");
when(cacheFactory.<IconSet>newCache(eq(configuration))).thenReturn(cache);
}
use of org.xwiki.cache.Cache in project xwiki-platform by xwiki.
the class XWikiCacheStoreTest method before.
@Before
public void before() throws Exception {
this.oldcore.getMocker().registerMockComponent(RemoteObservationManagerContext.class);
this.oldcore.getMocker().registerMockComponent(ObservationManager.class);
CacheManager cacheManager = this.oldcore.getMocker().registerMockComponent(CacheManager.class);
cache = mock(Cache.class);
when(cacheManager.<XWikiDocument>createNewCache(isCacheConfiguration("xwiki.store.pagecache"))).thenReturn(cache);
existCache = mock(Cache.class);
when(cacheManager.<Boolean>createNewCache(isCacheConfiguration("xwiki.store.pageexistcache"))).thenReturn(existCache);
}
Aggregations