Clover Coverage Report - EasyMock 2.4
Coverage timestamp: mer. juil. 2 2008 02:17:38 CEST
3   30   3   1
0   18   1   3
3     1  
1    
 
 
  Find       Line # 12 3 3 100% 1.0
 
  (2)
 
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    import java.util.regex.Pattern;
9   
10    import org.easymock.IArgumentMatcher;
11   
 
12    public class Find implements IArgumentMatcher, Serializable {
13   
14    private static final long serialVersionUID = -7104607303959381785L;
15   
16    private final String regex;
17   
 
18  3 toggle public Find(String regex) {
19  3 this.regex = regex;
20    }
21   
 
22  4 toggle public boolean matches(Object actual) {
23  4 return (actual instanceof String)
24    && Pattern.compile(regex).matcher((String) actual).find();
25    }
26   
 
27  1 toggle public void appendTo(StringBuffer buffer) {
28  1 buffer.append("find(\"" + regex.replaceAll("\\\\", "\\\\\\\\") + "\")");
29    }
30    }