Skip to content

Commit 92a52bb

Browse files
Vassiliy-Kudryashovdenis-fokin
authored andcommitted
Setup 222 versions for IntelliJ and plugins
Fix wrong import Add try/catch temporary wrapping to obtain stacktrace
1 parent acb5676 commit 92a52bb

File tree

4 files changed

+44
-30
lines changed

4 files changed

+44
-30
lines changed

gradle.properties

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ kotlin.code.style=official
33
# IU, IC, PC, PY, WS...
44
ideType=IC
55

6-
pythonCommunityPluginVersion=212.5457.59
6+
#pythonCommunityPluginVersion=212.5457.59
7+
pythonCommunityPluginVersion=222.4167.37
78
#Version numbers: https://plugins.jetbrains.com/plugin/631-python/versions
8-
pythonUltimatePluginVersion=212.5457.59
9+
#pythonUltimatePluginVersion=212.5457.59
10+
pythonUltimatePluginVersion=222.4167.37
911

1012
junit5Version=5.8.0-RC1
1113
junit4Version=4.13.2
@@ -14,7 +16,7 @@ mockitoVersion=3.5.13
1416
z3Version=4.8.9.1
1517
z3JavaApiVersion=4.8.9
1618
sootCommitHash=1f34746
17-
kotlinVersion=1.7.10
19+
kotlinVersion=1.7.20
1820
log4j2Version=2.13.3
1921
coroutinesVersion=1.6.3
2022
collectionsVersion=0.3.4

utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt

+33-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.utbot.framework.plugin.api
22

3+
import com.google.protobuf.compiler.PluginProtos
34
import kotlinx.coroutines.CoroutineScope
45
import kotlinx.coroutines.GlobalScope
56
import kotlinx.coroutines.cancel
@@ -124,10 +125,15 @@ open class TestCaseGenerator(
124125
chosenClassesToMockAlways: Set<ClassId> = Mocker.javaDefaultClasses.mapTo(mutableSetOf()) { it.id },
125126
executionTimeEstimator: ExecutionTimeEstimator = ExecutionTimeEstimator(utBotGenerationTimeoutInMillis, 1)
126127
): Flow<UtResult> {
127-
val engine = createSymbolicEngine(controller, method, mockStrategy, chosenClassesToMockAlways, executionTimeEstimator)
128-
engineActions.map { engine.apply(it) }
129-
engineActions.clear()
130-
return defaultTestFlow(engine, executionTimeEstimator.userTimeout)
128+
try {
129+
val engine = createSymbolicEngine(controller, method, mockStrategy, chosenClassesToMockAlways, executionTimeEstimator)
130+
engineActions.map { engine.apply(it) }
131+
engineActions.clear()
132+
return defaultTestFlow(engine, executionTimeEstimator.userTimeout)
133+
} catch (e: Exception) {
134+
e.printStackTrace()
135+
throw e
136+
}
131137
}
132138

133139
fun generate(
@@ -154,29 +160,33 @@ open class TestCaseGenerator(
154160
controller.job = launch(currentUtContext) {
155161
if (!isActive) return@launch
156162

157-
//yield one to
158-
yield()
163+
try {
164+
//yield one to
165+
yield()
159166

160-
val engine: UtBotSymbolicEngine = createSymbolicEngine(
161-
controller,
162-
method,
163-
mockStrategy,
164-
chosenClassesToMockAlways,
165-
executionTimeEstimator
166-
)
167+
val engine: UtBotSymbolicEngine = createSymbolicEngine(
168+
controller,
169+
method,
170+
mockStrategy,
171+
chosenClassesToMockAlways,
172+
executionTimeEstimator
173+
)
167174

168-
engineActions.map { engine.apply(it) }
175+
engineActions.map { engine.apply(it) }
169176

170-
generate(engine)
171-
.catch {
172-
logger.error(it) { "Error in flow" }
173-
}
174-
.collect {
175-
when (it) {
176-
is UtExecution -> method2executions.getValue(method) += it
177-
is UtError -> method2errors.getValue(method).merge(it.description, 1, Int::plus)
177+
generate(engine)
178+
.catch {
179+
logger.error(it) { "Error in flow" }
178180
}
179-
}
181+
.collect {
182+
when (it) {
183+
is UtExecution -> method2executions.getValue(method) += it
184+
is UtError -> method2errors.getValue(method).merge(it.description, 1, Int::plus)
185+
}
186+
}
187+
} catch (e: Exception) {
188+
e.printStackTrace()
189+
}
180190
}
181191
controller.paused = true
182192
}

utbot-intellij/build.gradle.kts

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ intellij {
1616

1717
val jvmPlugins = listOf(
1818
"java",
19-
"org.jetbrains.kotlin:212-1.7.10-release-333-IJ5457.46"
19+
// "org.jetbrains.kotlin:212-1.7.10-release-333-IJ5457.46"
20+
"org.jetbrains.kotlin:222-1.7.20-release-201-IJ4167.29"
2021
)
2122

2223
val pythonCommunityPlugins = listOf(
@@ -41,7 +42,8 @@ intellij {
4142
}
4243
)
4344

44-
version.set("212.5712.43")
45+
// version.set("212.5712.43")
46+
version.set("222.4167.29")
4547
type.set(ideType)
4648
}
4749

@@ -65,7 +67,7 @@ tasks {
6567

6668
patchPluginXml {
6769
sinceBuild.set("212")
68-
untilBuild.set("221.*")
70+
untilBuild.set("222.*")
6971
}
7072
}
7173

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/util/RunConfigurationHelper.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import com.intellij.psi.PsiDocumentManager
2222
import com.intellij.psi.PsiElement
2323
import com.intellij.psi.PsiFile
2424
import com.intellij.psi.SmartPsiElementPointer
25+
import com.intellij.psi.util.childrenOfType
2526
import mu.KotlinLogging
26-
import org.jetbrains.plugins.groovy.lang.psi.util.childrenOfType
2727
import org.utbot.intellij.plugin.models.GenerateTestsModel
2828
import org.utbot.intellij.plugin.util.IntelliJApiHelper.run
2929

0 commit comments

Comments
 (0)