java - 在 Eclipse 中计算测试用例覆盖率时如何跳过 Lombok getter 和 setter?

标签 java

我正在使用 Lombok 为 bean 生成 getter 和 setter。 但我想在 Eclipse 中计算测试用例覆盖率时排除这些方法(getter 和 setter)。

我怎样才能做到这一点?

最佳答案

我假设您正在使用 EclEmma。来自 user guide您可以排除类和类加载器,但不能排除方法。

Excludes: A list of class names that should be excluded from execution analysis. The list entries are separated by a colon (:) and may use wildcard characters (* and ?). (Default: empty)

Exclude classloaders: A list of class loader names that should be excluded from execution analysis. The list entries are separated by a colon (:) and may use wildcard characters (* and ?). This option might be required in case of special frameworks that conflict with JaCoCo code instrumentation, in particular class loaders that do not have access to the Java runtime classes. (Default: sun.reflect.DelegatingClassLoader)

关于java - 在 Eclipse 中计算测试用例覆盖率时如何跳过 Lombok getter 和 setter?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51660528/

相关文章:

java - Apache POI : changing CellType causes IllegalStateException

java - 不同传感器数据中纳秒的不同值。如何弄清楚它们?

java - 使用元模型区分大小写条件的 JPA 2 Criteria API

java - 使用单一方法的 OO 解决方案

java - 如何在函数参数中传递类名

java - 将 Activity 传递给服务

java - 选项面板验证

java - JPA、MySQL 和 GlassFish crud 错误

java - Achilles Cassandra 计数器始终为空

java - Log4j 不写入文件