1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.test.page

File SkinExtensionSetup.java

 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
54% of files have more coverage

Code metrics

0
3
2
1
55
18
2
0.67
1.5
2
1

Classes

Class Line # Actions
SkinExtensionSetup 35 3 0% 2 1
0.880%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.test.page;
21   
22    import com.xpn.xwiki.XWiki;
23    import com.xpn.xwiki.XWikiContext;
24    import com.xpn.xwiki.plugin.skinx.SkinExtensionPluginApi;
25   
26    import static org.mockito.Mockito.doReturn;
27    import static org.mockito.Mockito.mock;
28   
29    /**
30    * Set up Skin Extension plugins for Page Tests.
31    *
32    * @version $Id: fe0008c8ddbaac3fa697773304ed1cbb2c4b58f8 $
33    * @since 8.3M2
34    */
 
35    public final class SkinExtensionSetup
36    {
 
37  0 toggle private SkinExtensionSetup()
38    {
39    // Utility class and thus no public constructor.
40    }
41   
42    /**
43    * Sets up the SSX/JSX plugins to provide a noop implementation (i.e. do nothing).
44    *
45    * @param xwiki the stubbed XWiki instance
46    * @param context the stubbed XWikiContext instance
47    * @throws Exception when a setup error occurs
48    */
 
49  7 toggle public static void setUp(XWiki xwiki, XWikiContext context) throws Exception
50    {
51  7 SkinExtensionPluginApi voidPluginApi = mock(SkinExtensionPluginApi.class);
52  7 doReturn(voidPluginApi).when(xwiki).getPluginApi("jsx", context);
53  7 doReturn(voidPluginApi).when(xwiki).getPluginApi("ssx", context);
54    }
55    }