Clover Coverage Report - EasyMock 2.4
Coverage timestamp: mer. juil. 2 2008 02:17:38 CEST
24   66   6   24
2   47   0,25   1
1     6  
1    
 
 
  LegacyBehaviorTests       Line # 15 24 6 0% 0.0
 
No Tests
 
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 java.io.IOException;
10   
11    import org.easymock.MockControl;
12    import org.junit.Test;
13   
14    @SuppressWarnings("deprecation")
 
15    public class LegacyBehaviorTests {
16   
 
17  0 toggle @Test
18    public void throwAfterThrowable() throws IOException {
19   
20  0 MockControl<IMethods> control = MockControl
21    .createControl(IMethods.class);
22  0 IMethods mock = control.getMock();
23   
24  0 mock.throwsIOException(0);
25  0 control.setThrowable(new IOException());
26  0 control.setThrowable(new IOException(), MockControl.ONE_OR_MORE);
27   
28  0 control.replay();
29   
30  0 try {
31  0 mock.throwsIOException(0);
32  0 fail("IOException expected");
33    } catch (IOException expected) {
34    }
35   
36  0 boolean exceptionOccured = true;
37  0 try {
38  0 control.verify();
39  0 exceptionOccured = false;
40    } catch (AssertionError expected) {
41  0 assertEquals(
42    "\n Expectation failure on verify:"
43    + "\n throwsIOException(0): expected: at least 2, actual: 1",
44    expected.getMessage());
45    }
46   
47  0 if (!exceptionOccured)
48  0 fail("exception expected");
49   
50  0 try {
51  0 mock.throwsIOException(0);
52  0 fail("IOException expected");
53    } catch (IOException expected) {
54    }
55   
56  0 control.verify();
57   
58  0 try {
59  0 mock.throwsIOException(0);
60  0 fail("IOException expected");
61    } catch (IOException expected) {
62    }
63   
64  0 control.verify();
65    }
66    }