New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Powermock does not play well with java.time #557
Comments
From davidkar...@gmail.com on January 28, 2015 05:24:21 I also tried it with javassist: |
From buurman....@gmail.com on April 28, 2015 01:55:05 I have the exact same trace (except for the test-class, obviously). Using mockito-core 1.10.19, powermock-api-mockito 1.6.2, powermock-module-junit4 1.6.2, javassist 3.19.0-GA. Offending line of code: |
From andreas....@web.de on May 23, 2015 06:11:43 It looks like a bug in javassist. |
This is no longer an issue as of 1.6.6 (possibly earlier, but I've just tried 1.6.6 after it failing in 1.6.1) |
@gigaSproule, than you for letting us know about it. So I closed the issue as resolve. |
Still facing the issue with version 1.6.6 and 1.7.1 OR
Error:
|
Fixed 👍
|
Was there anything else you had to do? I switched my dependencies to those versions and I'm still seeing the same error. |
I have similar issue on version 1.7.4: Code: Error: |
am also version 1.74. I have the same problem with you. How do you solve it? @rcoelho6 |
From davidkar...@gmail.com on January 28, 2015 14:23:28
have this in a unit test which is annotated by: @RunWith(PowerMockRunner.class):
and it will blow up with:
teException: Failed to transform class with name com.davidkarlsen.traktorscrobbler.FileHandlingRouteBuilderTest. Reason: [source error] toInstant(java.time.ZoneOffset) not found in java.time.LocalDateTime
at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:266)
at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:180)
at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:68)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:344)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:145)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:40)
at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.createTestDelegators(AbstractTestSuiteChunkerImpl.java:244)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.(JUnit4TestSuiteChunkerImpl.java:61)
at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.(AbstractCommonPowerMockRunner.java:32)
at org.powermock.modules.junit4.PowerMockRunner.(PowerMockRunner.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:36)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
Caused by: javassist.CannotCompileException: [source error] toInstant(java.time.ZoneOffset) not found in java.time.LocalDateTime
at javassist.expr.MethodCall.replace(MethodCall.java:241)
at org.powermock.core.transformers.impl.MainMockTransformer$PowerMockExpressionEditor.edit(MainMockTransformer.java:288)
at javassist.expr.ExprEditor.loopBody(ExprEditor.java:192)
at javassist.expr.ExprEditor.doit(ExprEditor.java:91)
at javassist.CtClassType.instrument(CtClassType.java:1431)
at org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:74)
at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:251)
... 25 more
Original issue: http://code.google.com/p/powermock/issues/detail?id=537
The text was updated successfully, but these errors were encountered: