31 | * Like Object.equals(), it should be aware that the argument passed might 32 | * be null and of any type. So you will usually start the method with an 33 | * instanceof and/or null check. 34 | *
35 | * The method should never assert if the argument doesn't match. It
36 | * should only return false. EasyGwtMock will take care of asserting if the
37 | * call is really unexpected.
38 | */
39 | boolean matches(Object argument);
40 |
41 | /**
42 | * Appends a string representation of this matcher to the given buffer. In
43 | * case of failure, the printed message will show this string to allow to
44 | * know which matcher was used for the failing call.
45 | */
46 | void appendTo(StringBuffer buffer);
47 | }
48 |
--------------------------------------------------------------------------------
/java/com/google/gwt/testing/easygwtmock/client/Capture.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2001-2010 the original author or authors.
3 | * Portions Copyright 2011 Google Inc.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package com.google.gwt.testing.easygwtmock.client;
19 |
20 | import java.util.ArrayList;
21 | import java.util.List;
22 |
23 | /**
24 | * Will contain what was captured by the {@code capture()} matcher.
25 | *
26 | * @param