Better Software - November 2008 - (Page 32) mation available on GWTTestCase focuses on these RPC cases, and I recommend reading it for the full story. For a brief introduction, refer to the GWT documentation page titled “JUnit Integration” in the section “Asynchronous Testing” or, for a deeper example, review the book GWT in Practice [6]. Reflecting on this Design approach My team used the design approach I’ve described in this article on a project and found it worked well. A disadvantage of this design is that it relies on the views’ correctly registering the callback events with the presenter. Since this logic was almost too simple to break, we accepted these limitations on our project. For end-to-end integration tests, we used Selenium to control an instance of Firefox and Internet Explorer. These tests filled in the cracks to ensure we had widgets properly wired into their corresponding presenters. Testing GWT applications, like testing Swing or other desktop client applications, can be fairly succinctly summarized as follows: Don’t put logic in your view components. If you find complicated logic in your view, see if it can be moved into the model objects or the presenters. When you need to test view component behavior, JavaScript, or remote server communication, use a GWTTestCase. If you have too many slow GWTTestCases, see if there’s some design change that doesn’t require testing inside a real browser. Let the tests help guide your design, and you’ll be on your way toward making Ajax development fun and relatively painless. {end} refereNceS: [1] “Compatibility with the Java language and libraries” in the Google Web Toolkit online documentation. [4] Feathers, Michael. “The Humble Dialog Box.” Object Mentor, inc., 2002. www.objectmen- tor.com/resources/articles/TheHumbleDialogBox.pdf [5] JMock. jmock.org/ [6] Cooper, Robert and Collins, Charlie. GWT in Practice. Manning Publications, 2008. Sticky Notes For more on the following topics go to www.StickyMinds.com/bettersoftware. n n n n Testing GWT widgets Infrastructure tips More information GWTTestCase gotchas tinyurl.com/6d4tg6 [2] Selenium. selenium.openqa.org/ [3] Fowler, Martin. martinfowler.com/eaaDev/ uiArchs.html 32 BETTER SOFTWARE NOVEMBER 2008 www.StickyMinds.com http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf http://www.jmock.org/ http://www.StickyMinds.com/bettersoftware http://www.tinyurl.com/6d4tg6 http://selenium.openqa.org/ http://www.martinfowler.com/eaaDev/uiArchs.html http://www.martinfowler.com/eaaDev/uiArchs.html http://www.ranorex.com/no-limits http://www.ranorex.com/no-limits http://www.StickyMinds.com
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.