类在类路径上时,Surefire抛出SurefireReflectionException



我正在尝试运行evosuite生成的单元测试,但maven surefire插件抛出了一个classnotfound错误,而;缺少";类似乎在类路径中。

当我尝试运行测试时,调试日志显示evosuite在surefire尝试运行测试的时候在类路径上;

[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

但它正在失败;

[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

我仔细检查了Killswitch类是否在evosuite jar文件中,它看起来是。

为了完整起见,这里是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"

以及我正在运行的完整命令(在遵循指南之后@https://www.evosuite.org/documentation/tutorial-part-2/(是具有演进套件参数memoryInMB=4000和cores=4的CCD_ 2。

我以前没有使用过EvoSuite,但我在使用的教程中没有遇到任何问题

$ java -version
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-b01)
Eclipse OpenJ9 VM (build openj9-0.21.0, JRE 1.8.0 Linux amd64-64-Bit Compressed > References 20200728_727 (JIT enabled, AOT enabled)
OpenJ9   - 34cf4c075
OMR      - 113e54219
JCL      - c82ff0c20f based on jdk8u265-b01)

我唯一的理论是,也许您没有从教程的第一部分中清除CLASSPATH环境变量?

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Executing org.evosuite.runtime.InitializingListener
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Running tutorial.LinkedListIterator_ESTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.558 sec - in tutorial.LinkedListIterator_ESTest
Running tutorial.Node_ESTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.065 sec - in tutorial.Node_ESTest
Running tutorial.StackTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in tutorial.StackTest
Running tutorial.LinkedList_ESTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.127 sec - in tutorial.LinkedList_ESTest
Running tutorial.Stack_ESTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.101 sec - in tutorial.Stack_ESTest
Results :
Tests run: 28, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  04:15 min
[INFO] Finished at: 2020-10-29T15:07:28-04:00
[INFO] ------------------------------------------------------------------------

相关内容

  • 没有找到相关文章

最新更新