chembohuang / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

Incompatibility issues with JaCoCo #432

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There seems to be an incompatibility issue between powermock and JaCoCo, 
possibly related to JDK 7.

Attached is a small maven project which can be executed using "mvn clean 
verify" to showcase the problem.

Depending on which type of classloading and which type of rule implementation 
is used, the result is different:

* powermock-module-junit4-rule + powermock-classloading-xstream:
    + tests succeed (hence a.b.c.d1.A.getC() IS covered -- see test code)
    - target/site/jacoco/index.html a.b.c.d1.A.getC() says 0%

* powermock-module-junit4-rule + powermock-classloading-objenesis
    - one test fails
      - java.lang.ArrayIndexOutOfBoundsException: 5 at a.b.c.d1.WhenNewTest.shouldMockConstructor(WhenNewTest.java)

* powermock-module-junit4-rule-agent + powermock-classloading-objenesis
    - both tests fail
      - Cannot subclass final class a.b.c.d1.B
      - Expecting a stackmap frame at branch target 21 in method a.b.c.d2.H.<init>/La/b/c/d2/G;)V at offset 11

* powermock-module-junit4-rule-agent + powermock-classloading-xstream
    - both tests fail
        - Cannot subclass final class a.b.c.d1.B
        - Expecting a stackmap frame at branch target 21 in method a.b.c.d2.H.<init>(La/b/c/d2/G;)V at offset 11

Both, powermock and JaCoCo are really great tools and we appreciate the hard 
work of the authors, but unless both work fine together we really have the 
problem that we are totally stuck with our QA. Hence we really beg for a 
working solution! :-)

Original issue reported on code.google.com by headcrashing on 21 Feb 2013 at 8:22

Attachments:

GoogleCodeExporter commented 9 years ago
Seems to be realted to #402.

Original comment by headcrashing on 22 Feb 2013 at 6:46

GoogleCodeExporter commented 9 years ago
This tracker item was not touched for over one year. Meanwhile Javassist and 
JaCoCo provide support for Java 7, and Oracle published Java 8. It would be 
great if one of the PowerMock authors could post some roadmap when PowerMock 
will work together with JaCoCo on Java 7. :-)

Original comment by k...@quipsy.de on 22 Apr 2014 at 12:39

GoogleCodeExporter commented 9 years ago
I think it's the combination of Jacoco and Javassist that is the issue. I'd 
truly appreciate some help in solving this issue. 

Original comment by johan.ha...@gmail.com on 22 Apr 2014 at 12:49