2

I am using Evosuite from the command line in Linux and I get an error.

the path for the project is: /home/ina/workspace/ina the target class files are located in: /home/ina/workspace/ina/bin/paketa1

I use the command: java -jar evosuite-0.2.0.jar -projectCP /home/ina/workspace/ina -target /home/ina/workspace/ina/bin/paketa1

Here is what I get:

  • EvoSuite
  • Found 2 matching classes in target /home/ina/workspace/ina/bin/paketa1
  • Analyzing classpath (generating inheritance tree)
    • /home/ina/workspace/ina
    • /home/ina/workspace/ina/bin/paketa1
  • Current class: Shembull2
  • Going to generate test cases for class: Shembull2
  • Starting client
  • Connecting to master process on port 5601
  • Analyzing classpath:
  • Inheritance tree loaded from /tmp/ES_inheritancetree2503904095717002256.xml.gz
  • Error while initializing target class: Target class not found in inheritance tree [MASTER] 14:01:22.015 [logback-2] ERROR TestSuiteGenerator - Problem for Shembull2. Full stack: java.lang.ClassNotFoundException: Target class not found in inheritance tree at org.evosuite.setup.DependencyAnalysis.analyze(DependencyAnalysis.java:84) ~[evosuite-0.2.0.jar:na] at org.evosuite.TestSuiteGenerator.generateTestSuite(TestSuiteGenerator.java:221) ~[evosuite-0.2.0.jar:na] at org.evosuite.rmi.service.ClientNodeImpl$1.run(ClientNodeImpl.java:125) [evosuite-0.2.0.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_79] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
  • Computation finished [MASTER] 14:01:22.162 [main] ERROR SearchStatistics - No statistics has been saved because EvoSuite failed to generate any test case [MASTER] 14:01:22.263 [main] ERROR TestGeneration - failed to write statistics data
  • Current class: Shembull1
  • Going to generate test cases for class: Shembull1
  • Starting client
  • Connecting to master process on port 14113
  • Analyzing classpath:
  • Inheritance tree loaded from /tmp/ES_inheritancetree2503904095717002256.xml.gz
  • Error while initializing target class: Target class not found in inheritance tree [MASTER] 14:01:25.039 [logback-2] ERROR TestSuiteGenerator - Problem for Shembull1. Full stack: java.lang.ClassNotFoundException: Target class not found in inheritance tree at org.evosuite.setup.DependencyAnalysis.analyze(DependencyAnalysis.java:84) ~[evosuite-0.2.0.jar:na] at org.evosuite.TestSuiteGenerator.generateTestSuite(TestSuiteGenerator.java:221) ~[evosuite-0.2.0.jar:na] at org.evosuite.rmi.service.ClientNodeImpl$1.run(ClientNodeImpl.java:125) [evosuite-0.2.0.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_79] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
  • Computation finished [MASTER] 14:01:25.155 [main] ERROR SearchStatistics - No statistics has been saved because EvoSuite failed to generate any test case [MASTER] 14:01:25.256 [main] ERROR TestGeneration - failed to write statistics data

Any help would be very appreciated! Thank You

1 Answers1

1

At a first look, it seems the classpath is not properly set. If you have a project in /home/ina/workspace/ina, and the .class files are compiled in the folder bin, then the classpath would be /home/ina/workspace/ina/bin

If you a class Foo in package "paketa1", like for example paketa1.Foo, then the classpath is still /home/ina/workspace/ina/bin, and not /home/ina/workspace/ina/bin/paketa1

arcuri82
  • 885
  • 1
  • 8
  • 17