Provide Java 10 compatibility
See original GitHub issueI ran the JUnit 5 build on jdk-10-ea and encountered a Mockito-related issue.
JUnit Jupiter:TestFactoryTestDescriptorTests:streamsFromTestFactoriesShouldBeClosed()
MethodSource [className = 'org.junit.jupiter.engine.descriptor.TestFactoryTestDescriptorTests', methodName = 'streamsFromTestFactoriesShouldBeClosed', methodParameterTypes = '']
=> org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: interface org.junit.jupiter.api.extension.ExtensionContext.
Mockito can only mock non-private & non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.
Java : 10
JVM vendor name : Oracle Corporation
JVM vendor version : 10-ea+29
JVM name : Java HotSpot(TM) 64-Bit Server VM
JVM version : 10-ea+29
JVM info : mixed mode
OS name : Linux
OS version : 4.11.6-041106-generic
Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection
See full log at: https://travis-ci.org/junit-team/junit5/builds/296747184 See JUnit 5 issue that tracks JDK-9+ related issues at: https://github.com/junit-team/junit5/issues/1063
I guess, there’s command line switch that transforms the exception into a warning.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:15 (10 by maintainers)
Top Results From Across the Web
JDK 10 Release Notes - java - Oracle
Source: Source compatibility concerns translating Java source code into class files. Binary: Binary compatibility is defined in The Java Language Specification ...
Read more >Windows 10 and Java
Is Java supported in Windows 10? Yes, Java was certified on Windows 10 starting with Java 8 Update 51. Will Java run in...
Read more >Compatibility and requirements for the Java agent
The Java agent is compatible with any JVM-based language, including: Java, Scala, Kotlin, and Clojure. For instrumentation support for language-specific ...
Read more >IIB10 Java Version Compatibility - Forums - IBM Support
It's shipped with and only supports Java 7 (1.7). IBM supplies it's own version with IIB JDK which you will find in your...
Read more >Compatibility Matrix - Gradle User Manual
A Java version between 8 and 19 is required to execute Gradle. Java 20 and later versions are not yet supported. Java 6...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is fixed on master and will be part of the next Byte Buddy update.
Okay, that should be an easy fix: https://github.com/raphw/byte-buddy/blob/032d63eefca08d33b45e85e184dad28f752c6d76/byte-buddy-dep/src/main/java/net/bytebuddy/ClassFileVersion.java#L133 that depends on lines like https://github.com/raphw/byte-buddy/blob/032d63eefca08d33b45e85e184dad28f752c6d76/byte-buddy-dep/src/main/java/net/bytebuddy/ClassFileVersion.java#L72
E.g. if ASM defines an Opcode for Java 10, Byte Buddy can work on Java 10, such that Mockito works on Java 10, such that JUnit5 works on Java 10 😂