Reputation: 3391
I'm trying to apply code coverage using Cobertura. The app is deployed in Tomcat 5, but when I instrument the .class files, the app stops working.
This are my steps:
Instrument the class files.
D:\test\cobertura-1.9.4.1\cobertura-instrument.bat --destination D:\test\instrument D:\src\path_to_app\main\target\webapp
Overwrite the class files of D:\src\path_to_app\main\target\webapp
with the instrumented class files in D:\test\instrument
.
Does someone have the correct steps for correctly deploying an app in Tomcat with the classes instrumented by Cobertura?
Reference: http://cobertura.sourceforge.net/faq.html
I'm using cobertura-1.9.4.1
Upvotes: 7
Views: 5912
Reputation: 3391
The correct steps were:
Instrument the class files.
D:\test\cobertura-1.9.4.1\cobertura-instrument.bat --destination D:\test\instrument D:\src\path_to_app\main\target\webapp
(a cobertura.ser its created)
Overwrite the class files of D:\src\path_to_app\main\target\webapp
with the instrumented class files in D:\test\instrument
.
Reference: - http://cobertura.sourceforge.net/faq.html - JB Nizet answer
Upvotes: 13
Reputation: 691765
What does "the app does not work" mean? Do you have an exception in the tomcat output/logs? What does it say?
I suspect you forgot to put the cobertura jars in the WEB-INF/lib folder of your webapp before deploying it. Obviously, the code addd by the cobertura instrumentation calls methods of the cobertura engine, so these classes must be available in your webapp.
Upvotes: 0