Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Setup 222 versions for IntelliJ and plugins
Fix wrong import
Add try/catch temporary wrapping to obtain stacktrace
  • Loading branch information
Vassiliy-Kudryashov committed Oct 4, 2022
commit 3854c76dd7641071282e46d07710df572c1ce745
8 changes: 5 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ kotlin.code.style=official
# IU, IC, PC, PY, WS...
ideType=IC

pythonCommunityPluginVersion=212.5457.59
#pythonCommunityPluginVersion=212.5457.59
pythonCommunityPluginVersion=222.4167.37
#Version numbers: https://plugins.jetbrains.com/plugin/631-python/versions
pythonUltimatePluginVersion=212.5457.59
#pythonUltimatePluginVersion=212.5457.59
pythonUltimatePluginVersion=222.4167.37

junit5Version=5.8.0-RC1
junit4Version=4.13.2
Expand All @@ -14,7 +16,7 @@ mockitoVersion=3.5.13
z3Version=4.8.9.1
z3JavaApiVersion=4.8.9
sootCommitHash=1f34746
kotlinVersion=1.7.10
kotlinVersion=1.7.20
log4j2Version=2.13.3
coroutinesVersion=1.6.3
collectionsVersion=0.3.4
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -124,10 +125,15 @@ open class TestCaseGenerator(
chosenClassesToMockAlways: Set<ClassId> = Mocker.javaDefaultClasses.mapTo(mutableSetOf()) { it.id },
executionTimeEstimator: ExecutionTimeEstimator = ExecutionTimeEstimator(utBotGenerationTimeoutInMillis, 1)
): Flow<UtResult> {
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) {
e.printStackTrace()
throw e
}
}

fun generate(
Expand All @@ -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) {
e.printStackTrace()
}
}
controller.paused = true
}
Expand Down
8 changes: 5 additions & 3 deletions utbot-intellij/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ intellij {

val jvmPlugins = listOf(
"java",
"org.jetbrains.kotlin:212-1.7.10-release-333-IJ5457.46"
// "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(
Expand All @@ -41,7 +42,8 @@ intellij {
}
)

version.set("212.5712.43")
// version.set("212.5712.43")
version.set("222.4167.29")
type.set(ideType)
}

Expand All @@ -65,7 +67,7 @@ tasks {

patchPluginXml {
sinceBuild.set("212")
untilBuild.set("221.*")
untilBuild.set("222.*")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down