On 31 mar, 13:39, jp <[email protected]> wrote:
> Hi all ,
> In gwt test case I have to make an an ajax call using RequestBuilder ,
> Need to test the onError method on RequestCallback
> is executed or not if we provide a wrong URL, I tried setting the
> status or response,
> tried many ways the onError method is not executed
> Please help me

There are very few cases when onError would be called, the most common
one being a timeout if you call setTimeoutMillis with a non-0 value.

The easy way to reliably have it is to Thread.sleep() on the server
side with a long value while having a short timeout on the client
side. Maybe GWT's own unit tests could inspire you?
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/test/com/google/gwt/http/client/RequestBuilderTest.java#389
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/test/com/google/gwt/http/server/RequestBuilderTestServlet.java#66
(note that it won't run reliably in -runStyle:HtmlUnit due to a but in
HtmlUnit)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to