use of org.xwiki.lesscss.internal.colortheme.ColorThemeReference in project xwiki-platform by xwiki.
the class CacheKeyFactoryTest method getCacheKeyWithContext.
@Test
public void getCacheKeyWithContext() throws Exception {
// Mocks
LESSResourceReference lessResource = mock(LESSResourceReference.class);
SkinReference skin = mock(SkinReference.class);
ColorThemeReference colorTheme = mock(ColorThemeReference.class);
when(lessResource.serialize()).thenReturn("lessResource");
when(skin.serialize()).thenReturn("skin");
when(colorTheme.serialize()).thenReturn("colorTheme");
when(xcontextCacheKeyFactory.getCacheKey()).thenReturn("XWikiContext[Mock]");
// Test
assertEquals("12_lessResource_4_skin_10_colorTheme_18_XWikiContext[Mock]", mocker.getComponentUnderTest().getCacheKey(lessResource, skin, colorTheme, true));
}
use of org.xwiki.lesscss.internal.colortheme.ColorThemeReference in project xwiki-platform by xwiki.
the class CacheKeyFactoryTest method getCacheKeyWithoutContext.
@Test
public void getCacheKeyWithoutContext() throws Exception {
// Mocks
LESSResourceReference lessResource = mock(LESSResourceReference.class);
SkinReference skin = mock(SkinReference.class);
ColorThemeReference colorTheme = mock(ColorThemeReference.class);
when(lessResource.serialize()).thenReturn("lessResource");
when(skin.serialize()).thenReturn("skin");
when(colorTheme.serialize()).thenReturn("colorTheme");
// Test
assertEquals("12_lessResource_4_skin_10_colorTheme", mocker.getComponentUnderTest().getCacheKey(lessResource, skin, colorTheme, false));
}
use of org.xwiki.lesscss.internal.colortheme.ColorThemeReference in project xwiki-platform by xwiki.
the class ColorThemeListener method clearCacheFromColorTheme.
private void clearCacheFromColorTheme(XWikiDocument document) {
ColorThemeReference colorThemeReference = colorThemeReferenceFactory.createReference(document.getDocumentReference());
lessResourcesCache.clearFromColorTheme(colorThemeReference);
colorThemeCache.clearFromColorTheme(colorThemeReference);
}
Aggregations