EasyMock 2.3

Clover coverage report - EasyMock 2.3
Coverage timestamp: mar. juil. 10 2007 02:46:04 CEST
FRAMES NO FRAMES

file stats: | LOC: | 27 |  | Methods: | 3
| NCLOC: | 16 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL

Find.java

-

100%

100%

100%

1 |  | /*
2 |  | * Copyright (c) 2001-2007 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.util.regex.Pattern;
8 |  |
9 |  | import org.easymock.IArgumentMatcher;
10 |  |
11 |  | public class Find implements IArgumentMatcher {
12 |  |
13 |  | private final String regex;
14 |  |
15 | 3 | public Find(String regex) {
16 | 3 | this.regex = regex;
17 |  | }
18 |  |
19 | 4 | public boolean matches(Object actual) {
20 | 4 | return (actual instanceof String)
21 |  | && Pattern.compile(regex).matcher((String) actual).find();
22 |  | }
23 |  |
24 | 1 | public void appendTo(StringBuffer buffer) {
25 | 1 | buffer.append("find(\"" + regex.replaceAll("\\\\", "\\\\\\\\") + "\")");
26 |  | }
27 |  | }