gpt4 book ai didi

java - 如何检查java中的测试覆盖率?

转载 作者:行者123 更新时间:2023-11-30 06:05:18 25 4
gpt4 key购买 nike

我想检查测试覆盖率,通过运行 Test in'lesson_3 来运行覆盖率。我收到错误:

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"

最佳答案

根据您的堆栈跟踪,您受到 IDEA-177038 的影响它被标记为 IDEABKL-5941 的重复项。

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

-Djava.io.tmpdir=C:\Temp

关于java - 如何检查java中的测试覆盖率?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51467427/

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