The IDE provides built-in JUnit support for generating and executing unit tests based on the JUnit framework. The JUnit framework is an open source product that supports development of tests and provides a harness for running these tests.
The IDE supports JUnit 3 and JUnit 4 unit testing. For more information about JUnit, see:
You can use the IDE to create the following:
You can generate tests and test suites by selecting any class or package node in the Projects window and choosing Tools > Create JUnit Tests from the main menu.
The IDE represents unit tests as subtrees which mirror the project's Java package structure. By default, when the IDE generates tests each test class has the name of the class it is testing appended by the word Test (for example, MyClassTest.java).
Each standard project has a default test folder that is used to store the JUnit tests and test suites. This folder is displayed as the Test Packages node in the Projects window. You can add any number of test folders to your project. Test files and the source files they test cannot be located in the same source tree.