#118 Error when using JaCoCo with JMockit

closed-fixed
nobody
JaCoCo (32)
5
2014-08-21
2012-03-01
Anonymous
No

When using JaCoCo (from an Ant Task with Junit) with JMockit an error occurrs:

junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit. at org.jacoco.ant.CoverageTask.execute(CoverageTask.java:95)

The STDOUT states:
[jacoco:coverage] Enhancing junit with coverage. [junit] Running com.sample.AllSampleTests [junit] Exception in thread \"main\" java.lang.ArrayIndexOutOfBoundsException: 19 [junit] at org.junit.runner.notification.RunNotifier.access$000(RunNotifier.java:19) [junit] at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:38) [junit] at org.junit.runner.notification.RunNotifier.fireTestFailure(RunNotifier.java:97) [junit] at org.junit.internal.runners.model.EachTestNotifier.addFailure(EachTestNotifier.java:26) [junit] at org.junit.runners.ParentRunner.run(ParentRunner.java:311) [junit] at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:420) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)

A Discussion was already started here. https://sourceforge.net/projects/eclemma/forums/forum/614869/topic/5076881/index/page/1

The Problem can be reproduced by this Eclipse project (Ant file is included as Build.xml)

Discussion

1 2 > >> (Page 1 of 2)

  • Anonymous
    2012-03-01

    JMockitTestJaCoCo.zip

     
    Attachments

  • Anonymous
    2012-03-01

    I had to remove the libraries from the zip to match the allowed update size. The folder structure is still unchanged

     
  • Actually both Ant target fail. JMockit complains about missing -javaagent option. Are I supposed to add this option on your Ant file (I can easily do this) or did I miss something else? I'm asking because I want to make sure I'm ranning the exact same setup.

     

  • Anonymous
    2012-03-05

    This is really strange, because for me the runPlain target runs without problems. To be sure, that we have the same setup I uploaded the same zip file including all libraries to Dropbox (here I can share larger files with you). The zip now inclides jmockit, jacoco and junit. Heres the link: http://dl.dropbox.com/u/65478853/JMockitTestJaCoCo.zip

    The other software that is used:
    apache-ant-1.7.1
    Java(TM) SE Runtime Environment (build 1.6.0_26-b03) or (failed on both) Java(TM) SE Runtime Environment (build 1.7.0_03-b04)

    Hope that you now can reproduce the problem...

    Thanks in advance

     
  • Ok, with your this setup I can reproduce the exact same failure. The problem here is that jmockit has its own code coverage engine included. I tried to disable jmockit code coverage with the options described here but did not succeed: http://jmockit.googlecode.com/svn/trunk/www/tutorial/CodeCoverage.html

    Maybe you ask at the jmockit project how code coverage can be disabled.

    For JaCoCo I close this as WONTFIX as I don't see a use case to run two different code coverage engines at the same time. Even if it should theoretically work we probably won't find time to debug this scenario.

     
    • status: open --> closed-wont-fix
     

  • Anonymous
    2012-03-16

    Thanks anyhow. I'll try triggering this issue on the JMockit lists.

     

  • Anonymous
    2012-03-16

    • status: closed-wont-fix --> open-wont-fix
     
    Last edit: Anonymous 2014-09-06
    • status: open-wont-fix --> closed-wont-fix
     
  • In the meantime this issue has been analyzed and fixed in JaCoCo. The latest trunk build (after 2012/01/31) contains the fix.

     
1 2 > >> (Page 1 of 2)