org.easymock
Class AbstractMatcher

java.lang.Object
  extended by org.easymock.AbstractMatcher
All Implemented Interfaces:
java.io.Serializable, ArgumentsMatcher

Deprecated. Since EasyMock 2.0, ArgumentsMatchers are only supported for the legacy MockControl. For mock objects generated by the methods on EasyMock, there are per-argument matchers available. For more information, see the EasyMock documentation.

@Deprecated
public abstract class AbstractMatcher
extends java.lang.Object
implements ArgumentsMatcher, java.io.Serializable

A convenience implementation of ArgumentsMatcher. A subclass that does not redefine any method will behave like MockControl.EQUALS_MATCHER.

See Also:
Serialized Form

Constructor Summary
AbstractMatcher()
          Deprecated.  
 
Method Summary
protected  boolean argumentMatches(java.lang.Object expected, java.lang.Object actual)
          Deprecated. Checks whether an expected argument matches an actual argument; the method is used by matches(Object[], Object[]).
protected  java.lang.String argumentToString(java.lang.Object argument)
          Deprecated. Converts an argument to a String, used by toString(Object[]).
 boolean matches(java.lang.Object[] expected, java.lang.Object[] actual)
          Deprecated. Checks whether an expected argument array matches an actual argument array.
 java.lang.String toString(java.lang.Object[] arguments)
          Deprecated. Returns a string representation of the matcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMatcher

public AbstractMatcher()
Deprecated. 
Method Detail

argumentMatches

protected boolean argumentMatches(java.lang.Object expected,
                                  java.lang.Object actual)
Deprecated. 
Checks whether an expected argument matches an actual argument; the method is used by matches(Object[], Object[]). The arguments provided to this method are always not null.

Parameters:
expected - the expected argument.
actual - the actual argument.
Returns:
true if the arguments match, false otherwise.

argumentToString

protected java.lang.String argumentToString(java.lang.Object argument)
Deprecated. 
Converts an argument to a String, used by toString(Object[]).

Parameters:
argument - the argument to convert to a String.
Returns:
a String representation of the argument.

matches

public boolean matches(java.lang.Object[] expected,
                       java.lang.Object[] actual)
Deprecated. 
Checks whether an expected argument array matches an actual argument array. This convenience implementation uses argumentMatches(Object, Object) to check whether arguments pairs match. If all the arguments match, true is returned, otherwise false. In two cases, argumentMatches(Object, Object) is not called: If both argument arrays are null, they match; if one and only one is null, they do not match.

Specified by:
matches in interface ArgumentsMatcher
Parameters:
expected - the expected arguments.
actual - the actual arguments.
Returns:
true if the arguments match, false otherwise.

toString

public java.lang.String toString(java.lang.Object[] arguments)
Deprecated. 
Returns a string representation of the matcher. This convenience implementation calls argumentToString(Object) for every argument in the given array and returns the string representations of the arguments separated by commas.

Specified by:
toString in interface ArgumentsMatcher
Parameters:
arguments - the arguments to be used in the string representation.
Returns:
a string representation of the matcher.


Copyright © 2001-2009 OFFIS, Tammo Freese, Henri Tremblay. This documentation is provided under the terms of the Apache 2 licence.