| 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.toc; |
| 21 |
|
|
| 22 |
|
import java.util.Collections; |
| 23 |
|
|
| 24 |
|
import org.junit.Test; |
| 25 |
|
import org.xwiki.properties.BeanManager; |
| 26 |
|
import org.xwiki.properties.PropertyException; |
| 27 |
|
import org.xwiki.rendering.internal.macro.toc.TocMacro; |
| 28 |
|
import org.xwiki.test.jmock.AbstractComponentTestCase; |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
@link |
| 32 |
|
|
| 33 |
|
@version |
| 34 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 1 |
|
| 35 |
|
public class TocMacroTest extends AbstractComponentTestCase |
| 36 |
|
{ |
| 37 |
|
private BeanManager beanManager; |
| 38 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 39 |
2 |
@Override... |
| 40 |
|
protected void registerComponents() throws Exception |
| 41 |
|
{ |
| 42 |
2 |
this.beanManager = getComponentManager().getInstance(BeanManager.class); |
| 43 |
|
} |
| 44 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1PASS
|
|
| 45 |
1 |
@Test(expected = PropertyException.class)... |
| 46 |
|
public void testStartTooLow() throws PropertyException |
| 47 |
|
{ |
| 48 |
1 |
this.beanManager.populate(new TocMacroParameters(), Collections.singletonMap("start", "0")); |
| 49 |
|
} |
| 50 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1PASS
|
|
| 51 |
1 |
@Test(expected = PropertyException.class)... |
| 52 |
|
public void testDepthTooLow() throws PropertyException |
| 53 |
|
{ |
| 54 |
1 |
this.beanManager.populate(new TocMacroParameters(), Collections.singletonMap("depth", "0")); |
| 55 |
|
} |
| 56 |
|
} |