KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > easymock > tests > ReplayStateInvalidUsageTest


1 /*
2  * Copyright (c) 2001-2005 OFFIS. This program is made available under the terms of
3  * the MIT License.
4  */

5 package org.easymock.tests;
6
7 import junit.extensions.ExceptionTestCase;
8
9 import org.easymock.MockControl;
10
11 public class ReplayStateInvalidUsageTest extends ExceptionTestCase {
12
13     private MockControl<IMethods> control;
14
15     private Exception JavaDoc exception;
16
17     public ReplayStateInvalidUsageTest(String JavaDoc name) {
18         super(name, IllegalStateException JavaDoc.class);
19     }
20
21     protected void setUp() {
22         exception = new Exception JavaDoc();
23         control = MockControl.createControl(IMethods.class);
24         control.replay();
25     }
26
27     public void testExpectAndThrowObjectWithMinMax() {
28         control.expectAndThrow("", exception, 1, 2);
29     }
30
31     public void testExpectAndThrowDoubleWithMinMax() {
32         control.expectAndThrow(0.0d, exception, 1, 2);
33     }
34
35     public void testExpectAndThrowFloatWithMinMax() {
36         control.expectAndThrow(0.0f, exception, 1, 2);
37     }
38
39     public void testExpectAndThrowLongWithMinMax() {
40         control.expectAndThrow(0, exception, 1, 2);
41     }
42
43     public void testExpectAndThrowBooleanWithMinMax() {
44         control.expectAndThrow(false, exception, 1, 2);
45     }
46
47     public void testExpectAndThrowObjectWithCount() {
48         control.expectAndThrow("", exception, 1);
49     }
50
51     public void testExpectAndThrowDoubleWithCount() {
52         control.expectAndThrow(0.0d, exception, 1);
53     }
54
55     public void testExpectAndThrowFloatWithCount() {
56         control.expectAndThrow(0.0f, exception, 1);
57     }
58
59     public void testExpectAndThrowLongWithCount() {
60         control.expectAndThrow(0, exception, 1);
61     }
62
63     public void testExpectAndThrowBooleanWithCount() {
64         control.expectAndThrow(false, exception, 1);
65     }
66
67     public void testExpectAndThrowObjectWithRange() {
68         control.expectAndThrow("", exception, MockControl.ONE);
69     }
70
71     public void testExpectAndThrowDoubleWithRange() {
72         control.expectAndThrow(0.0d, exception, MockControl.ONE);
73     }
74
75     public void testExpectAndThrowFloatWithRange() {
76         control.expectAndThrow(0.0f, exception, MockControl.ONE);
77     }
78
79     public void testExpectAndThrowLongWithRange() {
80         control.expectAndThrow(0, exception, MockControl.ONE);
81     }
82
83     public void testExpectAndThrowBooleanWithRange() {
84         control.expectAndThrow(false, exception, MockControl.ONE);
85     }
86
87     public void testExpectAndThrowObject() {
88         control.expectAndThrow("", exception);
89     }
90
91     public void testExpectAndThrowDouble() {
92         control.expectAndThrow(0.0d, exception);
93     }
94
95     public void testExpectAndThrowFloat() {
96         control.expectAndThrow(0.0f, exception);
97     }
98
99     public void testExpectAndThrowLong() {
100         control.expectAndThrow(0, exception);
101     }
102
103     public void testExpectAndThrowBoolean() {
104         control.expectAndThrow(false, exception);
105     }
106
107     public void testExpectAndReturnObjectWithMinMax() {
108         control.expectAndReturn("", "", 1, 2);
109     }
110
111     public void testExpectAndReturnDoubleWithMinMax() {
112         control.expectAndReturn(0.0d, 0.0d, 1, 2);
113     }
114
115     public void testExpectAndReturnFloatWithMinMax() {
116         control.expectAndReturn(0.0f, 0.0f, 1, 2);
117     }
118
119     public void testExpectAndReturnLongWithMinMax() {
120         control.expectAndReturn(0, 0, 1, 2);
121     }
122
123     public void testExpectAndReturnBooleanWithMinMax() {
124         control.expectAndReturn(false, false, 1, 2);
125     }
126
127     public void testExpectAndReturnObjectWithCount() {
128         control.expectAndReturn("", "", 1);
129     }
130
131     public void testExpectAndReturnDoubleWithCount() {
132         control.expectAndReturn(0.0d, 0.0d, 1);
133     }
134
135     public void testExpectAndReturnFloatWithCount() {
136         control.expectAndReturn(0.0f, 0.0f, 1);
137     }
138
139     public void testExpectAndReturnLongWithCount() {
140         control.expectAndReturn(0, 0, 1);
141     }
142
143     public void testExpectAndReturnBooleanWithCount() {
144         control.expectAndReturn(false, false, 1);
145     }
146
147     public void testExpectAndReturnObjectWithRange() {
148         control.expectAndReturn("", "", MockControl.ONE);
149     }
150
151     public void testExpectAndReturnDoubleWithRange() {
152         control.expectAndReturn(0.0d, 0.0d, MockControl.ONE);
153     }
154
155     public void testExpectAndReturnFloatWithRange() {
156         control.expectAndReturn(0.0f, 0.0f, MockControl.ONE);
157     }
158
159     public void testExpectAndReturnLongWithRange() {
160         control.expectAndReturn(0, 0, MockControl.ONE);
161     }
162
163     public void testExpectAndReturnBooleanWithRange() {
164         control.expectAndReturn(false, false, MockControl.ONE);
165     }
166
167     public void testExpectAndReturnObject() {
168         control.expectAndReturn("", "");
169     }
170
171     public void testExpectAndReturnDouble() {
172         control.expectAndReturn(0.0d, 0.0d);
173     }
174
175     public void testExpectAndReturnFloat() {
176         control.expectAndReturn(0.0f, 0.0f);
177     }
178
179     public void testExpectAndReturnLong() {
180         control.expectAndReturn(0, 0);
181     }
182
183     public void testExpectAndReturnBoolean() {
184         control.expectAndReturn(false, false);
185     }
186
187     public void testSetDefaultMatcher() {
188         control.setDefaultMatcher(MockControl.ARRAY_MATCHER);
189     }
190
191     public void testSetReturnValueObjectWithMinMax() {
192         control.setReturnValue("", 1, 2);
193     }
194
195     public void testSetReturnValueDoubleWithMinMax() {
196         control.setReturnValue(0.0d, 1, 2);
197     }
198
199     public void testSetReturnValueFloatWithMinMax() {
200         control.setReturnValue(0.0f, 1, 2);
201     }
202
203     public void testSetReturnValueLongWithMinMax() {
204         control.setReturnValue(0, 1, 2);
205     }
206
207     public void testSetReturnValueBooleanWithMinMax() {
208         control.setReturnValue(false, 1, 2);
209     }
210
211     public void testSetThrowableWithMinMax() {
212         control.setThrowable(exception, 1, 2);
213     }
214
215     public void testSetVoidCallableWithMinMax() {
216         control.setVoidCallable(1, 2);
217     }
218
219     public void testSetMatcher() {
220         control.setMatcher(MockControl.ARRAY_MATCHER);
221     }
222
223     public void testSetDefaultReturnValueObject() {
224         control.setDefaultReturnValue("");
225     }
226
227     public void testSetDefaultReturnValueDouble() {
228         control.setDefaultReturnValue(0.0d);
229     }
230
231     public void testSetDefaultReturnValueFloat() {
232         control.setDefaultReturnValue(0.0f);
233     }
234
235     public void testSetDefaultReturnValueLong() {
236         control.setDefaultReturnValue(0);
237     }
238
239     public void testSetDefaultReturnValueBoolean() {
240         control.setDefaultReturnValue(false);
241     }
242
243     public void testSetDefaultThrowable() {
244         control.setDefaultThrowable(exception);
245     }
246
247     public void testSetDefaultVoidCallable() {
248         control.setDefaultVoidCallable();
249     }
250
251     public void testSetReturnValueObjectWithRange() {
252         control.setReturnValue("", MockControl.ONE);
253     }
254
255     public void testSetReturnValueLongWithRange() {
256         control.setReturnValue(0, MockControl.ONE);
257     }
258
259     public void testSetReturnValueFloatWithRange() {
260         control.setReturnValue(0.0f, MockControl.ONE);
261     }
262
263     public void testSetReturnValueDoubleWithRange() {
264         control.setReturnValue(0.0d, MockControl.ONE);
265     }
266
267     public void testSetReturnValueBooleanWithRange() {
268         control.setReturnValue(false, MockControl.ONE);
269     }
270
271     public void testSetThrowableWithRange() {
272         control.setThrowable(exception, MockControl.ONE);
273     }
274
275     public void testSetVoidCallableWithRange() {
276         control.setVoidCallable(MockControl.ONE);
277     }
278
279     public void testSetReturnValueObjectWithCount() {
280         control.setReturnValue("", 1);
281     }
282
283     public void testSetReturnValueLongWithCount() {
284         control.setReturnValue(0, 1);
285     }
286
287     public void testSetReturnValueFloatWithCount() {
288         control.setReturnValue(0.0f, 1);
289     }
290
291     public void testSetReturnValueDoubleWithCount() {
292         control.setReturnValue(0.0d, 1);
293     }
294
295     public void testSetReturnValueBooleanWithCount() {
296         control.setReturnValue(false, 1);
297     }
298
299     public void testSetThrowableWithCount() {
300         control.setThrowable(exception, 1);
301     }
302
303     public void testSetVoidCallableWithCount() {
304         control.setVoidCallable(1);
305     }
306
307     public void testSetReturnValueObject() {
308         control.setReturnValue("");
309     }
310
311     public void testSetReturnValueDouble() {
312         control.setReturnValue(0.0d);
313     }
314
315     public void testSetReturnValueFloat() {
316         control.setReturnValue(0.0f);
317     }
318
319     public void testSetReturnValueLong() {
320         control.setReturnValue(0);
321     }
322
323     public void testSetReturnValueBoolean() {
324         control.setReturnValue(false);
325     }
326
327     public void testSetThrowable() {
328         control.setThrowable(exception);
329     }
330
331     public void testSetVoidCallable() {
332         control.setVoidCallable();
333     }
334
335     public void testReplay() {
336         control.replay();
337     }
338 }
Popular Tags