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