0

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.

Alan Pallath
  • 99
  • 3
  • 14

1 Answers1

0

The problem was not related to the length of the main class or the test class. The JavaAssist version that was being used was relatively old one. javassist-3.11.x.jar I updated that to the latest one, and the problem was resolved.

Alan Pallath
  • 99
  • 3
  • 14