1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.macro.wikibridge; |
21 |
|
|
22 |
|
import java.util.Arrays; |
23 |
|
import java.util.Iterator; |
24 |
|
import java.util.List; |
25 |
|
import java.util.Map; |
26 |
|
|
27 |
|
import org.junit.Assert; |
28 |
|
|
29 |
|
import org.xwiki.rendering.macro.descriptor.DefaultContentDescriptor; |
30 |
|
import org.xwiki.rendering.macro.descriptor.ParameterDescriptor; |
31 |
|
|
32 |
|
|
33 |
|
@link |
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.17 |
|
38 |
|
public class WikiMacroDescriptorTest |
39 |
|
{ |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
45 |
1 |
@org.junit.Test... |
46 |
|
public void testGetParameterDescriptorMapInCorrectOrder() |
47 |
|
{ |
48 |
1 |
List<WikiMacroParameterDescriptor> paramDescriptors = Arrays.asList( |
49 |
|
new WikiMacroParameterDescriptor("id1", "description1", true), |
50 |
|
new WikiMacroParameterDescriptor("id2", "description2", true)); |
51 |
1 |
WikiMacroDescriptor descriptor = new WikiMacroDescriptor("name", "description", "category", |
52 |
|
WikiMacroVisibility.GLOBAL, new DefaultContentDescriptor(), paramDescriptors); |
53 |
1 |
Map<String, ParameterDescriptor> result = descriptor.getParameterDescriptorMap(); |
54 |
|
|
55 |
1 |
Iterator<String> it = result.keySet().iterator(); |
56 |
1 |
Assert.assertEquals("id1", it.next()); |
57 |
1 |
Assert.assertEquals("id2", it.next()); |
58 |
|
} |
59 |
|
} |