1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.wikimodel.util; |
21 |
|
|
22 |
|
import org.xwiki.rendering.wikimodel.WikiParameters; |
23 |
|
import org.xwiki.rendering.wikimodel.WikiReference; |
24 |
|
import org.xwiki.rendering.wikimodel.WikiReferenceParser; |
25 |
|
|
26 |
|
import junit.framework.TestCase; |
27 |
|
|
28 |
|
|
29 |
|
@version |
30 |
|
@since |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (21) |
Complexity: 5 |
Complexity Density: 0.31 |
|
32 |
|
public class ReferenceUtilTest extends TestCase |
33 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
34 |
1 |
public ReferenceUtilTest(String name)... |
35 |
|
{ |
36 |
1 |
super(name); |
37 |
|
} |
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
39 |
1 |
public void test()... |
40 |
|
{ |
41 |
1 |
test("a", "a"); |
42 |
1 |
test(" a ", "a"); |
43 |
1 |
test("a|b", "a", "b"); |
44 |
1 |
test(" a | b ", "a", "b"); |
45 |
1 |
test("a>b", "a", "b"); |
46 |
1 |
test(" a > b ", "a", "b"); |
47 |
1 |
test(" a > b | x=y ", "a", "b", "x=y"); |
48 |
1 |
test(" a > b > x=y ", "a", "b", "x=y"); |
49 |
1 |
test(" a > b > x=y > toto titi ", "a", "b", "x=y"); |
50 |
|
} |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
52 |
2 |
private void test(String str, String link)... |
53 |
|
{ |
54 |
2 |
WikiReference ref = new WikiReferenceParser().parse(str); |
55 |
2 |
assertEquals(new WikiReference(link), ref); |
56 |
|
} |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
58 |
4 |
private void test(String str, String link, String label)... |
59 |
|
{ |
60 |
4 |
WikiReference ref = new WikiReferenceParser().parse(str); |
61 |
4 |
assertEquals(new WikiReference(link, label), ref); |
62 |
|
} |
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
64 |
3 |
private void test(String str, String link, String label, String params)... |
65 |
|
{ |
66 |
3 |
WikiReference ref = new WikiReferenceParser().parse(str); |
67 |
3 |
assertEquals( |
68 |
|
new WikiReference(link, label, new WikiParameters(params)), |
69 |
|
ref); |
70 |
|
} |
71 |
|
} |