I am using Powermock but when I run Eclemma coverage, the Powermock test cases are not considered in the final score because of known issues with EclEmma.
The work around for this which I search and other answers on stackoverflow suggest to have:
@Rule
public PowerMockRule rule = new PowerMockRule();
static {
PowerMockAgent.initializeIfNeeded();
}
Then add jars like powermock-module-javaagent, powermock-module-junit4-rule-agent.
After doing this when I am running my code then finding error:
java.lang.VerifyError: Expecting a stackmap frame at branch target 7
For this answers suggest to have javassit of various versions. But I am unable to get that work and getting the same error.
My pom.xml looks like:
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-javaagent</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4-rule-agent</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.21.0-GA</version>
<scope>test</scope>
</dependency>
How can I get PowerMock test cases to be included in final Eclemma score ?