com.google.gwtmockito
Class AsyncAnswers

java.lang.Object
  extended by 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

Constructor Summary
AsyncAnswers()
           
 
Method Summary
static Answer<Void> returnFailure(Throwable result)
          Invokes AsyncCallback.onFailure(java.lang.Throwable) on the first argument of type AsyncCallback passed to the method.
static
<T> Answer<Void>
returnSuccess(T result)
          Invokes AsyncCallback.onSuccess(T) on the first argument of type AsyncCallback passed to the method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncAnswers

public AsyncAnswers()
Method Detail

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.