Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

TestNG Makes Java Unit Testing a Breeze

By Filippo Diotalevi
2005-03-22


Wrapping up

In this article, I've offered a quick and practical introduction to TestNG, with the aim of showing how you can start writing unit tests now. However, it isn't a complete reference manual. There are a lot of other interesting features of TestNG that can be very useful:

• It's possible to pass arguments to test and configuration methods, declaring them either with annotations or in the XML configuration file.

• You can run good old JUnit tests under TestNG using a "compatibility mode."

• It's possible to establish dependencies among test groups, deciding their order of execution.

A look at TestNG's documentation (see Resources) is necessary to exploit all the potentialities of this framework.

All these features, together with the adoption of Java annotations to define tests, make the whole testing process much more simple and flexible. There are only a few rules that you must obey to write tests; beyond these, you are absolutely free to choose the testing strategy you prefer.

What clearly emerges while using TestNG is that this framework is already a good choice for writing unit tests, and that it is, by design, simple to integrate with other libraries and tools, so its future development can bring developers some interesting news. A new path has been forged.

Tutorial Pages:
» Try this testing framework for its advances over JUnit
» About the code
» TestNG quickstart
» Defining test groups
» Configuration methods
» Exception checking
» Wrapping up
» Resources


First Published on IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT