Test perspective
The Test perspective combines the views and editors that are most commonly used when creating and managing tests.
By default, the Test perspective consists of the following views and editors:
- The Test Navigator view
- The Test Data Table, Stub Data Table, and Test Data Comparator views
- The Test Suite editor and the Java editor
The Test Navigator view
By default, the Test perspective contains one explorer-type view: the Test Navigator. The Test Navigator provides an execution-oriented view of your test projects. In the Test Navigator you can browse, rearrange, and run test suites. Each test suite contains the test cases that are actually executed in the test suite, and each of these test cases is linked to a method in the test behavior code.
Because the Test Navigator view provides an execution-oriented view of your test projects, some test artifacts, such as test behavior scripts and stubs, are not displayed. Therefore, when testing Java components, you may find it convenient to add the Package Explorer view to the Test perspective. (Click Window > Show View > Java > Package Explorer.) Likewise, you may find it convenient to add the Project Explorer and the Web Services Explorer views to the Test perspective when working with EJBs and Web services. All three of these Explorer views provide a code-oriented view of your test project and display those test artifacts that are represented as standard Java source files, classes, and packages.
The Test Data Table, Stub Data Table, and Test Data Comparator views
These data table views provide a data-oriented view of your test. Each appears in the form of a spreadsheet. As its name implies, you use a test data table to supply your tests with test data, including input values, expected output values, return values, and exceptions.
You use a stub data table, on the other hand, to define the default behavior for stubs. Stub data tables define the output behavior of a stubbed class in response to certain inputs. With the stub data table, you simulate the stubbed class by specifying the actual input and return values for each stubbed method.
A test data comparator compares the expected data from an individual test run with the actual results from the test run. .
The Test Suite editor and the Java editor
You can edit test suite content and deployment information in the Test Suite editor. A test suite is a grouping mechanism that contains test cases, stubs, and test deployment data. The Test Suite editor is made up of four tabbed views:
Overview: contains general information about the selected test suite.
Test Cases: contains information about the test cases contained in the test suite.
Stubs: contains information about the stubs used in the test suite.
Deployment: contains information required to run the test suite.
Test suites are created each time you create a new test. To open the Test Suite editor, double-click a test suite in the Test Navigator view.
In the Test perspective, the Java editor serves the same function as it does in the Java perspective. Use the Java editor to view and edit test behavior scripts and stub user code.
Related concepts
Test data tables
Stub data tables
Related reference
Test Suite editor reference
Test Navigator reference