Thanks! That's exactly what I was looking for!

Nathan Wells


On Fri, Sep 18, 2009 at 7:17 AM, Thomas Broyer <[email protected]> wrote:

>
>
> On 18 sep, 14:48, Nathan Wells 
> <[email protected]<https://mail.adaptivecomputing.com/zimbra?app=mail&view=compose&[email protected]>>
> wrote:
> > What exactly will force you into using a GwtTestCase? is it simply
> > manipulation of the DOM in underlying classes?
>
> That, and any "native" (JSNI) method.
>
> My rule of thumb:
> 1. Start with a "pure Java" JUnit test
> 2. if it fails on GWT.create(), add calls to GWTMockUtilities.disarm()/
> restore() (generally disarm in the setUp and restore in the teardown)
> 3. if it still fails (generally something to do with "native" methods,
> which actually are JSNI methods; but there might be some
> NullPointerException's too; for example, if you use History, you'll
> have an ExceptionInInitializerError, due to a NullPointerException
> because GWT.create(HistoryImpl.class) returns a 'null' value that
> isn't checked before use), the use a GWTTestCase.
>
> ...in the case of History though, if you do not intend to test you
> code related to History, you can just change your class to enclose
> each access to History with an if (GWT.isClient()) { /* use History
> here */ } and thus still use a plain old JUnit test case.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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