Using the Unit Test Runner Form
You can run unit tests by selecting the Unit Test command from the Jade menu in the JADE development environment. For details, see "
The Unit Test Runner form is then displayed, with unit test classes for the current schema and superschemas listed in the Select Tests list box. This list box includes status icons for all selected tests. These indicate whether a test has passed (green tick), failed (red cross), or has not been run (blue question mark).
The Unit Test Runner form can also be displayed from code, as shown in the following example.
vars dlg : JadeTestDialog; begin create dlg; dlg.show; end;
In the Select Tests pane of the form:
-
Test classes are displayed in a hierarchical list. A top‑level item is displayed for the current schema and subitems are added for all test classes in the schema. Individual tests are represented as leaf items.
-
The number of tests for each class is displayed beside each test class. The total number of tests for a schema is also displayed beside the top‑level schema item.
-
If you select a class that has no local tests but it has subclasses with unit tests, clicking the Run button runs all tests from all subclasses.
-
The text color of individual tests reflects their status; that is, they are displayed in blue if they are yet to be run, green if the test succeeded, and red if the test failed.
-
Double‑clicking a method or class in the Select Tests pane moves the focus to the JADE development environment and navigates to the selected entity in the relevant Hierarchy Browser or opens a new browser if one does not already exist for the current schema.
-
Expand all and Collapse all icon buttons are displayed at the top right corner of the Select Tests pane.
-
The Expand all button expands the list box, making all tests visible.
-
The Collapse all button collapses the list box, showing only the schema item and its direct children. This represents all direct children of the JadeTestCase class.
-
The results of the tests are displayed in the Results pane, as shown the following image.
To run tests from the Unit Test Runner form, select the class or test in the Select Tests pane and then click the Run button.
To copy the unit test results to the clipboard, right-click in the Results pane.