1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.ui; |
21 |
|
|
22 |
|
import org.junit.Rule; |
23 |
|
import org.junit.Test; |
24 |
|
import org.junit.Assert; |
25 |
|
import org.xwiki.test.ui.po.ViewPage; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
33 |
|
public class BacklinksTest extends AbstractTest |
34 |
|
{ |
35 |
|
@Rule |
36 |
|
public AdminAuthenticationRule adminAuthenticationRule = new AdminAuthenticationRule(getUtil()); |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1PASS
|
|
38 |
1 |
@Test... |
39 |
|
public void testBacklinksCreationSyntax20() throws Exception |
40 |
|
{ |
41 |
1 |
testBacklinksCreation("xwiki/2.0", |
42 |
|
"{{velocity}}#foreach ($link in $doc.getBacklinks())\n$link\n#end{{/velocity}}", |
43 |
|
"[[backlink>>Test.BacklinkTargetTest]]"); |
44 |
|
} |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
46 |
1 |
private void testBacklinksCreation(String syntaxId, String backlinkListCode, String backlinkLink) throws Exception... |
47 |
|
{ |
48 |
1 |
getUtil().rest().deletePage("Test", "BacklinkTargetTest"); |
49 |
1 |
getUtil().rest().deletePage("Test", "BacklinkSourceTest"); |
50 |
|
|
51 |
|
|
52 |
1 |
ViewPage vp = getUtil().createPage("Test", "BacklinkTargetTest", backlinkListCode, null, syntaxId); |
53 |
|
|
54 |
1 |
Assert.assertEquals("", vp.getContent()); |
55 |
|
|
56 |
|
|
57 |
1 |
getUtil().createPage("Test", "BacklinkSourceTest", backlinkLink, null, syntaxId); |
58 |
|
|
59 |
1 |
vp = getUtil().gotoPage("Test", "BacklinkTargetTest"); |
60 |
1 |
Assert.assertEquals("Test.BacklinkSourceTest", vp.getContent()); |
61 |
|
} |
62 |
|
} |