1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.linkchecker.internal; |
21 |
|
|
22 |
|
import java.util.List; |
23 |
|
import java.util.regex.Pattern; |
24 |
|
|
25 |
|
import org.junit.*; |
26 |
|
import org.xwiki.rendering.transformation.linkchecker.LinkCheckerTransformationConfiguration; |
27 |
|
import org.xwiki.test.ComponentManagerRule; |
28 |
|
import org.xwiki.test.annotation.ComponentList; |
29 |
|
|
30 |
|
import static org.junit.Assert.*; |
31 |
|
|
32 |
|
|
33 |
|
@link |
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
38 |
|
@ComponentList({ |
39 |
|
XWikiLinkCheckerTransformationConfiguration.class |
40 |
|
}) |
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.2 |
|
41 |
|
public class XWikiLinkCheckerTransformationConfigurationTest |
42 |
|
{ |
43 |
|
@Rule |
44 |
|
public ComponentManagerRule componentManager = new ComponentManagerRule(); |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
46 |
1 |
@Test... |
47 |
|
public void getExcludedReferencePatterns() throws Exception |
48 |
|
{ |
49 |
1 |
LinkCheckerTransformationConfiguration configuration = |
50 |
|
this.componentManager.getInstance(LinkCheckerTransformationConfiguration.class); |
51 |
1 |
List<Pattern> patterns = configuration.getExcludedReferencePatterns(); |
52 |
1 |
assertEquals(1, patterns.size()); |
53 |
1 |
assertTrue(patterns.get(0).matcher("xwiki:XWiki.ExternalLinksJSON").matches()); |
54 |
1 |
assertFalse(patterns.get(0).matcher("xwiki:SomeSpace.SomePage").matches()); |
55 |
|
} |
56 |
|
} |