diff --git a/gradle.properties b/gradle.properties index 3a1dc33f81..bfed176dd4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ kotlin.code.style=official # IU, IC, PC, PY, WS... ideType=IC -pythonCommunityPluginVersion=212.5457.59 +pythonCommunityPluginVersion=222.4167.37 #Version numbers: https://plugins.jetbrains.com/plugin/631-python/versions -pythonUltimatePluginVersion=212.5457.59 +pythonUltimatePluginVersion=222.4167.37 junit5Version=5.8.0-RC1 junit4Version=4.13.2 @@ -13,8 +13,8 @@ junit4PlatformVersion=1.9.0 mockitoVersion=3.5.13 z3Version=4.8.9.1 z3JavaApiVersion=4.8.9 -sootCommitHash=1f34746 -kotlinVersion=1.7.10 +sootCommitHash=3adf23c3 +kotlinVersion=1.7.20 log4j2Version=2.13.3 coroutinesVersion=1.6.3 collectionsVersion=0.3.4 diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt index 5e90150ace..d16101086c 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt @@ -1,5 +1,6 @@ package org.utbot.framework.plugin.api +import com.google.protobuf.compiler.PluginProtos import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.cancel @@ -124,10 +125,15 @@ open class TestCaseGenerator( chosenClassesToMockAlways: Set = Mocker.javaDefaultClasses.mapTo(mutableSetOf()) { it.id }, executionTimeEstimator: ExecutionTimeEstimator = ExecutionTimeEstimator(utBotGenerationTimeoutInMillis, 1) ): Flow { - val engine = createSymbolicEngine(controller, method, mockStrategy, chosenClassesToMockAlways, executionTimeEstimator) - engineActions.map { engine.apply(it) } - engineActions.clear() - return defaultTestFlow(engine, executionTimeEstimator.userTimeout) + try { + val engine = createSymbolicEngine(controller, method, mockStrategy, chosenClassesToMockAlways, executionTimeEstimator) + engineActions.map { engine.apply(it) } + engineActions.clear() + return defaultTestFlow(engine, executionTimeEstimator.userTimeout) + } catch (e: Exception) { + logger.error(e) {"Generate async failed"} + throw e + } } fun generate( @@ -154,29 +160,33 @@ open class TestCaseGenerator( controller.job = launch(currentUtContext) { if (!isActive) return@launch - //yield one to - yield() + try { + //yield one to + yield() - val engine: UtBotSymbolicEngine = createSymbolicEngine( - controller, - method, - mockStrategy, - chosenClassesToMockAlways, - executionTimeEstimator - ) + val engine: UtBotSymbolicEngine = createSymbolicEngine( + controller, + method, + mockStrategy, + chosenClassesToMockAlways, + executionTimeEstimator + ) - engineActions.map { engine.apply(it) } + engineActions.map { engine.apply(it) } - generate(engine) - .catch { - logger.error(it) { "Error in flow" } - } - .collect { - when (it) { - is UtExecution -> method2executions.getValue(method) += it - is UtError -> method2errors.getValue(method).merge(it.description, 1, Int::plus) + generate(engine) + .catch { + logger.error(it) { "Error in flow" } } - } + .collect { + when (it) { + is UtExecution -> method2executions.getValue(method) += it + is UtError -> method2errors.getValue(method).merge(it.description, 1, Int::plus) + } + } + } catch (e: Exception) { + logger.error(e) {"Error in engine"} + } } controller.paused = true } diff --git a/utbot-intellij/build.gradle.kts b/utbot-intellij/build.gradle.kts index 4377a5c443..6f6ce451ce 100644 --- a/utbot-intellij/build.gradle.kts +++ b/utbot-intellij/build.gradle.kts @@ -16,7 +16,7 @@ intellij { val jvmPlugins = listOf( "java", - "org.jetbrains.kotlin:212-1.7.10-release-333-IJ5457.46" + "org.jetbrains.kotlin:222-1.7.20-release-201-IJ4167.29" ) val pythonCommunityPlugins = listOf( @@ -41,7 +41,7 @@ intellij { } ) - version.set("212.5712.43") + version.set("222.4167.29") type.set(ideType) } @@ -65,7 +65,7 @@ tasks { patchPluginXml { sinceBuild.set("212") - untilBuild.set("221.*") + untilBuild.set("222.*") } } diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/util/RunConfigurationHelper.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/util/RunConfigurationHelper.kt index cc0035ca8f..19b8b44615 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/util/RunConfigurationHelper.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/util/RunConfigurationHelper.kt @@ -22,8 +22,8 @@ import com.intellij.psi.PsiDocumentManager import com.intellij.psi.PsiElement import com.intellij.psi.PsiFile import com.intellij.psi.SmartPsiElementPointer +import com.intellij.psi.util.childrenOfType import mu.KotlinLogging -import org.jetbrains.plugins.groovy.lang.psi.util.childrenOfType import org.utbot.intellij.plugin.models.GenerateTestsModel import org.utbot.intellij.plugin.util.IntelliJApiHelper.run