The error that I get when running the test class
java.lang.ClassFormatError: JVMCFRE013 local variable PC length invalid; class=com/../MyClass, offset=42431
at java.lang.ClassLoader.defineClass(ClassLoader.java:265)
This occurs specifically when I add MyClass.class
to the @PrepareForTest
above the class. When I remove the same, the error goes.
I don't think its an eclpise/java issue as I've tried switching to Java 1.8 to 1.6. Kindly help me out here.
@RunWith(PowerMockRunner.class)
@PowerMockIgnore("javax.*")
@PrepareOnlyThisForTest({x.class,MyClass.class })
@SuppressStaticInitializationFor("com.xx")
public class MyClassTest {
This is the test class I execute which leads to the error.