How to generate code coverage for Java web applications in tomcat

0 Likes

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
Comment List
Anonymous
Related Discussions
Recommended