Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run Jboss under Emma to find code coverage

 
Harpreet Singh janda
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are working on run time code coverage calculation of a web application. For this purpose we are using Emma (a free open source code coverage tool).
To find the coverage of an application the application should run under emma tool like

java -jar emma.jar emmarun -jar Application.jar

this is working for normal jar files but when we are running jboss's run.jar under emma we are getting below exception :




command we are using is


all the dependencies are in the class path and run.jar is running fine if we run it directly from command prompt. We are using linux box.

Please provide your advice.

 
Karthik Shiraly
Bartender
Posts: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It seems most likely that this is due to using on-the-fly instrumentation approach. Even if you get it to somehow run, your coverage reports will have lot of irrelevant entries for all the classes loaded by jboss including its own libraries and other applications.
I feel you should instead instrument only your specific application jar offline and deploy the instrumented jar.
 
Harpreet Singh janda
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have already done this. We have deployed the instrumented war file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic