| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
package org.easymock.tests; |
| 6 |
|
|
| 7 |
|
import org.easymock.MockControl; |
| 8 |
|
import org.easymock.internal.MocksBehavior; |
| 9 |
|
import org.easymock.internal.ReplayState; |
| 10 |
|
import org.easymock.internal.RuntimeExceptionWrapper; |
| 11 |
|
import org.junit.Before; |
| 12 |
|
import org.junit.Test; |
| 13 |
|
|
| 14 |
|
@SuppressWarnings("deprecation") |
|
|
|
| 97,9% |
Uncovered Elements: 1 (48) |
Complexity: 24 |
Complexity Density: 1 |
|
| 15 |
|
public class ReplayStateInvalidCallsTest { |
| 16 |
|
|
| 17 |
|
private ReplayState control; |
| 18 |
|
|
| 19 |
|
private Exception exception; |
| 20 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
| 21 |
22
|
@Before... |
| 22 |
|
public void setUp() { |
| 23 |
22
|
exception = new Exception(); |
| 24 |
22
|
control = new ReplayState(new MocksBehavior(false)); |
| 25 |
|
} |
| 26 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 27 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 28 |
|
public void expectAndThrowLongWithMinMax() { |
| 29 |
1
|
control.andThrow(exception); |
| 30 |
|
} |
| 31 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 32 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 33 |
|
public void expectAndReturnObjectWithMinMax() { |
| 34 |
1
|
control.andReturn(""); |
| 35 |
|
} |
| 36 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 37 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 38 |
|
public void setDefaultMatcher() { |
| 39 |
1
|
control.setDefaultMatcher(MockControl.ARRAY_MATCHER); |
| 40 |
|
} |
| 41 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 42 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 43 |
|
public void asStub() { |
| 44 |
1
|
control.asStub(); |
| 45 |
|
} |
| 46 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 47 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 48 |
|
public void setMatcher() { |
| 49 |
1
|
control.setMatcher(null, MockControl.ARRAY_MATCHER); |
| 50 |
|
} |
| 51 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 52 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 53 |
|
public void setDefaultReturnValue() { |
| 54 |
1
|
control.setDefaultReturnValue(""); |
| 55 |
|
} |
| 56 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 57 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 58 |
|
public void setDefaultThrowable() { |
| 59 |
1
|
control.setDefaultThrowable(exception); |
| 60 |
|
} |
| 61 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 62 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 63 |
|
public void setDefaultVoidCallable() { |
| 64 |
1
|
control.setDefaultVoidCallable(); |
| 65 |
|
} |
| 66 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 67 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 68 |
|
public void replay() { |
| 69 |
1
|
control.replay(); |
| 70 |
|
} |
| 71 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 72 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 73 |
|
public void checkOrder() { |
| 74 |
1
|
control.checkOrder(true); |
| 75 |
|
} |
| 76 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 77 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 78 |
|
public void makeThreadSafe() { |
| 79 |
1
|
control.makeThreadSafe(true); |
| 80 |
|
} |
| 81 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 82 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 83 |
|
public void andStubReturn() { |
| 84 |
1
|
control.andStubReturn("7"); |
| 85 |
|
} |
| 86 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 87 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 88 |
|
public void andStubThrow() { |
| 89 |
1
|
control.andStubThrow(new RuntimeException()); |
| 90 |
|
} |
| 91 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 92 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 93 |
|
public void andStubAnswer() { |
| 94 |
1
|
control.andStubAnswer(null); |
| 95 |
|
} |
| 96 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 97 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 98 |
|
public void times() { |
| 99 |
1
|
control.times(MockControl.ONE); |
| 100 |
|
} |
| 101 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 102 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 103 |
|
public void callback() { |
| 104 |
1
|
control.callback(new Runnable() { |
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 105 |
0
|
public void run() {... |
| 106 |
|
}; |
| 107 |
|
}); |
| 108 |
|
} |
| 109 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 110 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 111 |
|
public void andReturn() { |
| 112 |
1
|
control.andReturn(null); |
| 113 |
|
} |
| 114 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 115 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 116 |
|
public void andThrow() { |
| 117 |
1
|
control.andThrow(new RuntimeException()); |
| 118 |
|
} |
| 119 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 120 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 121 |
|
public void andAnswer() { |
| 122 |
1
|
control.andAnswer(null); |
| 123 |
|
} |
| 124 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 125 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 126 |
|
public void defaultThrowable() { |
| 127 |
1
|
control.setDefaultThrowable(new RuntimeException()); |
| 128 |
|
} |
| 129 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 130 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 131 |
|
public void defaultReturnValue() { |
| 132 |
1
|
control.setDefaultReturnValue(null); |
| 133 |
|
} |
| 134 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 135 |
1
|
@Test(expected = RuntimeExceptionWrapper.class)... |
| 136 |
|
public void defaultVoidCallable() { |
| 137 |
1
|
control.setDefaultVoidCallable(); |
| 138 |
|
} |
| 139 |
|
} |