TestNG is a testing framework inspired from JUnit and NUnit but with new functionality to make it more powerful and easier to use. Features include:
- JDK 5 Annotations (JDK 1.4 is also supported with JavaDoc annotations)
- Flexible test configuration
- Support for data-driven testing (with @DataProvider)
- Support for parameters
- Allows distribution of tests on slave machines
- Powerful execution model (no more TestSuite)
- Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc...)
- Embeds BeanShell for further flexibility
- Default JDK functions for runtime and logging (no dependencies)
- Dependent methods for application server testing
TestNG is designed to cover all categories of tests: unit, functional, end-to-end, integration, etc...
The sections below illustrate using TestNG for the examples from Using Testing Frameworks with Groovy.
The Item Storer Example
Here is how you might use TestNG to integration test the Item Storer Example:
You might also like to consider the special Groovy integration from the Test'N'Groove project which provides command-line runners and ant tasks for using TestNG with Groovy.