|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.hammingweight.hammock.InvocationMatcher
public class InvocationMatcher
The InvocationMatcher class is a helper class for
verifying that expected and actual method invocations are equal.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
InvocationMatcher(MockMethod mockMethod)
Constructor. |
|
InvocationMatcher(MockMethod mockMethod,
IMockObject mockObject)
|
|
InvocationMatcher(MockMethod mockMethod,
IMockObject mockObject,
java.lang.Object[] expectedArgs)
Constructor. |
|
InvocationMatcher(MockMethod mockMethod,
java.lang.Object[] expectedArgs)
Constructor. |
|
| Method Summary | |
|---|---|
MockMethod |
getMethod()
A method to determine the method that is being validated. |
InvocationMatcher |
ignoreArgument(int argIndex)
A method to specify that we must ignore a particular argument when verifying whether expected and actual arguments are equal. |
boolean |
isMatch(MethodInvocation methodInvocation)
Verifies that the actual arguments passed to a method are as expected (i.e. |
InvocationMatcher |
setArgumentMatcher(int argIndex,
IArgumentMatcher argMatcher)
A method to set an argument matcher for a specific argument index. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InvocationMatcher(MockMethod mockMethod)
mockMethod - A method to be matched.
public InvocationMatcher(MockMethod mockMethod,
IMockObject mockObject)
public InvocationMatcher(MockMethod mockMethod,
java.lang.Object[] expectedArgs)
mockMethod - A method to be matched.expectedArgs - The arguments that are expected to be passed to the method.
public InvocationMatcher(MockMethod mockMethod,
IMockObject mockObject,
java.lang.Object[] expectedArgs)
mockMethod - A method to be matched.mockObject - The object on which the method is invoked.expectedArgs - The arguments that are expected to be passed to the method.| Method Detail |
|---|
public boolean isMatch(MethodInvocation methodInvocation)
methodInvocation - The method invocation of interest.
true if the methodInvocation matches the
expectation; else false.
public InvocationMatcher setArgumentMatcher(int argIndex,
IArgumentMatcher argMatcher)
argIndex - The argument index of interest.argMatcher - The matcher to use for the specified index.public InvocationMatcher ignoreArgument(int argIndex)
argIndex - The argument index to ignore.public MockMethod getMethod()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||