Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How to generate code coverage for Java web applications in tomcat

How to generate code coverage for Java web applications in tomcat

Problem:

How to generate code coverage for Java web applications in tomcat

Resolution:

SilkCentral Test Manager"s allows you to enable code coverage analysis for Java AUT (Applications Under Test), packages, classes, methods, and statements.

SilkCentral Test Manager"s code-coverage functionality is provided in the Code Analysis unit (which is accessible from the Code Analysis button on the Workflow Bar). The Code Analysis unit features a navigation tree that lists all products that have been created for the selected project. You can drill down into products to select specific versions, and at the deepest level, specific builds.

See "Enabling Code Analysis for SilkCentral Test Manager" in the SilkCentral online help for enabling code coverage against your Java AUT. If you Java AUT is hosted on your tomcat webserver however you must follow the instructions below.

Option 1

  1. Copy sctmcc.dll into the bin folder of the Jave Virtual Machine (i.e. "C:\Program Files\Java\jre1.6.0_05\bin")
  2. Right click on the Apache Tomcat icon in the system tray and select Configure ...
  3. Click on the Java tab and add the following string as a paramater:
    -agentlib:sctmcc=19129,coveragetype="line",coveragepath={"library1.jar;library2.jar"},name="ServerName Name of the monitored application"
  4. Click ok to save changes

Option 2

  1. Copy sctmcc.dll into the bin folder of the Jave Virtual Machine (i.e. "C:\Program Files\Java\jre1.6.0_05\bin")
  2. Open Windows Registry (START | RUN | REGEDIT)
  3. Go to HKEY_LOCAL_MACHINE | SOFTWARE | APACHE SOFTWARE FOUNDATION | PROCRUN 2.0 | TOMCAT6 | PARAMATERS | JAVA | OPTIONS
  4. Add the string from point 3 in options 1 above and click OK

Old KB# 25129

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:53
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.