com.google.gwtmockito
Class AsyncAnswers
java.lang.Object
com.google.gwtmockito.AsyncAnswers
public class AsyncAnswers
- extends Object
A collection of answers useful for testing asynchronous GWT applications.
- Author:
- ekuefler@google.com (Erik Kuefler)
- See Also:
Answer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsyncAnswers
public AsyncAnswers()
returnSuccess
public static <T> Answer<Void> returnSuccess(T result)
- Invokes
AsyncCallback.onSuccess(T)
on the first argument of type AsyncCallback
passed to the method. The method must take an AsyncCallback
parameter of the
appropriate type.
- Parameters:
result
- argument to pass to onSuccess
- Returns:
- an answer that invokes onSuccess with the given argument
returnFailure
public static Answer<Void> returnFailure(Throwable result)
- Invokes
AsyncCallback.onFailure(java.lang.Throwable)
on the first argument of type AsyncCallback
passed to the method. The method must take an AsyncCallback
parameter of the
appropriate type.
- Parameters:
result
- argument to pass to onFailure
- Returns:
- an answer that invokes onFailure with the given argument
Copyright © 2013. All Rights Reserved.