Skip to content

Commit 5f56eb1

Browse files
Correlate jdk version in ConcreteExecutor and child process (#201)
* Specify jdk in child process same as in ContestEstimator and added guava-30.0 to ContestEstimator
1 parent 2a1346b commit 5f56eb1

File tree

10 files changed

+21
-6
lines changed

10 files changed

+21
-6
lines changed

utbot-junit-contest/src/main/kotlin/org/utbot/contest/ContestEstimator.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ import kotlin.concurrent.thread
3030
import kotlin.math.min
3131
import kotlin.system.exitProcess
3232
import mu.KotlinLogging
33+
import org.utbot.framework.JdkPathService
3334

3435
private val logger = KotlinLogging.logger {}
3536

3637
private val classPathSeparator = System.getProperty("path.separator")
37-
private val javaHome = if (System.getProperty("user.name") == "d00555580") {
38-
"C:/Program Files/Java/jdk1.8.0_241"
39-
} else {
40-
System.getenv("JAVA_HOME")
41-
}
38+
//To hack it to debug something be like Dima
39+
// if (System.getProperty("user.name") == "d00555580") my_path else "JAVA_HOME"
40+
private val javaHome = System.getenv("JAVA_HOME")
41+
4242
private val javacCmd = "$javaHome/bin/javac"
4343
private val javaCmd = "$javaHome/bin/java"
4444

@@ -293,6 +293,7 @@ fun main(args: Array<String>) {
293293
tools = listOf(Tool.UtBot)
294294
}
295295

296+
JdkPathService.jdkPathProvider = ContestEstimatorJdkPathProvider(javaHome)
296297
runEstimator(estimatorArgs, methodFilter, projectFilter, processedClassesThreshold, tools)
297298
}
298299

@@ -333,7 +334,6 @@ fun runEstimator(
333334
if (updatedMethodFilter != null)
334335
logger.info { "Filtering: class='$classFqnFilter', method ='$methodNameFilter'" }
335336

336-
337337
val projectToClassFQNs = classesLists.listFiles()!!.associate { it.name to File(it, "list").readLines() }
338338

339339
val projects = mutableListOf<ProjectToEstimate>()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.utbot.contest
2+
3+
import org.utbot.common.PathUtil.toPath
4+
import org.utbot.framework.JdkPathDefaultProvider
5+
import java.nio.file.Path
6+
7+
/**
8+
* This class is used to provide jdkPath set in [ContestEstimator]
9+
* into the child process for concrete execution.
10+
*/
11+
class ContestEstimatorJdkPathProvider(private val path: String) : JdkPathDefaultProvider() {
12+
override val jdkPath: Path
13+
get() = path.toPath()
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.google.common.graph.StandardMutableValueGraph
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)