Clover Coverage Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST
12   60   4   3
0   31   0,33   4
4     1  
1    
 
  ResultTest       Line # 29 12 0% 4 0 100% 1.0
 
  (8)
 
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.junit.Assert.*;
20   
21    import org.easymock.internal.Result;
22    import org.easymock.internal.Results;
23    import org.junit.Test;
24   
25    /**
26    * @author OFFIS, Tammo Freese
27    * @author Henri Tremblay
28    */
 
29    public class ResultTest {
30   
 
31  2 toggle @Test
32    public void createThrowResultToString() {
33  2 final Exception e = new Exception("Error message");
34  2 final Result r = Result.createThrowResult(e);
35  2 assertEquals("Answer throwing " + e, r.toString());
36    }
37   
 
38  2 toggle @Test
39    public void createReturnResultToString() {
40  2 final String value = "My value";
41  2 final Result r = Result.createReturnResult(value);
42  2 assertEquals("Answer returning " + value, r.toString());
43    }
44   
 
45  2 toggle @Test
46    public void createDelegateResultToString() {
47  2 final String value = "my value";
48  2 final Result r = Result.createDelegatingResult(value);
49  2 assertEquals("Delegated to " + value, r.toString());
50    }
51   
 
52  2 toggle @Test
53    public void emptyResults() {
54    // We never create a Results without at least one Range
55    // This test is only to unit test Results with this to cover the case anyway
56  2 final Results results = new Results();
57  2 assertFalse(results.hasResults());
58  2 assertNull(results.next());
59    }
60    }