Take the tour ×

I am using tclEmma with Eclipse to help me to know where is missing code tests in my project, but all tests with @RunWith(PowerMockRunner.class) are not called and thus not tested.

I´m using JUnit 4.8.1 with Mockito.

What could it be?

share|improve this question
Could you give more details like the verion of Mockito, PowerMock and EclEmma ? –  Brice Mar 16 '12 at 0:12
Hey, i´m using the version 2.1.0 of eclEmma, its a bug in that version, in eclEmma 1.5.x it displays fine the tests coverage. –  LottaLava Mar 19 '12 at 19:35
OK, it seems that EclEmma doesn't use Emma anymore since version 2.x. They are using their own coverage tool which is called JaCoCo. As I don't know the PowerMock version you are using, you should try PowerMock 1.4.11 which includes some fixes related to JaCoCo : powermock.googlecode.com/svn/trunk/changelog.txt –  Brice Mar 20 '12 at 9:50
Hello, i´m using powermock 1.4.9, i´ll check 1.4.11 against eclEmma 2.1.0, hope its ok. –  LottaLava Mar 20 '12 at 13:33
Keep me updated, if it's working I'll add a proper answer. –  Brice Mar 20 '12 at 15:25
show 1 more comment

2 Answers

AFAIK eclEmma, as well as many other coverage systems, modify your .class files to add coverage instructions. Most of these tools do that at "compile time", not at run time.

PowerMock instead, as well as AspectJ LTW and many other systems, manipulate the same bytecode but at "run time":


I have a similar problem with both eclEmma (various versions) and Cobertura in combination with AspectJ LTW, cause when the runtime modification of .class files happen, it somehow corrupts the modification done previously by the coverage tool.

I don't have yet found a solution, but at least found the symptom.

The right solution would be to debug PowerMock instrumentation and find out where and how it breaks coverage tools. It's quite a problem, for a testing tool, to break coverage tools, since the two are quite often used together :)

share|improve this answer
add comment

Its a known bug reported for both parties:

http://code.google.com/p/powermock/issues/detail?id=402 https://github.com/jacoco/eclemma/issues/15#issuecomment-9565210

eCoberture seems however to provide correct coverage. The only problem, that it seems not to be maintained anymore, and you cannot remove the highlights im Eclipse Juno.

share|improve this answer
add comment

Your Answer


