首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在java中检查测试覆盖率?

如何在java中检查测试覆盖率?
EN

Stack Overflow用户
提问于 2018-07-23 01:05:09
回答 1查看 178关注 0票数 1

我想检查测试覆盖率,运行run Test in'lesson_3 with coverage。我得到一个错误:

代码语言:javascript
复制
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.coverage.main.CoveragePremain.premain(CoveragePremain.java:66)
    ... 6 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
    at com.intellij.rt.coverage.instrumentation.Instrumentator.premain(Instrumentator.java:64)
    ... 11 more
FATAL ERROR in native method: processing of -javaagent failed

Process finished with exit code 1
Exception in thread "main"  
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-07-23 01:17:27

根据您的堆栈跟踪,您会受到标记为IDEABKL-5941副本的IDEA-177038的影响。

已知的解决方法是在命令行参数中添加以下内容:

代码语言:javascript
复制
-Djava.io.tmpdir=C:\Temp
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51467427

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档