1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.platform.wiki.creationjob; |
21 |
|
|
22 |
|
import org.junit.Test; |
23 |
|
|
24 |
|
import static org.junit.Assert.assertEquals; |
25 |
|
import static org.junit.Assert.assertNotEquals; |
26 |
|
|
27 |
|
|
28 |
|
@version |
29 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (25) |
Complexity: 1 |
Complexity Density: 0.04 |
|
30 |
|
public class WikiCreationExceptionTest |
31 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (24) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
32 |
1 |
@Test... |
33 |
|
public void equalsAndHashcode() throws Exception |
34 |
|
{ |
35 |
1 |
Throwable throwable = new Throwable(); |
36 |
|
|
37 |
1 |
Exception e1 = new WikiCreationException("message", throwable); |
38 |
1 |
Exception e2 = new WikiCreationException("message", throwable); |
39 |
1 |
Exception e3 = new WikiCreationException("message", throwable); |
40 |
1 |
Exception e4 = new WikiCreationException("message2", throwable); |
41 |
1 |
Exception e5 = new WikiCreationException("message", new Throwable()); |
42 |
1 |
Exception e6 = new Exception(); |
43 |
|
|
44 |
|
|
45 |
1 |
assertEquals(e1, e1); |
46 |
|
|
47 |
|
|
48 |
1 |
assertEquals(e1, e2); |
49 |
1 |
assertEquals(e2, e1); |
50 |
|
|
51 |
|
|
52 |
1 |
assertEquals(e1, e2); |
53 |
1 |
assertEquals(e1.hashCode(), e2.hashCode()); |
54 |
1 |
assertEquals(e2, e3); |
55 |
1 |
assertEquals(e2.hashCode(), e3.hashCode()); |
56 |
1 |
assertEquals(e1, e3); |
57 |
1 |
assertEquals(e1.hashCode(), e3.hashCode()); |
58 |
|
|
59 |
|
|
60 |
1 |
assertNotEquals(e4, e1); |
61 |
1 |
assertNotEquals(e4.hashCode(), e1.hashCode()); |
62 |
1 |
assertNotEquals(e1, e5); |
63 |
1 |
assertNotEquals(e5, e1); |
64 |
1 |
assertNotEquals(e1.hashCode(), e5.hashCode()); |
65 |
1 |
assertNotEquals(e6, e1); |
66 |
1 |
assertNotEquals(e1, e6); |
67 |
1 |
assertNotEquals(e1.hashCode(), e6.hashCode()); |
68 |
|
} |
69 |
|
} |