Clover Coverage Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST
../../../img/srcFileCovDistChart10.png 0% of files have more coverage
9   55   7   3
2   27   0,78   3
3     2,33  
1    
 
  MockInvocationHandler       Line # 26 9 0% 7 0 100% 1.0
 
  (763)
 
1    /**
2    * Copyright 2001-2010 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16   
17    package org.easymock.internal;
18   
19    import java.io.Serializable;
20    import java.lang.reflect.InvocationHandler;
21    import java.lang.reflect.Method;
22   
23    /**
24    * @author OFFIS, Tammo Freese
25    */
 
26    public final class MockInvocationHandler implements InvocationHandler, Serializable {
27   
28    private static final long serialVersionUID = -7799769066534714634L;
29   
30    private final MocksControl control;
31   
 
32  996 toggle public MockInvocationHandler(final MocksControl control) {
33  996 this.control = control;
34    }
35   
 
36  3236 toggle public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
37  3236 try {
38  3236 if (control.getState() instanceof RecordState) {
39  1464 LastControl.reportLastControl(control);
40    }
41  3236 return control.getState().invoke(new Invocation(proxy, method, args));
42    } catch (final RuntimeExceptionWrapper e) {
43  4 throw e.getRuntimeException().fillInStackTrace();
44    } catch (final AssertionErrorWrapper e) {
45  210 throw e.getAssertionError().fillInStackTrace();
46    } catch (final ThrowableWrapper t) {
47  156 throw t.getThrowable().fillInStackTrace();
48    }
49    // then let all unwrapped exceptions pass unmodified
50    }
51   
 
52  1280 toggle public MocksControl getControl() {
53  1280 return control;
54    }
55    }