使用GwtMockito报告的错误代码覆盖率 [英] false code coverage reported using GwtMockito

查看:120
本文介绍了使用GwtMockito报告的错误代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用GwtMockitoTestRunner时Eclipse中的EclEmma(JaCoCo based)是否会错误地报告代码覆盖率?

Is there any reason why EclEmma(JaCoCo based) in Eclipse falsely reports the code coverage while using the GwtMockitoTestRunner?

查看其源代码,它会安装自己的类加载器,并使用Javassist library进行字节码操作.这会影响代码覆盖率工具吗?

Looking at it's source code, it does install it's own class loader and does byte code manipulation using the Javassist library. Could this affect the code coverage tool anyhow?

推荐答案

问题似乎在于EclEmma/JaCoCo无法与最终方法和本机方法(GWT JSNI代码)一起很好地工作.

It looks like the issue is that EclEmma/JaCoCo doesn't work well with final methods and with native methods(GWT JSNI code).

修复这些方法后,一切恢复正常,覆盖率报告正确.

Fixing these methods everything returned to normal, the coverage is reported correctly.

这篇关于使用GwtMockito报告的错误代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆