question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide Java 10 compatibility

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
raphwcommented, Nov 6, 2017

This is fixed on master and will be part of the next Byte Buddy update.

3reactions
TimvdLippecommented, Nov 3, 2017

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 😂

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found