I just started using EclEmma ... thus JaCoCo ... for unit tests on a project that uses reflection, including getting the number of fields in a class, including static fields. I was getting test failures and believe the cause is that JaCoCo apparently adds a static field (containing an array) to each class-undergoing-coverage (according to the "Control Flow Analysis for Java Methods" page, if I'm reading it right).
So, what are my workarounds? (I'm running EclEmma through the Eclipse plugin.)
Can I: a) detect that my unit tests are running under EclEmma/JaCoCo so I can change their expected answers? b) mark certain classes (which are strictly used as test examples, and which are typically nested classes - some static, some inner) as not-to-be-instrumented? c) or ???
Thanks! -- David
P.S. I also can't figure out how to run, in Eclipse, an instrumented test in the debugger ... is there a way to do this?