|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JsMockObject
The interface all mock objects implement. This is the interface used by the unit tests once the mock object is created.
Field Summary | |
---|---|
static String |
ANY
Field used to expect any method so expectCall returns as soon as any method is called. |
static String |
NONE
Field used to expect that no methods have been called. |
Method Summary | |
---|---|
void |
addBehavior(String method,
JsBehavior behavior)
|
void |
addIgnore(String method)
When calling expect, the MockObject will ignore this method, so it will not result in an exception. |
void |
addReturnValue(String method,
Object o)
Add a return value to return when 'method' is called. |
void |
addThrowException(String method,
Throwable e)
Add an exception to throw when a method on the mockObject is called. |
JsCalledMethod |
expect(String method)
Waits for one and only one method to be called. |
JsCalledMethod[] |
expect(String[] methods)
Waits for all the methods to be called. |
int |
getExpectTimeout()
|
void |
removeIgnore(String method)
Removes the method from the ignored methods set. |
void |
setDefaultReturnValue(String method,
Object o)
Set the DefaultReturnValue for a 'method' |
void |
setExpectTimeout(int timeout)
|
Field Detail |
---|
static final String NONE
static final String ANY
Method Detail |
---|
JsCalledMethod expect(String method)
method
- The expected method.
JsCalledMethod[] expect(String[] methods)
methods
- The expected method(s) in the correct order.
void addThrowException(String method, Throwable e)
method
- The method to throw the exception on when it is called.e
- The exception to throw on method.void addReturnValue(String method, Object o)
method
- The method that when called returns first value on queueo
- The object to return that is added to the queuevoid addBehavior(String method, JsBehavior behavior)
void addIgnore(String method)
void removeIgnore(String method)
void setDefaultReturnValue(String method, Object o)
method
- The methodvoid setExpectTimeout(int timeout)
int getExpectTimeout()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |