This topic explains how to share Test Configurations (and any rule files or rule mapping files that they depend on) across the team.
Sections include:
About Test Configurations
Every test run—whether it is performed in the GUI or from the command-line interface—is based on a Test Configuration that defines the test scenario and sets all related test parameters. You can change how a test is performed by modifying the settings for the Test Configuration you plan to execute.
Each Parasoft product provides built-in Test Configurations that are based on a variety of popular test scenarios. Most teams, however, will eventually need to create custom Test Configurations to meet their specific objectives.
The built-in Test Configurations cannot be modified, but you can copy them into the user-defined Test Configurations category and modify configurations to suit your preferences and environment. You can also create a completely new Test Configuration and modify it as needed.
The Favorite Configuration should be set to the custom Test Configuration that you plan to use most frequently. By setting your preferred Test Configuration as the Favorite Configuration, you can easily run it from the Parasoft menu, the Test Using tool bar button, or from the command-line interface.
Creating a Custom Test Configuration
- Go to Parasoft > Test Configurations.
- Review the available Test Configurations to determine which (if any) you want to use as the base for your custom Test Configuration. Refer to Built-in Test Configurations to learn about the configurations shipped with SOAtest.
- Do one of the following:
- Right-click on a Test Configuration and choose Duplicate to base a custom Test Configuration on a built-in or Team Test Configuration.
- Click New to start with an empty Test Configuration.
- Select the new Test Configuration. New and duplicate Test Configurations are added to the User-defined category.
- Modify the settings as needed. Refer to SOAtest Test Configuration Settings for details about Test Configuration options.
- (Optional) Set the Test Configuration as a Favorite Test Configuration by right-clicking it, choosing Set as Favorite, then specifying what "favorite" position you want it to take (default, 1, 2, or 3). The configuration will then be set as a Favorite Configuration; the "favorite" icon will be added to that configuration in the Test Configurations tree.
- Click Apply, then Close.
Sharing Test Configurations
You can share Test Configurations by exporting Test Configuration files that team members can import to their instances of SOAtest. See Importing/Exporting Test Configurations for details.
Changing the Favorite Test Configuration
The Favorite Configuration defines the test scenario used by default when a test is run with the designated Parasoft Test product. For example, if a test is started by clicking the Test button, Parasoft Test will run that test based on the parameters defined in the Favorite Configuration. In addition to settings the Test Configuration that is used as the default, you can also mark other commonly used Test Configuration as your favorites; this configures easy access to them.
To indicate which Test Configuration you want set as the Favorite Configuration:
- Go to Parasoft > Test Configurations or choose Test Configurations in the menu on the Test Using toolbar button.
- Right-click the Test Configuration you want set as a Favorite Configuration and choose Set As Favorite, then specify what "favorite" position you want it to take (default, 1, 2, or 3).
The configuration will then be set as a Favorite Configuration and the "favorite" icon will be added to that configuration in the Test Configurations tree.
Organizing User and Team Test Configurations into Subdirectories
If desired, you can organize your user and team Test Configurations into user-defined subdirectories.
To move a user or team Test Configuration into a user-defined subdirectory:
- Go to Parasoft> Test Configurations or by choose Test Configurations in the menu on the Test toolbar button.
- Right-click the Test Configuration you want to move into a subdirectory and choose Set Folder, then specify the desired subdirectory or subdirectories.
- For instance, if you wanted a Test Configuration to be presented under Static Analysis > Security, you would enter the following:
- For instance, if you wanted a Test Configuration to be presented under Static Analysis > Security, you would enter the following:
- Click OK. The specified subdirectory will be created if needed, and the Test Configuration will be moved into it.
The created subdirectory will be available in the Test Using directories.
The command-line mode invocation is NOT affected by subdirectories. Here, you would continue to refer to the Test Configuration by only its name (without paths). For example: -config "team://Policy Compliance"
Specifying Test Configuration Inheritance
If you want multiple Test Configurations to share some of the same parameter settings (for example, if you want multiple Test Configurations to have the same rules enabled), you can create new child Test Configurations referring to one parent Test Configuration. A child Test Configuration will inherit the parent’s settings; the value of each preference in the parent Test Configuration is used whenever the corresponding preference in the child Test Configuration is not present.
Inheritance is recursive; in other words, you could have the MyConfig2 Test Configuration inherit the settings from MyConfig1, and have MyConfig3 inherit the settings from MyConfig 2. MyConfig3 will thus inherit some MyConfig1 settings as it inherits MyConfig2 settings.
You can create a child Test Configuration from a Test Configuration shown in the Test Configuration panel, or by specifying a Test Configuration URL (for Test Configurations available via HTTP).
To create a child from a Test Configuration shown in the Test Configuration panel:
- Open the Test Configurations panel.
- Right-click the desired parent Test Configuration and choose New Child.
To create a child from a Test Configuration available via HTTP:
- Open the Test Configurations panel.
- Right-click the User-Defined node and choose New Child.
In the dialog that opens, enter the URL for the desired parent Test Configuration (http://config_address/). For example,
http://SOAtest.acme.com/configs/static.properties
.
To disconnect a child from its parent:
- Open the Test Configurations panel.
- Click the Disconnect button to the right of the Parent field.
Important Notes
- Once a parent-child relationship is set, that correlation cannot be modified. For example, if Test Configuration A is the parent of Test Configuration Z, you cannot switch Test Configuration Z’s parent to Test Configuration B. Test Configurations that inherit from a parent must be created that way from the start using the "New Child" action.
- Once a child Test Configuration is disconnected from its parent, it cannot be reconnected. All the inherited settings are applied directly in the child when disconnected.
- A given test configuration may have no more than one parent configuration. Multiple inheritance is not supported.
Comparing Test Configurations
If you want to see the differences between two Test Configurations, you can compare them so that the differences are highlighted.
- Go to Parasoft > Test Configurations.
- Right-click one of the Test Configurations you want to compare and choose Export, then use the file chooser to indicate where you want to save the .properties file (choose a folder that is in your workspace and available in the Package Explorer).
- Repeat the above step for the other Test Configurations you want to compare.
- Select the two different .properties files in the Navigator, right-click the selection, then choose Compare with > Each other. Changes will be highlighted.
You may want to compare Test Configurations in the following circumstances:
- You customized a built-in static Test Configuration from a previous product version and want to see what new rules have been added and enabled in the most current version of that built-in Test Configuration.
- You want to know what settings will be impacted if you run a given Test Configuration in "Quick Mode."
- You want to zero in on the differences between a child Test Configuration and its parent.
Importing/Exporting Test Configurations
If you have created a Test Configuration that you want to share with team members or use in an upgraded version of a Parasoft Test product, you can export the Test Configuration into a properties file. That Test Configuration can then be added by importing the related properties file.
Exporting
To export a Test Configuration:
- Go to Parasoft > Test Configurations.
- Right-click the Test Configuration you want to export and choose Export, then use the file chooser to indicate where you want to save the properties file that will be created for this Test Configuration.
A properties file will then be saved in the designated location. A dialog box will open to confirm the location of the newly created properties file.
Importing
To import a Test Configuration that was previously exported into a properties file:
- Go to Parasoft > Test Configurations.
- Right-click the User-defined category and choose Import, then use navigate to and select the appropriate properties file.