1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.internal.macro.chart.source.table; |
21 |
|
|
22 |
|
import org.junit.Assert; |
23 |
|
import org.junit.Test; |
24 |
|
import org.xwiki.rendering.macro.MacroExecutionException; |
25 |
|
|
26 |
|
|
27 |
|
@link |
28 |
|
|
29 |
|
@version |
30 |
|
@since |
31 |
|
|
|
|
| 81.2% |
Uncovered Elements: 3 (16) |
Complexity: 6 |
Complexity Density: 0.46 |
|
32 |
|
public class MacroContentTableBlockDataSourceTest extends AbstractMacroContentTableBlockDataSourceTest |
33 |
|
{ |
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
1PASS
|
|
34 |
1 |
@Test... |
35 |
|
public void testGetTableBlockWhenNullMacroContent() throws Exception |
36 |
|
{ |
37 |
1 |
try { |
38 |
1 |
getDataSource().getTableBlock(null, null); |
39 |
0 |
Assert.fail("Should have thrown an exception"); |
40 |
|
} catch (MacroExecutionException expected) { |
41 |
1 |
Assert.assertEquals("A Chart Macro using an inline source must have a data table defined in its content.", |
42 |
|
expected.getMessage()); |
43 |
|
} |
44 |
|
} |
45 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
1PASS
|
|
46 |
1 |
@Test... |
47 |
|
public void testGetTableBlockWhenEmptyMacroContent() throws Exception |
48 |
|
{ |
49 |
1 |
try { |
50 |
1 |
getDataSource().getTableBlock("", null); |
51 |
0 |
Assert.fail("Should have thrown an exception"); |
52 |
|
} catch (MacroExecutionException expected) { |
53 |
1 |
Assert.assertEquals("A Chart Macro using an inline source must have a data table defined in its content.", |
54 |
|
expected.getMessage()); |
55 |
|
} |
56 |
|
} |
57 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
1PASS
|
|
58 |
1 |
@Test... |
59 |
|
public void testGetTableBlockWhenMacroContentDoesntContainTable() throws Exception |
60 |
|
{ |
61 |
|
|
62 |
1 |
setUpContentExpectation("not a table"); |
63 |
|
|
64 |
1 |
try { |
65 |
1 |
getDataSource().getTableBlock("not a table", null); |
66 |
0 |
Assert.fail("Should have thrown an exception"); |
67 |
|
} catch (MacroExecutionException expected) { |
68 |
1 |
Assert.assertEquals("Unable to locate a suitable data table.", expected.getMessage()); |
69 |
|
} |
70 |
|
} |
71 |
|
} |