| 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; |
| 21 |
|
|
| 22 |
|
import org.junit.Assert; |
| 23 |
|
import org.junit.Test; |
| 24 |
|
import org.xwiki.rendering.macro.MacroId; |
| 25 |
|
import org.xwiki.rendering.syntax.Syntax; |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
@link |
| 29 |
|
|
| 30 |
|
@version |
| 31 |
|
@since |
| 32 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.07 |
|
| 33 |
|
public class MacroIdTest |
| 34 |
|
{ |
| |
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
| 35 |
1 |
@Test... |
| 36 |
|
public void testEquality() |
| 37 |
|
{ |
| 38 |
1 |
MacroId id1 = new MacroId("id", Syntax.XWIKI_2_0); |
| 39 |
1 |
MacroId id2 = new MacroId("id", Syntax.XWIKI_2_0); |
| 40 |
1 |
MacroId id3 = new MacroId("otherid", Syntax.XWIKI_2_0); |
| 41 |
1 |
MacroId id4 = new MacroId("id", Syntax.XHTML_1_0); |
| 42 |
1 |
MacroId id5 = new MacroId("otherid", Syntax.XHTML_1_0); |
| 43 |
1 |
MacroId id6 = new MacroId("id"); |
| 44 |
1 |
MacroId id7 = new MacroId("id"); |
| 45 |
|
|
| 46 |
1 |
Assert.assertEquals(id2, id1); |
| 47 |
|
|
| 48 |
1 |
Assert.assertTrue(id1.hashCode() == id2.hashCode()); |
| 49 |
|
|
| 50 |
1 |
Assert.assertFalse(id3 == id1); |
| 51 |
1 |
Assert.assertFalse(id4 == id1); |
| 52 |
1 |
Assert.assertFalse(id5 == id3); |
| 53 |
1 |
Assert.assertFalse(id6 == id1); |
| 54 |
|
|
| 55 |
1 |
Assert.assertEquals(id7, id6); |
| 56 |
|
|
| 57 |
1 |
Assert.assertTrue(id6.hashCode() == id7.hashCode()); |
| 58 |
|
} |
| 59 |
|
} |