Clover Coverage Report - EasyMock 2.4
Coverage timestamp: mer. juil. 2 2008 02:17:38 CEST
3   29   3   1
0   17   1   3
3     1  
1    
 
 
  Contains       Line # 11 3 3 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.internal.matchers;
6   
7    import java.io.Serializable;
8   
9    import org.easymock.IArgumentMatcher;
10   
 
11    public class Contains implements IArgumentMatcher, Serializable {
12   
13    private static final long serialVersionUID = -6785245714002503134L;
14   
15    private final String substring;
16   
 
17  7 toggle public Contains(String substring) {
18  7 this.substring = substring;
19    }
20   
 
21  10 toggle public boolean matches(Object actual) {
22  10 return (actual instanceof String)
23    && ((String) actual).indexOf(substring) >= 0;
24    }
25   
 
26  4 toggle public void appendTo(StringBuffer buffer) {
27  4 buffer.append("contains(\"" + substring + "\")");
28    }
29    }