1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
package org.easymock.tests; |
18 |
|
|
19 |
|
import static org.junit.Assert.*; |
20 |
|
|
21 |
|
import java.lang.reflect.Method; |
22 |
|
|
23 |
|
import org.easymock.internal.ExpectedInvocation; |
24 |
|
import org.easymock.internal.Invocation; |
25 |
|
import org.junit.Before; |
26 |
|
import org.junit.Test; |
27 |
|
|
28 |
|
|
29 |
|
@author |
30 |
|
|
|
|
| 88,9% |
Uncovered Elements: 1 (9) |
Complexity: 3 |
Complexity Density: 0,43 |
|
31 |
|
public class ExpectedMethodCallTest { |
32 |
|
|
33 |
|
private ExpectedInvocation call; |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
35 |
2
|
@Before... |
36 |
|
public void setup() throws SecurityException, NoSuchMethodException { |
37 |
2
|
final Object[] arguments1 = new Object[] { "" }; |
38 |
2
|
final Method m = Object.class.getMethod("equals", new Class[] { Object.class }); |
39 |
2
|
call = new ExpectedInvocation(new Invocation(null, m, arguments1), null); |
40 |
|
} |
41 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 0,5 |
1
PASS
|
|
42 |
2
|
@Test... |
43 |
|
public void testHashCode() { |
44 |
2
|
try { |
45 |
2
|
call.hashCode(); |
46 |
0
|
fail(); |
47 |
|
} catch (final UnsupportedOperationException expected) { |
48 |
2
|
assertEquals("hashCode() is not implemented", expected.getMessage()); |
49 |
|
} |
50 |
|
} |
51 |
|
} |