Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#126 EclEmma Snapshot Does not display results

Version 2.1.2
closed-wont-fix
nobody
JaCoCo (32)
5
2012-07-09
2012-05-09
Chad McHenry
No

After installing EclEmma 2.1.2.201205091942 as per bug 3522487, running eclemma still did not show results. Rebuilding my eclipse environment from scratch revealed a conflict with JMockit.

JMockit uses a java agent, but provides a non standard means of loading it. Standard means is to specify "-javaagent:jmockit.jar" as a jvm arg. JMockit also allows dynamic loading on jvm > 1.6 using an api provided by the jvm as long as jmockit.jar is before junit.jar in the classpath. It's this dynamic loading that cause EclEmma trouble.

When jmocket is loaded via -javaagent argument, eclemma displays results fine. If jmocket is loaded dynamically, EclEmma 2.1.1 displays results fine, but EclEmma 2.1.2 will not, the test process will not complete, and killing it will cause an error in eclipse.

The error: "'com.mountainminds.eclemma.internal.core.launching.AgentServer' has encountered a problem. Error while dumping coverage data (code 5013)." starts to make sense, seeming to indicate agent issues.

Bug 3522487: https://sourceforge.net/tracker/?func=detail&aid=3522487&group_id=177969&atid=883351

Discussion

  • This means It's probably an JaCoCo issue (the underlying code coverage library). EclEmma 2.1.2 includes a new version of JaCoCo to address another JMockit issue. With the new version the JMockit examples provided by the original big reporter run just fine.

    To debug this issue I would need an reproducer. Can you please provide an miminal Test case that shows the behavior?.

     
    • labels: 896756 --> JaCoCo
    • status: open --> pending
     
  • Chad McHenry
    Chad McHenry
    2012-05-10

    Sample eclipse project showing error

     
    Attachments
  • Chad McHenry
    Chad McHenry
    2012-05-10

    I've attached a sample eclipse project. it uses maven to import the junit4 and jmockit dependencies. You should be able to import it into eclipse and run tests via Run or Debug, but if you try using EclEmma, it will not complete, nor show any results.

    Going into the run configurations for MainTest, move the -javaagent argument (and update for your username/system) from "Program Arguments" to be a "VM argument". Applying that change should allow the tests to be run correctly via EclEmma

     
  • Chad McHenry
    Chad McHenry
    2012-05-10

    • status: pending --> open
     
    • status: open --> closed-wont-fix
     
  • Sorry for the delayed answer, somehow this issue disappeared from my todo list.

    This is a known limitation. If classes are modified at runtime JaCoCo is unable to mach them with the classes at reporting time. If a agent is explicitely specified EclEmma tries to insert the code coverage agent first, so it still sees the original class files.

    Also the -javaagent option is always an VM argument. If you add it to "Program Arguments" it has simply no impact on the JVM,