1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| package org.easymock.internal; |
6 |
| |
7 |
| import java.lang.reflect.Method; |
8 |
| |
9 |
| import org.easymock.ArgumentsMatcher; |
10 |
| |
11 |
| public class ExpectedMethodCall { |
12 |
| |
13 |
| private final MethodCall methodCall; |
14 |
| |
15 |
| private final ArgumentsMatcher matcher; |
16 |
| |
17 |
221
| public ExpectedMethodCall(Method method, Object[] arguments,
|
18 |
| ArgumentsMatcher matcher) { |
19 |
221
| this.methodCall = new MethodCall(method, arguments);
|
20 |
221
| this.matcher = matcher;
|
21 |
| } |
22 |
| |
23 |
94
| public boolean equals(Object o) {
|
24 |
94
| if (o == null || !this.getClass().equals(o.getClass()))
|
25 |
1
| return false;
|
26 |
| |
27 |
93
| ExpectedMethodCall other = (ExpectedMethodCall) o;
|
28 |
93
| return this.methodCall.equals(other.methodCall)
|
29 |
| && this.matcher.equals(other.matcher); |
30 |
| } |
31 |
| |
32 |
1
| public int hashCode() {
|
33 |
1
| return methodCall.hashCode();
|
34 |
| } |
35 |
| |
36 |
397
| public boolean matches(MethodCall actualCall) {
|
37 |
397
| return this.methodCall.matches(actualCall, matcher);
|
38 |
| } |
39 |
| |
40 |
313
| public boolean matches(Method method, Object[] arguments) {
|
41 |
313
| return matches(new MethodCall(method, arguments));
|
42 |
| } |
43 |
| |
44 |
62
| public String toString() {
|
45 |
62
| return methodCall.toString(matcher);
|
46 |
| } |
47 |
| } |