|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jface.mockobject.Expectation
The Expectation object encapsulates all information expected as
behaviour of a mock object. It contains the name of the mock method, the
parameters, the possible return value and Throwable.
| Constructor Summary | |
Expectation(java.lang.String methodName)
Creates a new Expectation object for the mock method with the
given name. |
|
Expectation(java.lang.String methodName,
boolean methodNameTolerant,
boolean parametersTolerant)
Creates a new Expectation object for the mock method with the
given name. |
|
| Method Summary | |
java.lang.String |
getMethodName()
Returns the name of the expected mock method. |
java.lang.Object[] |
getParameters()
Returns the expected parameters of the mock method. |
java.lang.Object |
getReturnValue()
Returns the expected return value. |
java.lang.Throwable |
getThrowable()
Returns the expected Throwable. |
boolean |
isMethodNameTolerant()
Returns true if the next methods are skipped, until the method defined by this Expectation is reached. |
boolean |
isParametersTolerant()
Returns true if the next parameters are ignored. |
jface.mockobject.Expectation |
parameter(java.lang.Object parameter)
Appends a paramter to the list of expected parameters. |
jface.mockobject.Expectation |
parameters(java.lang.Object[] parameters)
Appends a number of parameters to the list of expected parameters. |
jface.mockobject.Expectation |
returnValue(java.lang.Object returnValue)
Sets the expected return value. |
void |
setMethodNameTolerant(boolean methodNameTolerant)
Set to true if the next methods should be skipped, until the method defined by this Expectation is reached. |
void |
setParametersTolerant(boolean parametersTolerant)
Set to true if the next parameter values should be ingored. |
jface.mockobject.Expectation |
throwable(java.lang.Throwable throwable)
Sets the expected Throwable. |
java.lang.String |
toString()
Returns the String representaiton of this Expectation
instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Expectation(java.lang.String methodName)
Expectation object for the mock method with the
given name.
methodName - The name of the mock method.
public Expectation(java.lang.String methodName,
boolean methodNameTolerant,
boolean parametersTolerant)
Expectation object for the mock method with the
given name. It is possible to make it ignore the method calls until this
method is reached. Set methodNameTolerat to true. If
the method parameters should be ignored, too, set
parametersTolerant to true.
methodName - The name of the method.methodNameTolerant - If true, all methods are ignored
until the given method is reached.parametersTolerant - If true, all method parameters are
ignored.| Method Detail |
public java.lang.String getMethodName()
public java.lang.Object[] getParameters()
public java.lang.Object getReturnValue()
public java.lang.Throwable getThrowable()
Throwable. If not null, this
Throwable will be thrown by the mock method.
Throwable.public jface.mockobject.Expectation parameter(java.lang.Object parameter)
parameter - An additional expected parameter.
public jface.mockobject.Expectation parameters(java.lang.Object[] parameters)
parameters - Each element of the array will be added as a single
expected parameter.
public jface.mockobject.Expectation returnValue(java.lang.Object returnValue)
returnValue - The expected return value.
public jface.mockobject.Expectation throwable(java.lang.Throwable throwable)
Throwable.
throwable - The expected Throwable.
public java.lang.String toString()
String representaiton of this Expectation
instance.
toString in class java.lang.Objectpublic boolean isMethodNameTolerant()
Expectation is reached.
public void setMethodNameTolerant(boolean methodNameTolerant)
Expectation is reached.
methodNameTolerant - If true, the next methods are
skipped, until the method defined by this
Expectation is reached.public boolean isParametersTolerant()
public void setParametersTolerant(boolean parametersTolerant)
parametersTolerant - If true, the next parameter values
will be ignored.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||