Enum switch statements not handled correctly
Brought to you by:
vlad_r
Emma does not report coverage of switch statements correctly, if they are used with Enums. It reports an incomplete (yellow) coverage on the switch statement itself. Compare this with switch statements made against an int or against enum.ordinal(); these report 100% coverage (green).
Attached is a small ant project with 3 classes and 3 unit tests. Run with default ant target to build. I was not able to include the lib/ directory in the zip due to upload size restrictions. This needs only the Emma jars and the JUnit jar.
The 3 classes are respectively examples of:
switch using enum
switch using int
switch using enum.ordinal()
Small ant project with 3 classes + tests