NetBeans provides facilities to easily create JUnit tests. In this recipe, we'll see how we can create tests for an existing class. We'll initially create a new library project within NetBeans and create a very simple class to do some basic math. We'll then see how to use NetBeans to create tests for the library.
To complete this recipe, you need to ensure that you have installed the JUnit support into NetBeans as described in the previous recipe, Installing JUnit support into NetBeans.
To create a JUnit test for an existing class, perform the following steps:
Calculator. If you are unsure of ...