EasyMock 2.3

Clover coverage report - EasyMock 2.3
Coverage timestamp: mar. juil. 10 2007 02:46:04 CEST
FRAMES NO FRAMES

file stats: | LOC: | 110 |  | Methods: | 21
| NCLOC: | 81 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL

ReplayState.java

-

100%

100%

100%

1 |  | /*
2 |  | * Copyright (c) 2001-2007 OFFIS, Tammo Freese.
3 |  | * This program is made available under the terms of the MIT License.
4 |  | */
5 |  | package org.easymock.internal;
6 |  |
7 |  | import java.lang.reflect.Method;
8 |  |
9 |  | import org.easymock.ArgumentsMatcher;
10 |  | import org.easymock.IAnswer;
11 |  |
12 |  | public class ReplayState implements IMocksControlState {
13 |  |
14 |  | private IMocksBehavior behavior;
15 |  |
16 | 401 | public ReplayState(IMocksBehavior behavior) {
17 | 401 | this.behavior = behavior;
18 |  | }
19 |  |
20 | 570 | public Object invoke(Invocation invocation) throws Throwable {
21 | 570 | Result result = behavior.addActual(invocation);
22 | 522 | LastControl.pushCurrentArguments(invocation.getArguments());
23 | 522 | try {
24 | 522 | try {
25 | 522 | return result.answer();
26 |  | } catch (Throwable t) {
27 | 77 | throw new ThrowableWrapper(t);
28 |  | }
29 |  | } finally {
30 | 522 | LastControl.popCurrentArguments();
31 |  | }
32 |  | }
33 |  |
34 | 171 | public void verify() {
35 | 171 | behavior.verify();
36 |  | }
37 |  |
38 | 2 | public void replay() {
39 | 2 | throwWrappedIllegalStateException();
40 |  | }
41 |  |
42 | 1 | public void callback(Runnable runnable) {
43 | 1 | throwWrappedIllegalStateException();
44 |  | }
45 |  |
46 | 2 | public void checkOrder(boolean value) {
47 | 2 | throwWrappedIllegalStateException();
48 |  | }
49 |  |
50 | 2 | public void andReturn(Object value) {
51 | 2 | throwWrappedIllegalStateException();
52 |  | }
53 |  |
54 | 2 | public void andThrow(Throwable throwable) {
55 | 2 | throwWrappedIllegalStateException();
56 |  | }
57 |  |
58 | 1 | public void andAnswer(IAnswer answer) {
59 | 1 | throwWrappedIllegalStateException();
60 |  | }
61 |  |
62 | 2 | public void andStubReturn(Object value) {
63 | 2 | throwWrappedIllegalStateException();
64 |  | }
65 |  |
66 | 2 | public void andStubThrow(Throwable throwable) {
67 | 2 | throwWrappedIllegalStateException();
68 |  | }
69 |  |
70 | 1 | public void andStubAnswer(IAnswer answer) {
71 | 1 | throwWrappedIllegalStateException();
72 |  | }
73 |  |
74 | 2 | public void asStub() {
75 | 2 | throwWrappedIllegalStateException();
76 |  | }
77 |  |
78 | 3 | public void times(Range range) {
79 | 3 | throwWrappedIllegalStateException();
80 |  | }
81 |  |
82 | 2 | public void setMatcher(Method method, ArgumentsMatcher matcher) {
83 | 2 | throwWrappedIllegalStateException();
84 |  | }
85 |  |
86 | 3 | public void setDefaultMatcher(ArgumentsMatcher matcher) {
87 | 3 | throwWrappedIllegalStateException();
88 |  | }
89 |  |
90 | 7 | public void setDefaultReturnValue(Object value) {
91 | 7 | throwWrappedIllegalStateException();
92 |  | }
93 |  |
94 | 3 | public void setDefaultThrowable(Throwable throwable) {
95 | 3 | throwWrappedIllegalStateException();
96 |  | }
97 |  |
98 | 2 | public void setDefaultVoidCallable() {
99 | 2 | throwWrappedIllegalStateException();
100 |  | }
101 |  |
102 | 39 | private void throwWrappedIllegalStateException() {
103 | 39 | throw new RuntimeExceptionWrapper(new IllegalStateException(
104 |  | "This method must not be called in replay state."));
105 |  | }
106 |  |
107 | 2 | public void assertRecordState() {
108 | 2 | throwWrappedIllegalStateException();
109 |  | }
110 |  | }