1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.lesscss.internal; |
21 |
|
|
22 |
|
import org.junit.Before; |
23 |
|
import org.junit.Rule; |
24 |
|
import org.junit.Test; |
25 |
|
import org.xwiki.configuration.ConfigurationSource; |
26 |
|
import org.xwiki.test.mockito.MockitoComponentMockingRule; |
27 |
|
|
28 |
|
import static org.junit.Assert.assertTrue; |
29 |
|
import static org.junit.Assert.assertEquals; |
30 |
|
import static org.mockito.Mockito.when; |
31 |
|
|
32 |
|
|
33 |
|
@link |
34 |
|
|
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 3 |
Complexity Density: 0.43 |
|
36 |
|
public class LESSConfigurationTest { |
37 |
|
|
38 |
|
@Rule |
39 |
|
public MockitoComponentMockingRule<LESSConfiguration> mocker = |
40 |
|
new MockitoComponentMockingRule<>(LESSConfiguration.class); |
41 |
|
|
42 |
|
private ConfigurationSource xwikiPropertiesSource; |
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
44 |
2 |
@Before... |
45 |
|
public void setUp() throws Exception |
46 |
|
{ |
47 |
2 |
this.xwikiPropertiesSource = this.mocker.getInstance(ConfigurationSource.class); |
48 |
|
} |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
50 |
1 |
@Test... |
51 |
|
public void maxSimultaneousCompilations() throws Exception |
52 |
|
{ |
53 |
1 |
when(xwikiPropertiesSource.getProperty("lesscss.maximumSimultaneousCompilations",4)).thenReturn(4); |
54 |
1 |
int i = mocker.getComponentUnderTest().getMaximumSimultaneousCompilations(); |
55 |
1 |
assertEquals(4,i); |
56 |
|
} |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
58 |
1 |
@Test... |
59 |
|
public void generateSourceMaps() throws Exception |
60 |
|
{ |
61 |
1 |
when(xwikiPropertiesSource.getProperty("lesscss.generateInlineSourceMaps", false)).thenReturn(true); |
62 |
1 |
boolean b = mocker.getComponentUnderTest().isGenerateInlineSourceMaps(); |
63 |
1 |
assertTrue(b); |
64 |
|
} |
65 |
|
} |