has anyone used Lombok (http://projectlombok.org/) with JaCoCo and found a way to ignore the compile-time generated boilerplate code?
example:
import lombok.Data;
@Date
public class Foo {
private String bar;
private String baz;
}
As is plain to see the example class above has 0 logic, however at compile time lombok will generate for me 2 getters, 2 setters, an all arg and a no arg constructor as well as a toString(), a hashCode() and an equals() method.
If I run JaCoCo I get 100% line coverage and 0% method / complexity / branch coverages. Now I can go ahead and write those tests, but I will be testing lombok, not my code.
Is there a way to annotate the class somehow to avoid this?
Inline comments or other markers will not help here since there is no lines of code to put those around.
I have read https://github.com/jacoco/jacoco/issues/14 and I think cases like this above are a good example why someone might need annotation based filtering along side comment- / instruction-based filtering.
Thanks,
Gesh
Hello,
what about putting model classes in a package of their own or mark them in the name as DTO. Then you may exclude them with a pattern.
I do not test beans but the code they interact with, you call the getter at another part of your code. If not, why have a getter at all?
Regards Mirko
--
Sent from my mobile
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
So if I'd fix jacoco metric with suppresswarning, my team overall key indicator will be still low.
Moving entities out to a specific package even so seems ok in general, in fact is difficult, s.a. project has too many of them, sometimes with conflicting names.