I am using JUnit with Powermockito mocking. I have to work on a CLI environment with maven or ant.
emma version: ema-2.0.5312
powermock version: powermock-mockito-1.5.1-full
junit version: junit-4.9
When I run junit through the following command, everything works find:
java org.junit.runner.JUnitCore some.package.ClassTest
However, when I used emma to check the code coverage:
java emmarun -cp $CLASSPATH -report txt org.junit.runner.JUnitCore some.package.ClassTest
I got the following error:
1) initializationError(some.pakage.ClassTest)
java.lang.ClassCastException: org.powermock.modules.junit4.PowerMockRunner cannot be cast to org.junit.runner.Runner
Other test classes without using powermock work fine. Does anyone have some suggestion to this? thanks in advance.