jmockit / jmockit1

Advanced Java library for integration testing, mocking, faking, and code coverage
Other
461 stars 239 forks source link

JSR/RET are not supported with computeFrames option. #58

Closed evdzhan closed 10 years ago

evdzhan commented 10 years ago

Hi there, I am getting the following exception.

java.lang.RuntimeException: JSR/RET are not supported with computeFrames option...

I have isolated the problem, and it appears to be that I am getting the error because I mock a Logger class.

The logger comes from the Apache log4j library, version 1.2.12. JDK 1.7.0_52 32 bit Win7 64 bit

I suspect that the reason for this failure is because of the ASM upgrade in the new JMockit 1.11.

The issue occurs when I use JMockit 1.11. But using JMockit 1.10 works just fine.

import mockit.Mocked;
import mockit.integration.junit4.JMockit;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
    @RunWith(JMockit.class)
    public class Foo {

    @Mocked Logger logger;
    @Test public void test(){

    }

}
rliesenfeld commented 10 years ago

Fixed for version 1.12.