gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 10:56:53 30 4
gpt4 key购买 nike

我正在使用 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/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com