Java technology

You might get a thrill out of writing Ajax applications, but unit testing them is surely painful. In this article, Andrew Glover takes on the downside of Ajax (one of them, anyway), which is the inherent challenge of unit testing asynchronous Web applications. Fortunately, he finds it easier than expected to tame this particular code quality dragon, with the help of the Google Web Toolkit.

Ajax is undoubtedly one of the biggest buzz words to hit the Web development streets in recent memory — the proliferation of Ajax-related tools, frameworks, books, and Web sites is evidence that this technology is here to stay. Besides, Ajax applications are pretty slick, aren’t they? Yet, as anyone who has developed an Ajax application can testify, testing Ajax isn’t exactly easy. In fact, the emergence of Ajax has essentially invalidated a host of test frameworks and tools that weren’t designed to test asynchronous Web applications!

Interestingly, the developers of one particular Ajax-enabling framework noticed this limitation and did something quite novel: they built in testability. What’s more, because this framework facilitates creating Ajax applications with Java™ code rather than JavaScript, they built on the shoulders of giants, so to speak, and took advantage of what’s arguably the standard testing framework for the Java platform: JUnit.

The framework I’m talking about is, of course, the immensely popular Google Web Toolkit, also known as the GWT. In this article, I’ll show you how the GWT actually leverages its Java compatibility to make Ajax applications every bit as testable as their synchronous counterparts.

Read more….. 

Leave a Reply