Clover Coverage Report - EasyMock 2.4
Coverage timestamp: mer. juil. 2 2008 02:17:38 CEST
9   41   7   3
2   29   0,78   3
3     2,33  
1    
 
 
  MockInvocationHandler       Line # 11 9 7 100% 1.0
 
  (263)
 
1    /*
2    * Copyright (c) 2001-2008 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.io.Serializable;
8    import java.lang.reflect.InvocationHandler;
9    import java.lang.reflect.Method;
10   
 
11    public final class MockInvocationHandler implements InvocationHandler, Serializable {
12   
13    private static final long serialVersionUID = -7799769066534714634L;
14   
15    private final MocksControl control;
16   
 
17  399 toggle public MockInvocationHandler(MocksControl control) {
18  399 this.control = control;
19    }
20   
 
21  1121 toggle public Object invoke(Object proxy, Method method, Object[] args)
22    throws Throwable {
23  1121 try {
24  1121 if (control.getState() instanceof RecordState) {
25  492 LastControl.reportLastControl(control);
26    }
27  1121 return control.getState().invoke(
28    new Invocation(proxy, method, args));
29    } catch (RuntimeExceptionWrapper e) {
30  1 throw e.getRuntimeException().fillInStackTrace();
31    } catch (AssertionErrorWrapper e) {
32  58 throw e.getAssertionError().fillInStackTrace();
33    } catch (ThrowableWrapper t) {
34  74 throw t.getThrowable().fillInStackTrace();
35    }
36    }
37   
 
38  160 toggle public MocksControl getControl() {
39  160 return control;
40    }
41    }