【问题标题】:How to check the test coverage in java?如何检查java中的测试覆盖率?
【发布时间】:2018-07-22 17:05:09
【问题描述】:

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

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"  

【问题讨论】:

    标签: java intellij-idea code-coverage


    【解决方案1】:

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

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

    -Djava.io.tmpdir=C:\Temp
    

    【讨论】:

      猜你喜欢
      • 2013-05-04
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 2015-07-07
      • 2020-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多