1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.transformation; |
21 |
|
|
22 |
|
import java.util.Arrays; |
23 |
|
|
24 |
|
import org.junit.Assert; |
25 |
|
import org.junit.Test; |
26 |
|
import org.xwiki.rendering.block.Block; |
27 |
|
import org.xwiki.rendering.block.WordBlock; |
28 |
|
import org.xwiki.rendering.block.XDOM; |
29 |
|
import org.xwiki.rendering.syntax.Syntax; |
30 |
|
|
31 |
|
|
32 |
|
@link |
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.1 |
|
37 |
|
public class TransformationContextTest |
38 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 1 |
Complexity Density: 0.1 |
1PASS
|
|
39 |
1 |
@Test... |
40 |
|
public void testClone() |
41 |
|
{ |
42 |
1 |
TransformationContext context = new TransformationContext(); |
43 |
1 |
context.setId("id"); |
44 |
1 |
context.setSyntax(Syntax.XWIKI_2_0); |
45 |
1 |
XDOM xdom = new XDOM(Arrays.<Block>asList(new WordBlock("test"))); |
46 |
1 |
context.setXDOM(xdom); |
47 |
|
|
48 |
1 |
TransformationContext newContext = context.clone(); |
49 |
1 |
Assert.assertNotSame(context, newContext); |
50 |
1 |
Assert.assertEquals("id", newContext.getId()); |
51 |
1 |
Assert.assertEquals(Syntax.XWIKI_2_0, newContext.getSyntax()); |
52 |
1 |
Assert.assertEquals(xdom, newContext.getXDOM()); |
53 |
|
} |
54 |
|
} |