You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since JDK21 just entered RampDown Phase One and we want to switch to JDK21 ASAP after release, I tried building our project with OpenJDK 21 EA and ran into some failing EasyMock-based unit tests (tests were mocking classes).
The exact Java version I'm using (on Linux) is
openjdk version "21-ea" 2023-09-19
OpenJDK Runtime Environment (build 21-ea+26-2328)
OpenJDK 64-Bit Server VM (build 21-ea+26-2328, mixed mode, sharing)
The exception I got during test execution was something along the lines of
Caused by: java.lang.IllegalArgumentException: com.ourpackage.SomeClass$$$EasyMock$2 must be defined in the same package as org.easymock.internal.ClassProxyFactory
at org.easymock.bytebuddy.dynamic.loading.ClassInjector$UsingLookup.injectRaw(ClassInjector.java:1635)
at org.easymock.bytebuddy.dynamic.loading.ClassInjector$AbstractBase.inject(ClassInjector.java:118)
at org.easymock.bytebuddy.dynamic.loading.ClassLoadingStrategy$UsingLookup.load(ClassLoadingStrategy.java:519)
at org.easymock.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:101)
at org.easymock.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:6317)
at org.easymock.internal.ClassProxyFactory.lambda$createProxy$0(ClassProxyFactory.java:146)
at org.easymock.bytebuddy.TypeCache.findOrInsert(TypeCache.java:168)
... 75 more
Checking the 'easymock-5.1.0' tag on the GitHub bytebuddy repo I saw that easymock includes a shaded version of bytebuddy 1.12.20 while the latest available release of bytebuddy is 1.14.5.
I then checked out master/HEAD of EasyMock (which is using the latest bytebuddy version 1.14.5. ) and tried to build the project using OpenJDK 21 EA but unfortunately unit test execution fails on ./test-nodeps/src/test/java/org/itests/NoDepsTest.java with the following error
Caused by: java.lang.IncompatibleClassChangeError: class org.easymock.mocks.CharBuffer$$$EasyMock$1 cannot inherit from sealed class java.nio.CharBuffer
at java.base/jdk.internal.misc.Unsafe.defineClass0(Native Method)
at java.base/jdk.internal.misc.Unsafe.defineClass(Unsafe.java:1330)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.easymock.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$Enabled.defineClass(ClassInjector.java:2049)
... 54 more
The text was updated successfully, but these errors were encountered:
I just installed EasyMock 5.2.0-SNAPSHOT (master/HEAD) and re-ran our project's unit tests with this snapshot version and now all tests are passing - so the upgraded bytebuddy dependency seems to have fixed it.
I confirmed that our EasyMock based tests fail on Java 21 with EasyMock 5.1.0 and pass with EasyMock 5.2.0-SNAPSHOT at current HEAD. @henri-tremblay can HEAD please be released to facilitate the upgrade to Java 21?
Hi,
Since JDK21 just entered RampDown Phase One and we want to switch to JDK21 ASAP after release, I tried building our project with OpenJDK 21 EA and ran into some failing EasyMock-based unit tests (tests were mocking classes).
The exact Java version I'm using (on Linux) is
The exception I got during test execution was something along the lines of
Checking the 'easymock-5.1.0' tag on the GitHub bytebuddy repo I saw that easymock includes a shaded version of bytebuddy 1.12.20 while the latest available release of bytebuddy is 1.14.5.
I then checked out master/HEAD of EasyMock (which is using the latest bytebuddy version 1.14.5. ) and tried to build the project using OpenJDK 21 EA but unfortunately unit test execution fails on ./test-nodeps/src/test/java/org/itests/NoDepsTest.java with the following error
The text was updated successfully, but these errors were encountered: