IDEA11.1.3 can't process tomcat code coverage?

hi everyone ,
I just use idea11.1.3 on my macbook pro with ML10.8,use maven manage my modules ,modul A is a integration module just contains configure files ,the socurce codes are in other modules .
In this case ,I use tomcat 6.0.35 to run my module ,and use idea to track code coverage ,but the result is there is no class and no method has bean coveraged ,I'm sure my tomcat is running right ,is any body has the same problem? BTW,forgive my poor english ,i hop you can under stand!thank you !:)

10 comments
Comment actions Permalink

Hi.

Please check your run configuration properties, Code Coverage tab, "Packages and classes to record coverage data" section. Are all necessary packages covered?

Regards,
Alexander.

0
Comment actions Permalink

I'm sure i set that right .I just set com.* and chedked it QQ20120907-1.png,this is my config info ,QQ20120907-2.pngthe coverage has no veriables set ,is that the reason?

0
Comment actions Permalink

Thanks a lot, found the issue: http://youtrack.jetbrains.com/issue/IDEA-91214

Looks like it is JaCoCo specific, not web app specific. Can you try IDEA coverage tool, just to check is this really the reason?

Regards,
Alexander.

0
Comment actions Permalink

If that is true ,Do you mean in web apps ,package all classes to jars ,the WEF-INF/classes has none .class file .In this case ,the jacoco can not coverage any code ?


Ok, Ijust used the IDEA coverage Module ,this is the configure
QQ20120908-1.pngQQ20120908-2.png
The running Info jus like this :
QQ20120908-3.png
QQ20120908-4.png
So,You can see ,there is no coverage class too,I guess the reason is I use maven to manage my modules ,and In this aritfact,there is no class files but jars in Web-inf/lib ,Is this the reason?

0
Comment actions Permalink

Well, JaCoCo is a different issue, let's forget it.

Classes in .jars should not be a problem. Code coverage integration displays results for library classes, as soon as these classes match the user's pattern in run configuration. I've just checked it. In your case the pattern is "com.*", so if your classes match it, results should be shown.

Can you attach small project where the problem occurs?

Thanks,
Alexander.

0
Comment actions Permalink

Just a side note: typically classes in WEB-INF/lib/*.jar are library classes. So, they are written by 3rd party out of the project. So coverage is not intended to work for them. It actually works, if classes match the pattern, but this case is not considered as typical.

Alexander.

0
Comment actions Permalink

Yeah,That's the reason ,Thank you very much!:),Because I use maven to manage modules .So .just like this
mavn.png
Module A、B、C is my moudles,The yellow and red Moduls are 3rds。The key is module A just has configruagion files  and no classes,module B&C had bean packaged to jars and put thems to Web-Info/lib.That means ,In my artifact,the Web-Info/classes dir has nothing ,That is all.
So, if I want to see Module B&C's code coverage ,I shoud unpackage B.jar and C.jar to the Web-Info/classes instead to put them to the lib dir. In another way ,in the artifact,I should config the B&C's compile output to  web-info/classes! Is this right ?

0
Comment actions Permalink

Hi Alexander,
     I think I had find the problem.I just follow you suggestion that i write a little module to test the Idea coverage problem , the jacoco's problem we have Confirmed is a bug,so ,this time ,I only test the idea coverage .
I know the reason is that ,my tomcat can not be normally stoped ,so i just kelled tomcat's thread ,and because of this ,the coverage data ws losted.In othre words ,it not means IDEA coverage has a bug .It's because I killed the tomcat thead lead the coverage data losed .


     Thank you very much to help me!:)

0
Comment actions Permalink

> so i just kelled tomcat's thread ,and because of this ,the coverage data ws losted

I'm sure this is the reason. Thank you for the feedback.
Alexander.

0
Comment actions Permalink

As I said before, coverage should show results for library classes too. So, if you stop Tomcat normally, the coverage should work.

Alexander.

0

Please sign in to leave a comment.