For every one of my JPA classes I am seeing both Cobertura and Jacoco report two classes. So for example if my JPA annotated class is called HelloJpa.java I will see Jacoco have two entries…
When I click on the _ version of the report it simply says Missed Instructions 3 of 3 for a method like this…
Is this the default constructor it is missing or something?
Yes, if the class is called "HelloJpa_" the method shown in the report with name "HelloJpa_()" is the default constructor. Actually JaCoCo reporting uses a strategy to transform internal class files names (which would be "<init>") to more source-like names.
Is there anything I can do to make this behavior stop. Even if I add my own default constructor and write a unit test that covers it this extra HelloJpa_ is still showing up and showing that it is "untested". Any help would be appreciated!
I can attach a sample class if you want?
You can filter those generated class files when generating a JaCoCo report. Simply add exclude="*_" to the class file set you supply to the Ant report task (or Maven goal). See documentation for details.
Perfect! That solved my issue.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.