nkxiaochuan / powermock

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

Remove CGLibHacker workaround in MockitoMethodInvocationControl (Mockito 1.8.1) #201

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Since Mockito 1.8.1 the CGLibHacker is a member of MethodInterceptorFilter
which means that the workaround in performIntercept can be removed (if we
change the CGLibHacker member instance in
org.mockito.internal.creation.MethodInterceptorFilter).

Original issue reported on code.google.com by johan.ha...@gmail.com on 11 Nov 2009 at 3:59

GoogleCodeExporter commented 9 years ago
Getting this stacktrace when using PowerMockRunner with powermock 1.3.1 and 
mockito
1.8.1, not sure if it's related to this issue:

java.lang.NoSuchMethodError:
org.mockito.internal.creation.MethodInterceptorFilter.<init>(Ljava/lang/Class;Lo
rg/mockito/internal/MockHandler;)V
    at
org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocati
onControl(MockCreator.java:78)
    at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock(MockCreator.java:53)
    at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:80)
    at
org.powermock.api.extension.listener.AnnotationEnabler.beforeTestMethod(Annotati
onEnabler.java:58)
    at
org.powermock.tests.utils.impl.PowerMockTestNotifierImpl.notifyBeforeTestMethod(
PowerMockTestNotifierImpl.java:90)
    at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$Po
werMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:3
07)
    at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$Po
werMockJUnit47MethodRunner.executeTestInSuper(PowerMockJUnit47RunnerDelegateImpl
.java:112)
    at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$Po
werMockJUnit47MethodRunner.executeTest(PowerMockJUnit47RunnerDelegateImpl.java:7
3)
    at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$Po
werMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDe
legateImpl.java:297)
    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.in
vokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:222)
    at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.ru
nMethods(PowerMockJUnit44RunnerDelegateImpl.java:161)
    at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.
run(PowerMockJUnit44RunnerDelegateImpl.java:135)
    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.ru
n(PowerMockJUnit44RunnerDelegateImpl.java:133)
    at
org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run
(JUnit4TestSuiteChunkerImpl.java:112)
    at
org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.
run(AbstractCommonPowerMockRunner.java:44)
    at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen
ce.java:46)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:467)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:197)

Original comment by joesabba...@gmail.com on 25 Nov 2009 at 5:53

GoogleCodeExporter commented 9 years ago
Reverting back to Mockito 1.8.0 seems to solve the NoSuchMethodError, so this 
does
seem related

Original comment by joesabba...@gmail.com on 25 Nov 2009 at 6:55

GoogleCodeExporter commented 9 years ago
1.3.0 and 1.3.1 doesn't work with Mockito 1.8.1. You need to use the trunk 
version of
PowerMock in order to use version 1.8.1. We'll probably have to release a new 
version
soon I suppose.

Original comment by johan.ha...@gmail.com on 25 Nov 2009 at 8:42

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 22 Jul 2010 at 9:26

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 8 Aug 2010 at 10:49