Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The static coverage file is included in a the monitor.zip package that is generated during the build process by the Jtest Plugin for Maven, Gradle, or AntAnt during the build process .

  1. Add the monitor task or goal to your build command.

    Maven

    Code Block
    mvn package jtest:monitor

    Gradle

    Code Block
    gradle assemble jtest-monitor -I [INSTALL]/integration/gradle/init.gradle

    Ant

    Code Block
    ant -lib [INSTALL]/integration/ant/jtest-ant-plugin.jar -listener com.parasoft.Listener jtest-monitor
    InfoAnt requires all classes to be compiled before the monitor task is executed. Modify your project prior to the build and configure the task to ensure the correct sequence. The following example shows how the target can be configured:

    <target name="jtest-monitor" depends="compile">
                 <jtest:monitor/>
    </target>

    Maven

    Code Block
    mvn package jtest:monitor

    Gradle

    Code Block
    gradle assemble jtest-monitor -I [INSTALL]/integration/gradle/init.gradle

    Ant

    Code Block
    ant -lib [INSTALL]/integration/ant/jtest-ant-plugin.jar -listener com.parasoft.Listener jtest-monitor
    Info

    Ant requires all classes to be compiled before the monitor task is executed. Modify your project prior to the build and configure the task to ensure the correct sequence. The following example shows how the target can be configured:

    <target name="jtest-monitor" depends="compile">
                 <jtest:monitor/>
    </target>

  2. Execute the build command in the AUT's main directory.
    (info) The location of the monitor.zip package that contains the static_coverage.xml file will be printed to the console.
  3. Extract the contents of the monitor.zip package to the server machine.

...

You can connect to either CAM or SOAtest to the Coverage Agent. CAM provides an interface for starting and stopping test sessions during manual test execution. Connecting SOAtest enables you to collect application coverage during automated functional test execution.  

...

Connecting SOAtest to the Coverage Agent

The connection to the coverage agent is handled through a SOAtest test configuration.

  1. Open SOAtest and choose Parasoft> Test Configurations.
  2. Right-click the Demo Configuration in the Built-in folder and choose Duplicate. This will create an editable duplicate in the User-defined test configuration folder.
  3. Rename the duplicate test configuration and click the Execution tab. 
  4. Click the Application Coverage tab and configure the following settings:
    • Enable the Enable Test Execution option. 
    • Enable the Collect application coverage option.
    • Specify the host or IP address of the AUT in the Coverage agent host field. The coverage agent should have been attached to the AUT in the previous step.
    • Specify the port number for the coverage agent. The default number is 8050.
    • If you are using multiple-user mode, specify an agent user ID, such as the current SOAtest username. This enables coverage to be associated with a specific user or client. Do not specify an agent user ID if the agent is not in multiple-user mode.
    • Enable the Report coverage agent connection failures as test failures option if you want test failures reported when the coverage agent connection fails. If the option is disabled, connection problems will only be reported to the console.
    • Enable the Retrieve coverage data and specify the where you want the store the dynamic coverage data in the Coverage data storage directory field. You

...

    • do not need to enable this option if the coverage agent is running on the build machine where static coverage was generated. This is because the static and runtime data can be published to DTP directly from the build machine.
    • Enable Delete coverage data on retrieval option if you want the coverage data on the AUT to be deleted as soon as SOAtest retrieves it. We recommend enabling this option in order to prevent the taking up disk space on the coverage agent machine.
  1. Apply the Test Configuration.

In the next step, you will execute your tests using the new test configuration from the command line. But order for Parasoft link the test results with the coverage information, you will need to create a properties file and specify the build ID used to create the static coverage file. The simplest way is to export the properties referenced by the SOAtest desktop.

  1. Choose Parasoft> Preferences from the SOAtest menu.
  2. Click the share link on the Parasoft page.
  3. Specify a name and location to export the settings file.
  4. Enable any settings you want to include in the file and click OK.
  5. Open the exported file and add the following properties:
    1. report.coverage.images -  Specifies a set of tags that are used to create coverage images in DTP. A coverage image is a unique identifier for aggregating coverage data from runs with the same build ID. DTP supports up to three coverage images per report.
    2. session.tag - Specifies a unique identifier for the test run and is used to distinguish different runs on the same build.
    3. build.id - Specifies a build identifier used to label results. It may be unique for each build, but it may also label several test sessions executed during a specified build.
  6. Save the changes.

Step 4: Perform Testing Sessions

Parasoft provides several ways to execute tests. You can execute tests manually or automate test scenario execution using the command line interfaces. In this guide, we will demonstrate executing manual test scenarios with CAM. We will also describe automated test execution with SOAtest. 

  1. Open SOAtest and choose Parasoft> Test Configurations.

...

Perform Testing with CAM

To collect coverage data, you need to start a session. Only one tests session can be in progress at a time.

...

Perform Testing with SOAtest

Execute Run the soatestcli and using the application coverage test configuration to run your testscreated in the previous step. You will also need to include the workspace, test assets (.tst files), and properties file:

No Format
./soatestcli -config "/path/to/your/test-configuration/app-cov.properties" -data "/path/to/your/workspace" -resource "/path/to/your/tests/your_tests.tst" -localsettings "/path/to/your/localsettings/file/soatest-app-cov.properties"

 

Step 5: (CAM only) Downloading Coverage and Test Results from CAM

...

  1. Go to Report Center in the DTP interface.
  2. Click the gear icon and choose Report Center Settings> Additional Settings> Data Collector Upload Form (requires admin permissions).
  3. Click Choose File and browse for the report.xml file you downloaded from CAM.
  4. Click the Upload button to upload the file to DTP.

Step 7: Merge the

...

Dynamic and Static Coverage Information and Send to DTP

...

dotTEST and Jtest can merge the dynamic and static coverage into one coverage.xml file, and send the merged information to DTP. To ensure that the coverage data is correctly merged and displayed on DTP, configure the following options in the .properties file where you configure your dotTEST or Jtest settings:

...