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: | 38 |  | Methods: | 3
| NCLOC: | 27 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL

MockInvocationHandler.java

100%

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.InvocationHandler;
8 |  | import java.lang.reflect.Method;
9 |  |
10 |  | public final class MockInvocationHandler implements InvocationHandler {
11 |  |
12 |  | final MocksControl control;
13 |  |
14 | 375 | public MockInvocationHandler(MocksControl control) {
15 | 375 | this.control = control;
16 |  | }
17 |  |
18 | 1022 | public Object invoke(Object proxy, Method method, Object[] args)
19 |  | throws Throwable {
20 | 1022 | try {
21 | 1022 | if (control.getState() instanceof RecordState) {
22 | 452 | LastControl.reportLastControl(control);
23 |  | }
24 | 1022 | return control.getState().invoke(
25 |  | new Invocation(proxy, method, args));
26 |  | } catch (RuntimeExceptionWrapper e) {
27 | 1 | throw e.getRuntimeException().fillInStackTrace();
28 |  | } catch (AssertionErrorWrapper e) {
29 | 47 | throw e.getAssertionError().fillInStackTrace();
30 |  | } catch (ThrowableWrapper t) {
31 | 77 | throw t.getThrowable().fillInStackTrace();
32 |  | }
33 |  | }
34 |  |
35 | 117 | public MocksControl getControl() {
36 | 117 | return control;
37 |  | }
38 |  | }