Hi! In GWT you can write:
- plain JUnit tests, - tests that are running inside browser (see GwtTestCase). You can hide instance of DataPicker behind HasValue interface. I.e. use: HasValue<Date> dataPicker instead of: DataPicker dataPicker This will allow you to create a mock for a dataPicker control with a behavior you need. Mocks will allow you write plain JUnit tests that are much faster. -- Kind regards, Ignat Alexeyenko. On Thu, Oct 28, 2010 at 7:31 PM, chrisr <[email protected]>wrote: > I've been writing JUnit tests for my GWT code for a while, and I've > always come across issues where it feels like something very simple > doesn't work. Usually I can figure out a way to make it work, however > that usually feels wrong... > > Right now I'm trying to write a test that involves an instance of > DatePicker. I test the return of getValue() after calling > setValue(date) and the returned Date is always the Date that was set > prior to calling setValue(date). > > For example: > DatePicker.getValue()(before):Tue Oct 26 00:00:00 CDT 2010 > Setting date: Mon Oct 04 01:01:01 CDT 2010 > DatePicker.getValue()(after):Tue Oct 26 00:00:00 CDT 2010 > > When actually using the UI, everything works fine, its only in testing > that it fails. > > I'm curious if testing this type of thing is fundamentally wrong, or > if its simply a matter of how DatePicker is implemented. > > Any advice? > > -- > 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]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- 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.
