konveyor / tackle-test-generator-cli

Apache License 2.0
58 stars 34 forks source link

Cannot find the Java compiler issue #67

Closed shailajapatel closed 3 years ago

shailajapatel commented 3 years ago

Executed the command - tkltest --config-file ./test/data/irs/tkltest_config.toml --verbose generate ctd-amplified

Received the following error -

MacBook-Pro:tackle-test-generator-cli shailaja$ tkltest --config-file ./test/data/irs/tkltest_config.toml --verbose generate ctd-amplified
[tkltest|11:05:41.337] Loading config file ./test/data/irs/tkltest_config.toml
[tkltest|11:05:41.340] Computing coverage goals using CTD
* CTD interaction level: 1
* Total number of classes: 5
* Targeting 5 classes
Parameters  : 2
Constraints : 0
Covered Tuples  : 2 (1-way: 2) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 2
Constraints : 0
Covered Tuples  : 2 (1-way: 2) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 3
Constraints : 0
Covered Tuples  : 3 (1-way: 3) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 2
Constraints : 0
Covered Tuples  : 2 (1-way: 2) 
Parameters  : 4
Constraints : 0
Covered Tuples  : 4 (1-way: 4) 
Parameters  : 2
Constraints : 0
Covered Tuples  : 2 (1-way: 2) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 1
Constraints : 0
Covered Tuples  : 1 (1-way: 1) 
Parameters  : 4
Constraints : 0
Covered Tuples  : 4 (1-way: 4) 
* Created a total of 20 test combinations for 20 target methods of 5 target classes
[tkltest|11:05:42.673] Computing test plans with CTD took 1.33 seconds
[tkltest|11:05:42.673] Generating basic block test sequences using CombinedTestGenerator
[tkltest|11:05:42.673] Test generator output will be written to irs_CombinedTestGenerator_output.log
[tkltest|11:05:47.782] ERROR: Generating basic block sequences failed: Command '"/Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home/bin/java" -cp lib/download/tackle-test-generator-core-1.0.0-SNAPSHOT.jar:lib/download/randoop-all-4.2.6.jar:lib/download/evosuite-standalone-runtime-1.0.7.jar:lib/download/evosuite-master-1.0.7.jar:lib/download/commons-cli-1.4.jar:lib/download/soot-4.1.0.jar:lib/download/commons-io-2.6.jar:lib/download/javaparser-core-3.16.1.jar:lib/download/javaparser-symbol-solver-core-3.16.1.jar:lib/download/guava-29.0-jre.jar:lib/download/failureaccess-1.0.1.jar:lib/download/javax.json-1.0.4.jar org.konveyor.tackle.testgen.core.TestSequenceInitializer -app irs -tp irs_ctd_models_and_test_plans.json -pt test/data/irs/monolith/target/classes -clpt test/data/irs/irsMonoClasspath.txt -tg CombinedTestGenerator -tl 2 1> irs_CombinedTestGenerator_output.log' returned non-zero exit status 1.
[MASTER] 11:05:44.366 [main] ERROR EvoSuite - Fatal crash on main EvoSuite process. Class  using seed 1629731144361. Configuration id : null
java.lang.RuntimeException: Did not manage to automatically find tools.jar. Use -Dtools_jar_location=<path> property
    at org.evosuite.runtime.agent.ToolsJarLocator.getLoaderForToolsJar(ToolsJarLocator.java:116) ~[evosuite-master-1.0.7.jar:1.0.7-SNAPSHOT]
    at org.evosuite.classpath.ClassPathHacker.initializeToolJar(ClassPathHacker.java:71) ~[evosuite-master-1.0.7.jar:1.0.7-SNAPSHOT]
    at org.evosuite.EvoSuite.parseCommandLine(EvoSuite.java:193) ~[evosuite-master-1.0.7.jar:1.0.7-SNAPSHOT]
    at org.evosuite.EvoSuite.main(EvoSuite.java:117) ~[evosuite-master-1.0.7.jar:1.0.7-SNAPSHOT]
Exception in thread "main" java.io.IOException: org.konveyor.tackle.testgen.core.EvoSuiteTestGenerator: java.io.IOException: Test generator failed to generate any tests
org.konveyor.tackle.testgen.core.RandoopTestGenerator: java.io.IOException: Test generator failed to generate any tests

    at org.konveyor.tackle.testgen.core.TestSequenceInitializer.createInitialTests(TestSequenceInitializer.java:255)
    at org.konveyor.tackle.testgen.core.TestSequenceInitializer.main(TestSequenceInitializer.java:564)

Here is the log file - irs_CombinedTestGenerator_output.log

rachelt44 commented 3 years ago

Fixed in the core repo. Used the java.home system property to locate the JDK with which the original java process was run, and use it to execute randoop and evosuite in new java processes.