JUnit Module Commands

The JUnit module provides several commands, all of which can be found by right-clicking an Explorer node and choosing Tools and choosing JUnit Tests.

You can call JUnit commands on nodes for packages or Java objects. Test execution can be started from a node for the tested source code or from the node for the test class.

The JUnit module has the following three commands:

Create Tests

This command can be used to generate test skeletons. It generates the skeleton either from scratch or regenerates an existing skeleton. You can call this command by right-clicking the node of the file or directory that you want to create a test for and choosing JUnit Tests and choosing  JUnit Tests and choosing Create Tests. The Create Tests dialog box is displayed and enables you to set parameters for the test skeleton generator.

Execute Test

This command starts execution of the test. You can call this command on the node for the tested source code or the node for the test itself. To call the command, right-click the node and choose Tools and choose  JUnit Tests and choose Execute Tests. The test is executed using the executor and test runner that are specified in the JUnit Module Settings.

The test runner class can be either the one supplied by JUnit module (org.netbeans.modules.junit.testrunner.TestRunner) or a test runner class that is in one of the mounted filesystems. The JUnit framework provides other test runners, such as junit.swingui.TestRunner.

Open Test

This command opens the source code of the test class that belongs to the tested class. It can be called on the same nodes as the Create Test command. If you test classes are in a hidden filesystem, the Open Test command is the easiest way to access the source code of the test.


Legal Notices