Search in sources :

Example 1 with SkinReferenceFactory

use of org.xwiki.lesscss.internal.skin.SkinReferenceFactory in project xwiki-platform by xwiki.

the class DefaultLESSColorThemeConverterTest method setUp.

@Before
public void setUp() throws Exception {
    cache = mocker.getInstance(ColorThemeCache.class);
    currentColorThemeGetter = mocker.getInstance(CurrentColorThemeGetter.class);
    skinReferenceFactory = mocker.getInstance(SkinReferenceFactory.class);
    colorThemeReferenceFactory = mocker.getInstance(ColorThemeReferenceFactory.class);
    lessResourceReferenceFactory = mocker.getInstance(LESSResourceReferenceFactory.class);
    xcontextProvider = mocker.registerMockComponent(XWikiContext.TYPE_PROVIDER);
    xcontext = mock(XWikiContext.class);
    when(xcontextProvider.get()).thenReturn(xcontext);
    xwiki = mock(XWiki.class);
    when(xcontext.getWiki()).thenReturn(xwiki);
    when(xwiki.getSkin(xcontext)).thenReturn("skin");
    when(currentColorThemeGetter.getCurrentColorTheme(true, "default")).thenReturn("colorTheme");
    when(skinReferenceFactory.createReference("skin")).thenReturn(new FSSkinReference("skin"));
    when(colorThemeReferenceFactory.createReference("colorTheme")).thenReturn(new NamedColorThemeReference("colorTheme"));
    when(cache.getMutex(eq(new LESSSkinFileResourceReference("file", null, null)), eq(new FSSkinReference("skin")), eq(new NamedColorThemeReference("colorTheme")))).thenReturn("mutex");
}
Also used : CurrentColorThemeGetter(org.xwiki.lesscss.internal.colortheme.CurrentColorThemeGetter) LESSResourceReferenceFactory(org.xwiki.lesscss.resources.LESSResourceReferenceFactory) ColorThemeReferenceFactory(org.xwiki.lesscss.internal.colortheme.ColorThemeReferenceFactory) NamedColorThemeReference(org.xwiki.lesscss.internal.colortheme.NamedColorThemeReference) XWikiContext(com.xpn.xwiki.XWikiContext) XWiki(com.xpn.xwiki.XWiki) FSSkinReference(org.xwiki.lesscss.internal.skin.FSSkinReference) ColorThemeCache(org.xwiki.lesscss.internal.cache.ColorThemeCache) SkinReferenceFactory(org.xwiki.lesscss.internal.skin.SkinReferenceFactory) LESSSkinFileResourceReference(org.xwiki.lesscss.internal.resources.LESSSkinFileResourceReference) Before(org.junit.Before)

Aggregations

XWiki (com.xpn.xwiki.XWiki)1 XWikiContext (com.xpn.xwiki.XWikiContext)1 Before (org.junit.Before)1 ColorThemeCache (org.xwiki.lesscss.internal.cache.ColorThemeCache)1 ColorThemeReferenceFactory (org.xwiki.lesscss.internal.colortheme.ColorThemeReferenceFactory)1 CurrentColorThemeGetter (org.xwiki.lesscss.internal.colortheme.CurrentColorThemeGetter)1 NamedColorThemeReference (org.xwiki.lesscss.internal.colortheme.NamedColorThemeReference)1 LESSSkinFileResourceReference (org.xwiki.lesscss.internal.resources.LESSSkinFileResourceReference)1 FSSkinReference (org.xwiki.lesscss.internal.skin.FSSkinReference)1 SkinReferenceFactory (org.xwiki.lesscss.internal.skin.SkinReferenceFactory)1 LESSResourceReferenceFactory (org.xwiki.lesscss.resources.LESSResourceReferenceFactory)1