Thoppan / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

($Proxy13) bytecode array size > 65535 at offset=578015 #329

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.write a test for testing static methode in eclipse
2.run the test
3.

What is the expected output? What do you see instead?
java.lang.RuntimeException: Invoking the beforeTestMethod method on PowerMock 
test listener 
org.powermock.api.easymock.powermocklistener.AnnotationEnabler@12d812d8 failed.
      at org.powermock.tests.utils.impl.PowerMockTestNotifierImpl.notifyBeforeTestMethod(PowerMockTestNotifierImpl.java:92)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:292)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:282)
      at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
      at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:207)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:146)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
      at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
      at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:118)
      at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:102)
      at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.IllegalArgumentException: java.lang.ClassFormatError: 
($Proxy13) bytecode array size > 65535 at offset=578015
      at java.lang.reflect.Proxy.getProxyClass(Proxy.java:525)
      at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:592)
      at org.easymock.internal.JavaProxyFactory.createProxy(JavaProxyFactory.java:31)
      at org.easymock.internal.MocksControl.createMock(MocksControl.java:60)
      at org.powermock.api.easymock.PowerMock.doMock(PowerMock.java:2131)
      at org.powermock.api.easymock.PowerMock.createMock(PowerMock.java:76)
      at org.powermock.api.extension.listener.AnnotationEnabler$3.createMockInstance(AnnotationEnabler.java:74)
      at org.powermock.api.extension.listener.AnnotationEnabler$FieldInjector.inject(AnnotationEnabler.java:96)
      at org.powermock.api.extension.listener.AnnotationEnabler.injectDefaultMocks(AnnotationEnabler.java:78)
      at org.powermock.api.extension.listener.AnnotationEnabler.beforeTestMethod(AnnotationEnabler.java:45)
      at org.powermock.tests.utils.impl.PowerMockTestNotifierImpl.notifyBeforeTestMethod(PowerMockTestNotifierImpl.java:90)
      ... 18 more

What version of the product are you using? On what operating system?
1.4.9

Please provide any additional information below.

Original issue reported on code.google.com by hakim.he...@gmail.com on 18 May 2011 at 10:48

GoogleCodeExporter commented 9 years ago
I've made multiple tests with mocking static methods in Eclipse and it works. 
You need to provide more info. Perhaps you're trying to mock a class that is 
too large. I doube that PowerMock can fix this. See e.g. 
http://bytes.com/topic/java/answers/16037-65535-limitation-methods-functions-con
structor.

Original comment by johan.ha...@gmail.com on 19 May 2011 at 7:04