IBM Support

Code Coverage on Java application returns 0% coverage on forced stop/exit in console view

Troubleshooting


Problem

IBM Rational Application Developer for WebSphere Software (RAD) and Rational Software Architect for WebSphere Software v8.0 - 8.0.2 Code Coverage on Java application returns 0% coverage on forced stop in console view.

Symptom

You correctly set the Properties for the Java project : Code Coverage [x] Enable Code Coverage, and package and source coverage set to 80%.

Code coverage is not up to specified maximum of 80% as expected on forced stop using red stop button in console view on a Java application with an infinite main loop.


Cause

This issue was identified as a product defect and logged under APAR PM35789. This APAR was closed as a suggestion/feature enhancement for a future release.

Resolving The Problem

This enhancement was delivered in RAD 8.0.4 and documented in RAD 8.0.4 enhancements under Code Coverage as bullet:

  • You can now select an option to collect code coverage statistics if the Java program exits abnormally.
This corresponds to this workspace preference as of RAD 8.0.4+ :

WORKAROUND:

To restore Rational Application Developer 7.5 functionality in pre RAD 8.0.4:

  1. Open Run Configurations and select Java Application configuration corresponding to the Java project main class



  2. Select the Arguments tab
  3. Type the following entry in the VM Arguments box:

    -Dcoverage.server.mode=true



    Note: Ensure no character of any kind (hidden or otherwise) prefix or postfix the above string.

[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Code Coverage","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SS4JCV","label":"Rational Software Architect for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Code Review","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}}]

Document Information

Modified date:
16 June 2018

UID

swg21474213