|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.easymock.AbstractMatcher
A convenience implementation of ArgumentsMatcher
. A subclass that
does not redefine any method will behave like
MockControl.EQUALS_MATCHER
.
Constructor Summary | |
AbstractMatcher()
|
Method Summary | |
protected boolean |
argumentMatches(java.lang.Object expected,
java.lang.Object actual)
Compares two arguments; used by matches(Object[], Object[]) . |
protected java.lang.String |
argumentToString(java.lang.Object argument)
Converts an argument to a String, used by toString(Object[]) . |
boolean |
matches(java.lang.Object[] expected,
java.lang.Object[] actual)
Matches two arrays of arguments. |
java.lang.String |
toString(java.lang.Object[] arguments)
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 |
public AbstractMatcher()
Method Detail |
protected boolean argumentMatches(java.lang.Object expected, java.lang.Object actual)
matches(Object[], Object[])
. The arguments
provided to this method are always not null
.
expected
- the expected argument.actual
- the actual argument.
protected java.lang.String argumentToString(java.lang.Object argument)
toString(Object[])
.
argument
- the argument to convert to a String.
String
representation of the argument.public boolean matches(java.lang.Object[] expected, java.lang.Object[] actual)
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.
matches
in interface ArgumentsMatcher
expected
- the expected arguments.actual
- the actual arguments.
public java.lang.String toString(java.lang.Object[] arguments)
argumentToString(Object)
for
every argument in the given array and returns the string representations
of the arguments separated by commas.
toString
in interface ArgumentsMatcher
arguments
- the arguments to be used in the string representation.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |