How to force Emma code coverage report to ignore some methods?

只愿长相守 提交于 2019-12-04 22:55:36

From the EMMA FAQ:

A feature to allow EMMA users to mark arbitrary methods as excluded from coverage is being considered for future versions.

So unfortunately this doesn't seem to be possible at the moment. There's an open feature request for this in EMMA's tracker.

I would argue that every bit of code should be covered, including getters and setters, toString, equals and hash code.

I have seen many a pull requests with:

public void setName(String name)
{
   name = name; // instead of this.name = name
}

There are tools out there to help write these cumbersome tests. ToStringVerifier being one, EqualsVerifier being another.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!