Clover Coverage Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST
18   113   13   1,38
0   72   0,72   13
13     1  
1    
 
  ReplayStateInvalidUsageTest       Line # 31 18 0% 13 0 100% 1.0
 
  (24)
 
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 static org.easymock.EasyMock.*;
20   
21    import org.easymock.EasyMock;
22    import org.easymock.IExpectationSetters;
23    import org.easymock.IMocksControl;
24    import org.easymock.internal.ReplayState;
25    import org.junit.Before;
26    import org.junit.Test;
27   
28    /**
29    * @author OFFIS, Tammo Freese
30    */
 
31    public class ReplayStateInvalidUsageTest {
32   
33    private IMethods mock;
34   
35    private Exception exception;
36   
37    private ReplayState replayState;
38   
39    private IMocksControl mocksControl;
40   
41    private IExpectationSetters<String> expectationSetters;
42   
 
43  24 toggle @SuppressWarnings("unchecked")
44    @Before
45    public void setUp() {
46  24 exception = new Exception();
47  24 mock = EasyMock.createMock(IMethods.class);
48  24 EasyMock.replay(mock);
49  24 mocksControl = EasyMock.createControl();
50  24 mocksControl.replay();
51  24 expectationSetters = (IExpectationSetters<String>) mocksControl;
52    }
53   
 
54  2 toggle @Test(expected = IllegalStateException.class)
55    public void setVoidCallable() {
56  2 expectLastCall();
57    }
58   
 
59  2 toggle @Test(expected = IllegalStateException.class)
60    public void replay() {
61  2 EasyMock.replay(mock);
62    }
63   
 
64  2 toggle @Test(expected = IllegalStateException.class)
65    public void createMock() {
66  2 mocksControl.createMock(IMethods.class);
67    }
68   
 
69  2 toggle @Test(expected = IllegalStateException.class)
70    public void createMockWithName() {
71  2 mocksControl.createMock("", IMethods.class);
72    }
73   
 
74  2 toggle @Test(expected = IllegalStateException.class)
75    public void checkOrder() {
76  2 mocksControl.checkOrder(true);
77    }
78   
 
79  2 toggle @Test(expected = IllegalStateException.class)
80    public void makeThreadSafe() {
81  2 mocksControl.makeThreadSafe(true);
82    }
83   
 
84  2 toggle @Test(expected = IllegalStateException.class)
85    public void checkIsUsedInOneThread() {
86  2 mocksControl.checkIsUsedInOneThread(true);
87    }
88   
 
89  2 toggle @Test(expected = IllegalStateException.class)
90    public void andStubReturn() {
91  2 expectationSetters.andStubReturn("7");
92    }
93   
 
94  2 toggle @Test(expected = IllegalStateException.class)
95    public void andStubThrow() {
96  2 expectationSetters.andStubThrow(new RuntimeException());
97    }
98   
 
99  2 toggle @Test(expected = IllegalStateException.class)
100    public void asStub() {
101  2 expectationSetters.asStub();
102    }
103   
 
104  2 toggle @Test(expected = IllegalStateException.class)
105    public void times() {
106  2 expectationSetters.times(3);
107    }
108   
 
109  2 toggle @Test(expected = IllegalStateException.class)
110    public void anyTimes() {
111  2 expectationSetters.anyTimes();
112    }
113    }