When using Automated Unit Testing to do regression unit testing, it is a good practice to create a testing application and a RuleSet for regression unit testing and for storing the test case and unit test suite rules.
Having a separate application rule and RuleSet gives you the flexibility to manage the test case and unit test suite rules independently from the rules that make up your main application.
For configuration steps in releases before PRPC 6.1, see Creating a RuleSet for test cases and unit test suites (V5).
During the development and unit testing project phases, it is helpful to have a testing application that is built on the main application. In this set up, you avoid having to include the test cases and unit test suites RuleSet in main application's rule. This set up makes it possible to migrate and deliver the main application without requiring the test cases and unit test suite rules to go with it.
To use this method:
- Create a new RuleSet and RuleSet version for unit testing.
- Create a new application rule that is built on the main application rule, and add the new RuleSet to it.
- Provide operator access to the new application.
Step 1: Create a new RuleSet and RuleSet version for unit testing
To create a new RuleSet and version:
- In the Rules Explorer, in the SysAdmin category, right-click RuleSet and select New.
- Enter a name for the RuleSet for holding the rules related to unit testing of your application. For example, if your application is named OrderEntrySystem, you might name the RuleSet OrderEntrySystem-Test.
- Tab out of the RuleSet Namefield, and the system enters some default information in the fields of the form:
- Version: The system enters a default three-part version identifier of 01-01-01. You can modify the version identifier using another three-part identifier.
- Description: The system enters a default description. You can modify this description.
- Requires RuleSet and Versions: This new RuleSet version must have at least one prerequisite. The system enters the highest Pega-ProcessCommander version in the system.
- In the Requires RuleSet and Versionssection, replace the system default value with the name and version of your primary application's RuleSet and version.
For example, if your primary application's RuleSet and version is OrderEntrySystem:02-03, replace the pre-filled Pega-ProcessCommander value with OrderEntrySystem:02-03.
(Do not choose to update your current application with this new RuleSet.)
- Click Create. Then, in the RuleSet form, add a description and save the new RuleSet rule and RuleSet Version rule.
Step 2: Create a new application rule that is built on the main application rule
One way to do this step is:
- In the Rules Explorer, in the Application Definition category, right-click Application and select New.
- Enter a name and version for this testing application. For example, if your application is named OrderEntrySystem, you might name the testing application rule OrderEntrySystem-Test. Choose a name that is unique in the system.
- In the RuleSet field, accept the system default or select a RuleSet to associate with this application rule. (This RuleSet is used by the Export and Import tools. It is not used for rule resolution.) The drop-down menu shows the list of RuleSets that your operator ID can access.
- Click Create.
- In the Application rule form, select the name of the application to be tested in the Built on Application field. In the Version field, select the appropriate version.
- Select Include Parent to ensure that RuleSets from the main application are included in the Application Explorer display.
- In the Application RuleSets array, select the unit testing RuleSet created in Step 1, and specify the version; for example, OrderEntrySystem-Test:01-01.
- Save the rule form.
Step 3: Provide operator access to the new application
To complete this step you create a new access group and add it to the appropriate operator IDs:
- In the Rules Explorer, in the Security category, right-click Access Group and select New.
- Enter a name in the form of
application:description; for example, OrderEntrySystem-Test:Testers. Click Create.
- In the Access Group rule form, select the testing application in the Application Name field, and its version in the Version field.
- In the Work Pools field, select the main application's work pool from the list.
- In the Roles section, specify the appropriate roles. Usually appropriate roles are the standard roles PegaRULES:SysAdm4 and PegaRULES:AutoTest for performing development and testing tasks in the testing application.
- On the Settings tab, select Developer for the Default Portal Layout.
- Save the form.
- In the Rules Explorer, in the Organization category, select Operator ID to see all of the available operator ID instances.
- Open your operator ID instance by selecting its name.
- In the Access Groups section, click to add a new row and select the new access group.
- Save the form.
- Repeat steps 10 through 11 for each operator that needs to access the testing application.
To verify that you have access to the testing application:
- Press F5 to refresh your portal.
- From the Designer Studio Application menu, select Switch Application and select the name of the testing application.
The Designer Studio refreshes and displays the name of the testing application.