Clover Coverage Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST
24   153   24   1
0   106   1   24
24     1  
1    
 
  ReplayStateInvalidCallsTest       Line # 29 24 0% 24 1 97,9% 0.9791667
 
  (44)
 
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.tests;
18   
19    import org.easymock.internal.MocksBehavior;
20    import org.easymock.internal.Range;
21    import org.easymock.internal.ReplayState;
22    import org.easymock.internal.RuntimeExceptionWrapper;
23    import org.junit.Before;
24    import org.junit.Test;
25   
26    /**
27    * @author OFFIS, Tammo Freese
28    */
 
29    public class ReplayStateInvalidCallsTest {
30   
31    private ReplayState control;
32   
33    private Exception exception;
34   
 
35  44 toggle @Before
36    public void setUp() {
37  44 exception = new Exception();
38  44 control = new ReplayState(new MocksBehavior(false));
39    }
40   
 
41  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
42    public void expectAndThrowLongWithMinMax() {
43  2 control.andThrow(exception);
44    }
45   
 
46  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
47    public void expectAndReturnObjectWithMinMax() {
48  2 control.andReturn("");
49    }
50   
 
51  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
52    public void asStub() {
53  2 control.asStub();
54    }
55   
 
56  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
57    public void setDefaultReturnValue() {
58  2 control.setDefaultReturnValue("");
59    }
60   
 
61  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
62    public void setDefaultThrowable() {
63  2 control.setDefaultThrowable(exception);
64    }
65   
 
66  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
67    public void setDefaultVoidCallable() {
68  2 control.setDefaultVoidCallable();
69    }
70   
 
71  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
72    public void replay() {
73  2 control.replay();
74    }
75   
 
76  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
77    public void checkOrder() {
78  2 control.checkOrder(true);
79    }
80   
 
81  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
82    public void makeThreadSafe() {
83  2 control.makeThreadSafe(true);
84    }
85   
 
86  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
87    public void andStubReturn() {
88  2 control.andStubReturn("7");
89    }
90   
 
91  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
92    public void andStubThrow() {
93  2 control.andStubThrow(new RuntimeException());
94    }
95   
 
96  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
97    public void andStubAnswer() {
98  2 control.andStubAnswer(null);
99    }
100   
 
101  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
102    public void andStubDelegateTo() {
103  2 control.andStubDelegateTo(null);
104    }
105   
 
106  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
107    public void times() {
108  2 control.times(new Range(0, 1));
109    }
110   
 
111  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
112    public void callback() {
113  2 control.callback(new Runnable() {
 
114  0 toggle public void run() {
115    };
116    });
117    }
118   
 
119  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
120    public void andReturn() {
121  2 control.andReturn(null);
122    }
123   
 
124  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
125    public void andThrow() {
126  2 control.andThrow(new RuntimeException());
127    }
128   
 
129  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
130    public void andAnswer() {
131  2 control.andAnswer(null);
132    }
133   
 
134  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
135    public void andDelegateTo() {
136  2 control.andDelegateTo(null);
137    }
138   
 
139  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
140    public void defaultThrowable() {
141  2 control.setDefaultThrowable(new RuntimeException());
142    }
143   
 
144  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
145    public void defaultReturnValue() {
146  2 control.setDefaultReturnValue(null);
147    }
148   
 
149  2 toggle @Test(expected = RuntimeExceptionWrapper.class)
150    public void defaultVoidCallable() {
151  2 control.setDefaultVoidCallable();
152    }
153    }