EvoSuite / evosuite

EvoSuite - automated generation of JUnit test suites for Java classes
http://www.evosuite.org
GNU Lesser General Public License v3.0
823 stars 341 forks source link

ClassNotFoundException when applying evosuite on the project Mockito #465

Open DJjjjhao opened 7 months ago

DJjjjhao commented 7 months ago

Context

Please provide below a detailed introduction to the issue itself, and describe what you were doing when the issue happened. Or, what do you want to achieve?

I want to use evosuite to generate tests for the project Mockito built by Gradle, but it appeared the UnsupportedClassVersionError.

Steps to Reproduce

Please break down here below all the needed steps to reproduce the issue. [If possible, please upload an example of the project you are generating tests for.]

  1. The system is win11. I use IDEA to build the project Mockito, which is built by Gradle, and the JVM version is Java17
  2. I execute the evosuite-1.1.0 to generate the tests, and the local JVM version is also Java17
  3. I have tried many different versions of Java, including Java8, Java11, Java 17, Java20, they all produce the same error

EvoSuite Arguments

Please provide the whole EvoSuite commmand you executed (if relevant)

java -jar evosuite-1.1.0.jar -class org.mockito.AdditionalMatchers -projectCP build/classes/java/main

Current Result

Please describe here below the current result you got (if relevant) [if relevant, include a screenshot] image

Expected result

Please describe here below what should be the expected behaviour (if relevant)

Additional info

Please add any information of interest here below I have tried many different versions of Java, including Java8, Java11, Java 17, Java20, they all produce the same error. When setting different versions of Java, the error message is always "this version of the Java Runtime only recognizes class file versions up to 52.0". This is not resonable, it should change.