1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.escaping; |
21 |
|
|
22 |
|
import org.junit.AfterClass; |
23 |
|
import org.junit.BeforeClass; |
24 |
|
import org.junit.Test; |
25 |
|
import org.xwiki.test.escaping.framework.AbstractEscapingTest; |
26 |
|
import org.xwiki.test.escaping.framework.AbstractManualTest; |
27 |
|
import org.xwiki.test.escaping.framework.XMLEscapingValidator; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (24) |
Complexity: 6 |
Complexity Density: 0.33 |
|
37 |
|
public class ObjectAndClassEditorTest extends AbstractManualTest |
38 |
|
{ |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
43 |
1 |
@BeforeClass... |
44 |
|
public static void init() |
45 |
|
{ |
46 |
1 |
String test = XMLEscapingValidator.getTestString(); |
47 |
|
|
48 |
1 |
AbstractEscapingTest.getUrlContent(createUrl("propadd", test, test, params(kv("propname", "test"), |
49 |
|
kv("proptype", "com.xpn.xwiki.objects.classes.StringClass")))); |
50 |
|
|
51 |
1 |
AbstractEscapingTest.getUrlContent(createUrl("propupdate", test, test, params(kv("test_disabled", "0"), |
52 |
|
kv("test_name", "test"), |
53 |
|
kv("test_prettyName", test), |
54 |
|
kv("test_validationRegExp", test), |
55 |
|
kv("test_validationMessage", test), |
56 |
|
kv("test_number", "1"), |
57 |
|
kv("test_size", "30"), |
58 |
|
kv("test_picker", "0"), |
59 |
|
kv("xeditaction", "edit")))); |
60 |
|
|
61 |
1 |
AbstractEscapingTest.getUrlContent(createUrl("view", test, test, params(kv("xpage", "editobject"), |
62 |
|
kv("xaction", "addObject"), |
63 |
|
kv("className", test + "." + test)))); |
64 |
|
|
65 |
1 |
AbstractEscapingTest.getUrlContent(createUrl("save", test, test, params(kv("classname", "-"), |
66 |
|
kv(escapeUrl(test + "." + test + "_0_test"), test), |
67 |
|
kv("xeditaction", "edit")))); |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
73 |
1 |
@AfterClass... |
74 |
|
public static void shutdown() |
75 |
|
{ |
76 |
|
|
77 |
1 |
String test = XMLEscapingValidator.getTestString(); |
78 |
1 |
AbstractEscapingTest.getUrlContent(createUrl("delete", test, test, params(kv("confirm", "1")))); |
79 |
|
} |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
81 |
1 |
@Test... |
82 |
|
public void testClassEditor() |
83 |
|
{ |
84 |
1 |
skipIfIgnored("templates/editclass.vm"); |
85 |
1 |
String test = XMLEscapingValidator.getTestString(); |
86 |
1 |
checkUnderEscaping(createUrl("edit", test, test, params(kv("editor", "class"))), "XWIKI-5404"); |
87 |
|
} |
88 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
89 |
1 |
@Test... |
90 |
|
public void testObjectEditor() |
91 |
|
{ |
92 |
1 |
skipIfIgnored("templates/editobject.vm"); |
93 |
1 |
String test = XMLEscapingValidator.getTestString(); |
94 |
1 |
checkUnderEscaping(createUrl("edit", test, test, params(kv("editor", "object"))), "XWIKI-5242"); |
95 |
|
} |
96 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
97 |
1 |
@Test... |
98 |
|
public void testObjectProperty() |
99 |
|
{ |
100 |
1 |
skipIfIgnored("templates/editobject.vm"); |
101 |
1 |
String test = XMLEscapingValidator.getTestString(); |
102 |
1 |
checkUnderEscaping(createUrl("edit", test, test, params(kv("editor", "object"), |
103 |
|
kv("classname", test + "." + test), test("property"))), "XWIKI-5242"); |
104 |
|
} |
105 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
106 |
1 |
@Test... |
107 |
|
public void testObjectXMaximized() |
108 |
|
{ |
109 |
1 |
skipIfIgnored("templates/editobject.vm"); |
110 |
1 |
checkUnderEscaping(createUrl("edit", "Blog", "WebHome", params(kv("editor", "object"), |
111 |
|
test("x-maximized"))), "XWIKI-5242"); |
112 |
|
} |
113 |
|
} |
114 |
|
|