Back Forward How to unit test a harness rule with the Run Rule feature

About Decision Tree rules

The Run Rule feature enables you to test a harness rule individually before testing it in the context of the application you are developing. You specify a test page for the rule to use, provide sample data as the input, run the rule, and examine the results.

Before you begin

Before you begin, determine how you will provide the sample data to use when testing the rule. If possible, open a work object of the appropriate class.

For general information about the Run Rule feature, including a list of the clipboard pages that are generated when a rule runs, see How to test a rule with the Run Rule feature.

Run the rule

To run the rule, complete the following steps:

  1. Save the rule.
  2. If desired, select Edit > Preferences to review and update if desired the Run Process In settings in the General group of preferences. These determine the portal rule and skin rule of the test. See Developer Portal — Setting preferences.
  3. Complete any preprocessing necessary to create the appropriate clipboard context and, if the rule is circumstanced or time-qualified, to set the conditions you want to test.
  4. Click the Run toolbar button (Run). The Run Rule window appears.
  5. In the Test Page section, specify which page to use as the main page. Do one of the following:

    A. If any pages of the rule's Applies To class already exist, select one to be copied. (If this harness rule applies to an embedded page, identify a top-level page that contains the embedded page or pages and supply a Page Context.)

    Otherwise, select Create or Reset Test page. Then, in the Apply field, select the model to use for the test page.

  6. If the rule being tested is circumstance-qualified, select Set circumstance properties to run exact version of rule.
  7. In the lower section of the Run Rule window, enter the test data and click
     Execute.   The system runs the harness rule and displays the results. The the portal and the skin rule (styles and appearance) of the work object form depend on the Run Process In preferences you set in step 2 above.

zzz About Harness rules