Clover Coverage Report - EasyMock 2.4
Coverage timestamp: mer. juil. 2 2008 02:17:38 CEST
42   99   6   7
0   70   0,14   6
6     1  
1    
 
 
  UsageLongCompatibleReturnValueTest       Line # 14 42 6 100% 1.0
 
  (5)
 
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.tests;
6   
7    import static org.junit.Assert.*;
8   
9    import org.easymock.MockControl;
10    import org.junit.Before;
11    import org.junit.Test;
12   
13    @SuppressWarnings("deprecation")
 
14    public class UsageLongCompatibleReturnValueTest {
15    MockControl<IMethods> control;
16   
17    IMethods mock;
18   
 
19  5 toggle @Before
20    public void setup() {
21  5 control = MockControl.createControl(IMethods.class);
22  5 mock = control.getMock();
23    }
24   
 
25  1 toggle @Test
26    public void returnByte() {
27  1 mock.byteReturningMethod(0);
28  1 control.setReturnValue(25);
29  1 control.setDefaultReturnValue(34);
30   
31  1 control.replay();
32   
33  1 assertEquals((byte) 25, mock.byteReturningMethod(0));
34  1 assertEquals((byte) 34, mock.byteReturningMethod(-4));
35  1 assertEquals((byte) 34, mock.byteReturningMethod(12));
36   
37  1 control.verify();
38    }
39   
 
40  1 toggle @Test
41    public void returnShort() {
42  1 mock.shortReturningMethod(0);
43  1 control.setReturnValue(25);
44  1 control.setDefaultReturnValue(34);
45   
46  1 control.replay();
47   
48  1 assertEquals((short) 25, mock.shortReturningMethod(0));
49  1 assertEquals((short) 34, mock.shortReturningMethod(-4));
50  1 assertEquals((short) 34, mock.shortReturningMethod(12));
51   
52  1 control.verify();
53    }
54   
 
55  1 toggle @Test
56    public void returnChar() {
57  1 mock.charReturningMethod(0);
58  1 control.setReturnValue(25);
59  1 control.setDefaultReturnValue(34);
60   
61  1 control.replay();
62   
63  1 assertEquals((char) 25, mock.charReturningMethod(0));
64  1 assertEquals((char) 34, mock.charReturningMethod(-4));
65  1 assertEquals((char) 34, mock.charReturningMethod(12));
66   
67  1 control.verify();
68    }
69   
 
70  1 toggle @Test
71    public void returnInt() {
72  1 mock.intReturningMethod(0);
73  1 control.setReturnValue(25);
74  1 control.setDefaultReturnValue(34);
75   
76  1 control.replay();
77   
78  1 assertEquals(25, mock.intReturningMethod(0));
79  1 assertEquals(34, mock.intReturningMethod(-4));
80  1 assertEquals(34, mock.intReturningMethod(12));
81   
82  1 control.verify();
83    }
84   
 
85  1 toggle @Test
86    public void returnLong() {
87  1 mock.longReturningMethod(0);
88  1 control.setReturnValue(25);
89  1 control.setDefaultReturnValue(34);
90   
91  1 control.replay();
92   
93  1 assertEquals((long) 25, mock.longReturningMethod(0));
94  1 assertEquals((long) 34, mock.longReturningMethod(-4));
95  1 assertEquals((long) 34, mock.longReturningMethod(12));
96   
97  1 control.verify();
98    }
99    }