TestNG is another popular Java testing framework that was inspired by early versions of JUnit that did not use annotations. TestNG is described as more powerful and easier to use than JUnit. For more details about this, check out the project's home page at http://testng.org.
To complete this recipe, you'll need the sample project we created in the earlier recipe, Creating a JUnit test suite. If you have not completed that recipe, the project is available as part of the code download bundle for the book.
Ensure the Calculator
project is open within NetBeans. Perform the following steps to complete this recipe:
Right-click on the Test Packages node within the Projects explorer and select New and then Other….
In the New File dialog, select Unit Tests from the list of Categories and TestNG Test Case from the list of File Types.
Click on Next.
Enter the Class Name field as
CalculatorTestNGTest
. Ensure the Location field is set to Test Packages and...