I'm trying to run unit tests generated by evosuite but the maven-surefire-plugin is throwing a classnotfound error while the "missing" class appears to be in the classpath.
When I try to run the tests the debug log shows that evosuite is on the classpath at the time surefire is trying to run the tests;
[DEBUG] test(compact) classpath: test-classes classes junit-4.12.jar hamcrest-core-1.3.jar evosuite-standalone-runtime-1.0.6.jar
[DEBUG] provider(compact) classpath: surefire-junit4-2.17.jar surefire-api-2.17.jar
But it's failing;
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project Tutorial_Maven: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was an error in the forked process
[ERROR] java.lang.NoClassDefFoundError: org.evosuite.runtime.thread.KillSwitch
I double checked if the Killswitch class is in the evosuite jar file and it appears it is.
For completeness, here's the output of mvn -version
;
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: /home/marijn/git/Tutorial_Maven/EMBEDDED
Java version: 1.8.0_252, vendor: Eclipse OpenJ9
Java home: /home/marijn/.sdkman/candidates/java/8.0.252.j9-adpt/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.6.11-100.fc30.x86_64", arch: "amd64", family: "unix"
And the full command I'm running (after following the guide @ https://www.evosuite.org/documentation/tutorial-part-2/ ) is mvn clean compile test-compile evosuite:generate evosuite:export evosuite:prepare test
With evosuite parameters memoryInMB = 4000 and cores = 4.