I have a class that starts with:
public class GeneralID implements WritableComparable<GeneralID>{
...
}
And another that is:
public class LineValuesMapper<KI, VI, KO, VO> extends Mapper<LongWritable, Text, Text, IntWritable>{
...
}
All methods in these classes are covered. But not their header. The header of both classes gets painted as yellow with EclEmma.
The covered instructions for these classes are:
Element Coverage Covered Instructions Total Instructions
LineValuesMapper.java 97.3 % 145 149
GeneralID.java 99.3 % 566 570
Is there anything I can do to fully cover the class header?
The Eclipse Plug-InEclEmma retrieves code coverage metrics as conveniently as you execute your test suites directly in the IDE . The plugin can be easily installed from its update site at http://update.eclemma.org/ on any Eclipse installation of version 3.5 or above. It is also available from the Eclipse Marketplace.
Right-click on project > Properties > Coverage to enable code coverage. Then, right-click on project > Run Code Coverage.
For classes that extend generic superclasses or implement generic interfaces, the compiler may add synthetic bridge methods. See the results of looking at the bytecode of a similar case.
Maybe in your classes, these bridge methods are not called. OTOH, I just read that Emma has an option for ignoring synthetic or bridge methods which is enabled by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With