Clover Coverage Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST
../../../img/srcFileCovDistChart10.png 0% of files have more coverage
13   61   7   2,6
4   33   0,54   5
5     1,4  
1    
 
  ErrorMessage       Line # 22 13 0% 7 0 100% 1.0
 
  (114)
 
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.internal;
18   
19    /**
20    * @author OFFIS, Tammo Freese
21    */
 
22    public class ErrorMessage {
23   
24    private final boolean matching;
25   
26    private final String message;
27   
28    private final int actualCount;
29   
 
30  242 toggle public ErrorMessage(final boolean matching, final String message, final int actualCount) {
31  242 this.matching = matching;
32  242 this.message = message;
33  242 this.actualCount = actualCount;
34    }
35   
 
36  184 toggle public boolean isMatching() {
37  184 return matching;
38    }
39   
 
40  2 toggle public String getMessage() {
41  2 return message;
42    }
43   
 
44  242 toggle public int getActualCount() {
45  242 return actualCount;
46    }
47   
 
48  240 toggle public void appendTo(final StringBuilder buffer, final int matches) {
49  240 buffer.append("\n ").append(message).append(", actual: ");
50  240 if (matching) {
51  46 if (matches == 1) {
52  40 buffer.append(getActualCount() + 1);
53    } else {
54  6 buffer.append(getActualCount());
55  6 buffer.append(" (+1)");
56    }
57    } else {
58  194 buffer.append(getActualCount());
59    }
60    }
61    }