誰かが重複した質問を下さる前に....私はこのトピックに関連する他のすべてのStackOverflow答えを読み、何も私の質問に答えていません。だから私は以下、JMockit 1.19を使用していますEclEmmaコードカバレッジの問題を伴うJMockit
はJmockitとJUnitのための私のpom.xmlの依存関係は、Eclipseマーケットプレースを介してインストールと私はEclEmma 2.3.2プラグインを使用しています
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
</dependency>
です。
しかし、コードカバレッジを表示しようとすると、すぐにいくつかの問題が発生しています。 1については
私は次の例外ログを取得:
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:483)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt.internal_9dd1198.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
at org.jacoco.agent.rt.internal_9dd1198.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:99)
at org.jacoco.agent.rt.internal_9dd1198.PreMain.createRuntime(PreMain.java:55)
at org.jacoco.agent.rt.internal_9dd1198.PreMain.premain(PreMain.java:47)
... 6 more
Caused by: java.lang.NoSuchFieldException: $jacocoAccess
at java.lang.Class.getField(Class.java:1695)
at org.jacoco.agent.rt.internal_9dd1198.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:136)
... 9 more
FATAL ERROR in native method: processing of -javaagent failed
Exception in thread "main"
私もJMockitが正常に実行するために得るために言って2ポップアップ....
popup 1) - "No coverage data has been collected during this coverage session. Please do not terminate the Java process manually from Eclipse."
pupup 2) - "Error while dumping coverage data (code 5013). com.mountainminds.eclemma.internal.core.launching.AgentServer"
を取得する私はJVM引数
-javaagent:C:/Users/vn90614/.m2/repository/org/jmockit/jmockit/1.19/jmockit-1.19.jar
を提供する私は、この引数が問題にrealtedていると思います
本当に古いバージョンをすべて使用しています(JUnit、JMockit、およびEclEmma)。 JaCoCo(EclEmmaプラグインの裏にあるカバレッジライブラリ)とJMockitの両方で、このような問題の修正と改善が行われています。最新のバージョンにアップグレードすることができれば、それはなくなる可能性があります。 –
残念ながら、これは仕事のためのもので、リポジトリのバージョンを使用する必要があります。彼らがバージョンをアップグレードできるかどうかがわかります。 – Mason