Brett Chabot | 47d431f | 2010-02-02 15:28:33 -0800 | [diff] [blame] | 1 | /*
|
| 2 | * Copyright 2001-2009 OFFIS, Tammo Freese
|
| 3 | *
|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 | * you may not use this file except in compliance with the License.
|
| 6 | * You may obtain a copy of the License at
|
| 7 | *
|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 9 | *
|
| 10 | * Unless required by applicable law or agreed to in writing, software
|
| 11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 | * See the License for the specific language governing permissions and
|
| 14 | * limitations under the License.
|
| 15 | */
|
| 16 | package org.easymock;
|
| 17 |
|
| 18 | /**
|
| 19 | * A comparison function that is used to match arguments.
|
| 20 | *
|
| 21 | * @see MockControl#setDefaultMatcher
|
| 22 | * @see MockControl#setMatcher
|
| 23 | * @see MockControl#EQUALS_MATCHER
|
| 24 | * @see MockControl#ARRAY_MATCHER
|
| 25 | * @see MockControl#ALWAYS_MATCHER
|
| 26 | *
|
| 27 | * @deprecated Since EasyMock 2.0, <code>ArgumentsMatcher</code>s are only supported
|
| 28 | * for the legacy <code>MockControl</code>. For mock objects generated by the methods
|
| 29 | * on <code>EasyMock</code>, there are per-argument matchers available. For more
|
| 30 | * information, see the EasyMock documentation.
|
| 31 | */
|
| 32 | public interface ArgumentsMatcher {
|
| 33 |
|
| 34 | /**
|
| 35 | * Matches two arrays of arguments.
|
| 36 | *
|
| 37 | * @param expected
|
| 38 | * the expected arguments.
|
| 39 | * @param actual
|
| 40 | * the actual arguments.
|
| 41 | * @return true if the arguments match, false otherwise.
|
| 42 | */
|
| 43 | boolean matches(Object[] expected, Object[] actual);
|
| 44 |
|
| 45 | /**
|
| 46 | * Returns a string representation of the arguments.
|
| 47 | *
|
| 48 | * @param arguments
|
| 49 | * the arguments to be used in the string representation.
|
| 50 | * @return a string representation of the arguments.
|
| 51 | */
|
| 52 | String toString(Object[] arguments);
|
| 53 | }
|