diff --git a/utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt b/utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt index 0b428a7065..889280358f 100644 --- a/utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt +++ b/utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt @@ -270,7 +270,7 @@ object UtSettings { /** * Fuzzer tries to generate and run tests during this time. */ - var fuzzingTimeoutInMillis: Int by getIntProperty(3_000) + var fuzzingTimeoutInMillis: Long by getLongProperty(3_000L) /** * Generate tests that treat possible overflows in arithmetic operations as errors 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 c9fbaa392d..27c34521d7 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 @@ -5,8 +5,6 @@ import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.collect -import kotlinx.coroutines.flow.flattenConcat -import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking @@ -119,7 +117,7 @@ open class TestCaseGenerator( executionTimeEstimator: ExecutionTimeEstimator = ExecutionTimeEstimator(utBotGenerationTimeoutInMillis, 1) ): Flow { val engine = createSymbolicEngine(controller, method, mockStrategy, chosenClassesToMockAlways, executionTimeEstimator) - return createDefaultFlow(engine) + return defaultTestFlow(engine, executionTimeEstimator.userTimeout) } fun generate( @@ -127,7 +125,7 @@ open class TestCaseGenerator( mockStrategy: MockStrategyApi, chosenClassesToMockAlways: Set = Mocker.javaDefaultClasses.mapTo(mutableSetOf()) { it.id }, methodsGenerationTimeout: Long = utBotGenerationTimeoutInMillis, - generate: (engine: UtBotSymbolicEngine) -> Flow = ::createDefaultFlow + generate: (engine: UtBotSymbolicEngine) -> Flow = defaultTestFlow(methodsGenerationTimeout) ): List { if (isCanceled()) return methods.map { UtMethodTestSet(it) } @@ -260,17 +258,6 @@ open class TestCaseGenerator( ) } - private fun createDefaultFlow(engine: UtBotSymbolicEngine): Flow { - var flow = engine.traverse() - if (UtSettings.useFuzzing) { - flow = flowOf( - engine.fuzzing(System.currentTimeMillis() + UtSettings.fuzzingTimeoutInMillis), - flow, - ).flattenConcat() - } - return flow - } - // CONFLUENCE:The+UtBot+Java+timeouts class ExecutionTimeEstimator(val userTimeout: Long, methodsUnderTestNumber: Int) { diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestFlow.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestFlow.kt new file mode 100644 index 0000000000..ee12fd5893 --- /dev/null +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestFlow.kt @@ -0,0 +1,76 @@ +package org.utbot.framework.plugin.api + +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.emptyFlow +import kotlinx.coroutines.flow.flattenConcat +import kotlinx.coroutines.flow.flowOf +import org.utbot.engine.UtBotSymbolicEngine +import org.utbot.framework.UtSettings + +/** + * Constructs [TestFlow] for customization and creates flow producer. + */ +fun testFlow(block: TestFlow.() -> Unit): UtBotSymbolicEngine.() -> Flow = { TestFlow(block).build(this) } + +/** + * Creates default flow that uses [UtSettings] for customization. + */ +fun defaultTestFlow(timeout: Long) = testFlow { + isSymbolicEngineEnabled = true + generationTimeout = timeout + isFuzzingEnabled = UtSettings.useFuzzing + if (generationTimeout > 0) { + fuzzingValue = UtSettings.fuzzingTimeoutInMillis.coerceIn(0, generationTimeout) / generationTimeout.toDouble() + } +} + +/** + * Creates default flow that uses [UtSettings] for customization. + */ +fun defaultTestFlow(engine: UtBotSymbolicEngine, timeout: Long) = defaultTestFlow(timeout).invoke(engine) + +/** + * TestFlow helps construct flows with different settings but with common sequence of test generation process. + * + * Use [testFlow] to set a custom test flow or [defaultTestFlow] to create flow based on [UtSettings]. + */ +class TestFlow internal constructor(block: TestFlow.() -> Unit) { + var generationTimeout = 0L + set(value) { + field = maxOf(0, value) + } + var isSymbolicEngineEnabled = true + var isFuzzingEnabled = false + var fuzzingValue: Double = 0.1 + set(value) { + field = value.coerceIn(0.0, 1.0) + } + + init { + apply(block) + } + + /* + Constructs default flow that is having the following steps at the moment: + 1. If fuzzer is enabled then run it before symbolic execution for [fuzzingValue] * [generationTimeout] ms. + 2. Run symbolic execution for the rest time. + 3. If both (fuzzer and symbolic execution) are off then do nothing. + */ + fun build(engine: UtBotSymbolicEngine): Flow { + return when { + generationTimeout == 0L -> emptyFlow() + isFuzzingEnabled -> { + when (val value = if (isSymbolicEngineEnabled) (fuzzingValue * generationTimeout).toLong() else generationTimeout) { + 0L -> engine.traverse() + generationTimeout -> engine.fuzzing() + else -> flowOf( + engine.fuzzing(System.currentTimeMillis() + value), + engine.traverse() + ).flattenConcat() + } + } + isSymbolicEngineEnabled -> engine.traverse() + else -> emptyFlow() + } + } +} \ No newline at end of file diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt index e8aed74db8..185180ed4f 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt @@ -8,6 +8,7 @@ import com.intellij.openapi.application.invokeLater import com.intellij.openapi.compiler.CompileContext import com.intellij.openapi.compiler.CompilerManager import com.intellij.openapi.compiler.CompilerPaths +import com.intellij.openapi.components.service import com.intellij.openapi.module.Module import com.intellij.openapi.progress.ProgressIndicator import com.intellij.openapi.progress.Task @@ -49,6 +50,8 @@ import java.nio.file.Paths import java.util.concurrent.TimeUnit import org.utbot.common.filterWhen import org.utbot.engine.util.mockListeners.ForceStaticMockListener +import org.utbot.framework.plugin.api.testFlow +import org.utbot.intellij.plugin.settings.Settings import kotlin.reflect.KClass import kotlin.reflect.full.functions @@ -188,7 +191,18 @@ object UtTestsDialogProcessor { val notEmptyCases = withUtContext(context) { testCaseGenerator - .generate(methods, model.mockStrategy, model.chosenClassesToMockAlways, model.timeout) + .generate( + methods, + model.mockStrategy, + model.chosenClassesToMockAlways, + model.timeout, + generate = testFlow { + generationTimeout = model.timeout + isSymbolicEngineEnabled = true + isFuzzingEnabled = UtSettings.useFuzzing + fuzzingValue = project.service().fuzzingValue + } + ) .map { it.summarize(searchDirectory) } .filterNot { it.executions.isEmpty() && it.errors.isEmpty() } } diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/models/GenerateTestsModel.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/models/GenerateTestsModel.kt index befdd61458..2fb0b593fe 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/models/GenerateTestsModel.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/models/GenerateTestsModel.kt @@ -28,6 +28,7 @@ data class GenerateTestsModel( var selectedMethods: Set?, var timeout:Long, var generateWarningsForStaticMocking: Boolean = false, + var fuzzingValue: Double = 0.05 ) { var testSourceRoot: VirtualFile? = null var testPackageName: String? = null diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/Configurable.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/Configurable.kt index 55acb7b882..7a41ff805a 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/Configurable.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/Configurable.kt @@ -11,7 +11,7 @@ class Configurable(val project: Project) : SearchableConfigurable { override fun createComponent(): JComponent = settingsWindow.panel - override fun isModified(): Boolean = settingsWindow.isModified + override fun isModified(): Boolean = settingsWindow.isModified() override fun apply() = settingsWindow.apply() diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/Settings.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/Settings.kt index 582821d346..edde652c5c 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/Settings.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/Settings.kt @@ -51,7 +51,8 @@ class Settings(val project: Project) : PersistentStateComponent var forceStaticMocking: ForceStaticMocking = ForceStaticMocking.defaultItem, var treatOverflowAsError: TreatOverflowAsError = TreatOverflowAsError.defaultItem, var parametrizedTestSource: ParametrizedTestSource = ParametrizedTestSource.defaultItem, - var classesToMockAlways: Array = Mocker.defaultSuperClassesToMockAlwaysNames.toTypedArray() + var classesToMockAlways: Array = Mocker.defaultSuperClassesToMockAlwaysNames.toTypedArray(), + var fuzzingValue: Double = 0.05, ) { constructor(model: GenerateTestsModel) : this( codegenLanguage = model.codegenLanguage, @@ -63,7 +64,8 @@ class Settings(val project: Project) : PersistentStateComponent hangingTestsTimeout = model.hangingTestsTimeout, forceStaticMocking = model.forceStaticMocking, parametrizedTestSource = model.parametrizedTestSource, - classesToMockAlways = model.chosenClassesToMockAlways.mapTo(mutableSetOf()) { it.name }.toTypedArray() + classesToMockAlways = model.chosenClassesToMockAlways.mapTo(mutableSetOf()) { it.name }.toTypedArray(), + fuzzingValue = model.fuzzingValue ) override fun equals(other: Any?): Boolean { @@ -83,6 +85,7 @@ class Settings(val project: Project) : PersistentStateComponent if (treatOverflowAsError != other.treatOverflowAsError) return false if (parametrizedTestSource != other.parametrizedTestSource) return false if (!classesToMockAlways.contentEquals(other.classesToMockAlways)) return false + if (fuzzingValue != other.fuzzingValue) return false return true } @@ -98,6 +101,7 @@ class Settings(val project: Project) : PersistentStateComponent result = 31 * result + treatOverflowAsError.hashCode() result = 31 * result + parametrizedTestSource.hashCode() result = 31 * result + classesToMockAlways.contentHashCode() + result = 31 * result + fuzzingValue.hashCode() return result } @@ -129,6 +133,12 @@ class Settings(val project: Project) : PersistentStateComponent val classesToMockAlways: Set get() = state.classesToMockAlways.toSet() + var fuzzingValue: Double + get() = state.fuzzingValue + set(value) { + state.fuzzingValue = value.coerceIn(0.0, 1.0) + } + fun setClassesToMockAlways(classesToMockAlways: List) { state.classesToMockAlways = classesToMockAlways.distinct().toTypedArray() } @@ -217,8 +227,7 @@ private class HangingTestsTimeoutConverter : Converter() { override fun fromString(value: String): HangingTestsTimeout { val arguments = value.substringAfter("HangingTestsTimeout:") - val timeoutMs = arguments.first().toLong() - + val timeoutMs = arguments.toLong() return HangingTestsTimeout(timeoutMs) } } diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/SettingsWindow.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/SettingsWindow.kt index 07bd771e13..7f801b59e6 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/SettingsWindow.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/settings/SettingsWindow.kt @@ -1,5 +1,17 @@ package org.utbot.intellij.plugin.settings +import com.intellij.openapi.components.service +import com.intellij.openapi.project.Project +import com.intellij.openapi.ui.DialogPanel +import com.intellij.ui.ContextHelpLabel +import com.intellij.ui.layout.CCFlags +import com.intellij.ui.layout.LayoutBuilder +import com.intellij.ui.layout.PropertyBinding +import com.intellij.ui.layout.labelTable +import com.intellij.ui.layout.panel +import com.intellij.ui.layout.slider +import com.intellij.ui.layout.withValueBinding +import org.utbot.framework.UtSettings import org.utbot.framework.codegen.ForceStaticMocking import org.utbot.framework.codegen.HangingTestsTimeout import org.utbot.framework.codegen.RuntimeExceptionTestsBehaviour @@ -7,188 +19,113 @@ import org.utbot.framework.plugin.api.CodeGenerationSettingItem import org.utbot.framework.plugin.api.CodegenLanguage import org.utbot.framework.plugin.api.MockStrategyApi import org.utbot.framework.plugin.api.TreatOverflowAsError -import org.utbot.intellij.plugin.ui.utils.labeled -import org.utbot.intellij.plugin.ui.utils.panelNoTitle -import com.intellij.openapi.components.service -import com.intellij.openapi.project.Project -import com.intellij.openapi.ui.ComboBox -import com.intellij.openapi.util.Comparing -import com.intellij.ui.layout.CCFlags -import com.intellij.ui.layout.panel -import com.intellij.util.ui.JBUI -import java.awt.FlowLayout import javax.swing.DefaultComboBoxModel -import javax.swing.JComponent import javax.swing.JLabel import javax.swing.JPanel -import javax.swing.JSpinner -import javax.swing.SpinnerNumberModel -import javax.swing.event.AncestorEvent -import javax.swing.event.AncestorListener import kotlin.reflect.KClass @Suppress("UNCHECKED_CAST") class SettingsWindow(val project: Project) { - var panel: JPanel - private val settings = project.service() - private val comboBoxes: MutableList = mutableListOf() - - private data class ComboBoxInfo(val loader: KClass<*>, val comboBox: ComboBox) - - private val mockStrategyComboBox = ComboBox(DefaultComboBoxModel(MockStrategyApi.values())) - private val codegenLanguageComboBox = ComboBox(DefaultComboBoxModel(CodegenLanguage.values())) - private val runtimeExceptionTestsBehaviourComboBox = ComboBox( - DefaultComboBoxModel(RuntimeExceptionTestsBehaviour.values()) - ) - private val hangingTestTimeoutSecondsConfigurable = HangingTestTimeoutSecondsConfigurable() - private val forceStaticMockingComboBox = ComboBox(DefaultComboBoxModel(ForceStaticMocking.values())) - private val treatOverflowAsErrorComboBox = ComboBox(DefaultComboBoxModel(TreatOverflowAsError.values())) - // TODO it is better to use something like SearchEverywhere for classes but it is complicated to implement private val excludeTable = MockAlwaysClassesTable(project) - - val isModified: Boolean - get() = comboBoxes.any { isComboBoxModified(it) } || - excludeTable.isModified() || - hangingTestTimeoutSecondsConfigurable.isModified - - fun apply() { - comboBoxes.forEach { (loader, comboBox) -> - val newProvider = comboBox.selectedItem as CodeGenerationSettingItem - settings.setProviderByLoader(loader, newProvider) + val panel: JPanel = panel { + val valuesComboBox: LayoutBuilder.(KClass<*>, Array<*>) -> Unit = { loader, values -> + val serviceLabels = mapOf( + MockStrategyApi::class to "Mock strategy:", + CodegenLanguage::class to "Language generation:", + RuntimeExceptionTestsBehaviour::class to "Test with exceptions:", + ForceStaticMocking::class to "Force static mocking:", + TreatOverflowAsError::class to "Overflow detection:", + ) + + val serviceComments = mapOf( + RuntimeExceptionTestsBehaviour::class to "Test behavior when runtime exception occurs", + ) + + row(serviceLabels[loader] ?: error("Unknown service loader: $loader")) { + cell { + comboBox( + DefaultComboBoxModel(values), + getter = { settings.providerNameByServiceLoader(loader) }, + setter = { settings.setProviderByLoader(loader, it as CodeGenerationSettingItem) }, + ).apply { + val comment = serviceComments[loader] + if (comment != null) { + ContextHelpLabel.create(comment)() + } + } + } + } } - hangingTestTimeoutSecondsConfigurable.apply() - excludeTable.apply() - } - fun reset() { - comboBoxes.forEach { (loader, comboBox) -> - comboBox.selectedItem = settings.providerNameByServiceLoader(loader) + mapOf( + MockStrategyApi::class to MockStrategyApi.values(), + CodegenLanguage::class to CodegenLanguage.values(), + RuntimeExceptionTestsBehaviour::class to RuntimeExceptionTestsBehaviour.values(), + TreatOverflowAsError::class to TreatOverflowAsError.values() + ).forEach { (loader, values) -> + valuesComboBox(loader, values) } - excludeTable.reset() - hangingTestTimeoutSecondsConfigurable.reset() - } - - init { - comboBoxes += ComboBoxInfo( - MockStrategyApi::class, - mockStrategyComboBox as ComboBox - ) - comboBoxes += ComboBoxInfo( - CodegenLanguage::class, - codegenLanguageComboBox as ComboBox - ) - comboBoxes += ComboBoxInfo( - RuntimeExceptionTestsBehaviour::class, - runtimeExceptionTestsBehaviourComboBox as ComboBox - ) - comboBoxes += ComboBoxInfo( - ForceStaticMocking::class, - forceStaticMockingComboBox as ComboBox - ) - comboBoxes += ComboBoxInfo( - TreatOverflowAsError::class, - treatOverflowAsErrorComboBox as ComboBox - ) - panel = settingsPanel() - panel.addAncestorListener(object : AncestorListener { - private fun setItems() { - mockStrategyComboBox.item = settings.mockStrategy - codegenLanguageComboBox.item = settings.codegenLanguage - runtimeExceptionTestsBehaviourComboBox.item = settings.runtimeExceptionTestsBehaviour - forceStaticMockingComboBox.item = settings.forceStaticMocking - treatOverflowAsErrorComboBox.item = settings.treatOverflowAsError + row("Hanging test timeout:") { + cell { + spinner( + getter = { + settings.hangingTestsTimeout.timeoutMs + .coerceIn(HangingTestsTimeout.MIN_TIMEOUT_MS, HangingTestsTimeout.MAX_TIMEOUT_MS).toInt() + }, + setter = { settings.hangingTestsTimeout = HangingTestsTimeout(it.toLong()) }, + minValue = HangingTestsTimeout.MIN_TIMEOUT_MS.toInt(), + maxValue = HangingTestsTimeout.MAX_TIMEOUT_MS.toInt(), + step = 50, + ) + comment("milliseconds") } + } - // get settings from project state on window appearance - override fun ancestorAdded(event: AncestorEvent) { - setItems() - } - - override fun ancestorRemoved(event: AncestorEvent) {} - - override fun ancestorMoved(event: AncestorEvent) {} - }) - } - - private fun settingsPanel(): JPanel = panel { - comboBoxes - .filterNot { it.loader == ForceStaticMocking::class } - .forEach { (loader, comboBox) -> labeled(labelByServiceLoader(loader), comboBox) } - - row { - val timeoutComponent = hangingTestTimeoutSecondsConfigurable.createComponent() - hangingTestTimeoutSecondsConfigurable.reset() - - panelNoTitle(timeoutComponent) + mapOf( + ForceStaticMocking::class to ForceStaticMocking.values(), + ).forEach { (loader, values) -> + valuesComboBox(loader, values) } - labeled(labelByServiceLoader(ForceStaticMocking::class), forceStaticMockingComboBox) row { excludeTable.component(CCFlags.grow) .onApply { excludeTable.apply() } .onReset { excludeTable.reset() } .onIsModified { excludeTable.isModified() } } - } - - private fun labelByServiceLoader(loader: KClass<*>): String = - when (loader) { - MockStrategyApi::class -> "Mock strategy: " - CodegenLanguage::class -> "Language generation: " - RuntimeExceptionTestsBehaviour::class -> "Behavior of the tests producing Runtime exceptions: " - ForceStaticMocking::class -> "Force static mocking: " - TreatOverflowAsError::class -> "Overflow detection: " - // TODO: add error processing - else -> error("Unknown service loader: $loader") - } - - private fun isComboBoxModified(info: ComboBoxInfo): Boolean = - settings.providerNameByServiceLoader(info.loader) != info.comboBox.selectedItem - - private inner class HangingTestTimeoutSecondsConfigurable : com.intellij.openapi.options.Configurable { - private val title = "Hanging test timeout" - private val timeUnit = "ms" - private val spinnerStepSize = 50L - - private lateinit var timeoutSpinner: JSpinner - - override fun createComponent(): JComponent { - val wrapper = JPanel(FlowLayout(FlowLayout.LEFT, 0, 0)) - val titleLabel = JLabel(title) - wrapper.add(titleLabel) - timeoutSpinner = JSpinner(createSpinnerModel()) - wrapper.add(timeoutSpinner) - val timeUnitLabel = JLabel(timeUnit) - timeUnitLabel.border = JBUI.Borders.empty(0, 1) - wrapper.add(timeUnitLabel) - return wrapper + row("Code analysis:") { + enabled = UtSettings.useFuzzing + val granularity = 60 + slider(0, granularity, 1, granularity / 4) + .labelTable { + put(0, JLabel("Simpler")) + put(granularity, JLabel("Deeper")) + }.withValueBinding( + PropertyBinding( + get = { ((1 - settings.fuzzingValue) * granularity).toInt() }, + set = { settings.fuzzingValue = 1 - it / granularity.toDouble() } + ) + ) + .constraints(CCFlags.growX) } + } - fun createSpinnerModel(): SpinnerNumberModel = SpinnerNumberModel( - HangingTestsTimeout.DEFAULT_TIMEOUT_MS, - HangingTestsTimeout.MIN_TIMEOUT_MS, - HangingTestsTimeout.MAX_TIMEOUT_MS, - spinnerStepSize - ) - - override fun isModified(): Boolean = - !Comparing.equal(timeoutSpinner.value, settings.hangingTestsTimeout.timeoutMs) - - override fun apply() { - val hangingTestsTimeout = HangingTestsTimeout(timeoutSpinner.value as Long) - - settings.hangingTestsTimeout = hangingTestsTimeout - } + fun isModified(): Boolean { + return excludeTable.isModified() || (panel as DialogPanel).isModified() + } - override fun getDisplayName(): String = "Test milliseconds timeout" + fun apply() { + excludeTable.apply() + (panel as DialogPanel).apply() + } - override fun reset() { - timeoutSpinner.value = settings.hangingTestsTimeout.timeoutMs - } + fun reset() { + excludeTable.reset() + (panel as DialogPanel).reset() } } \ No newline at end of file diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt index 421c9c2cd8..49499f2b9d 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt @@ -456,6 +456,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m model.hangingTestsTimeout = hangingTestsTimeout model.forceStaticMocking = forceStaticMocking model.chosenClassesToMockAlways = chosenClassesToMockAlways() + model.fuzzingValue = fuzzingValue UtSettings.treatOverflowAsError = treatOverflowAsError == TreatOverflowAsError.AS_ERROR } diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/UiUtils.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/UiUtils.kt deleted file mode 100644 index 4c25a29843..0000000000 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/utils/UiUtils.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.utbot.intellij.plugin.ui.utils - -import com.intellij.ui.components.Panel -import com.intellij.ui.layout.Cell -import com.intellij.ui.layout.CellBuilder -import com.intellij.ui.layout.LayoutBuilder -import java.awt.Component -import javax.swing.JComponent -import javax.swing.JPanel - -fun LayoutBuilder.labeled(text: String, component: JComponent) { - row { - cell(false) { - label(text) - component() - } - } -} - -fun Cell.panelNoTitle(wrappedComponent: Component, hasSeparator: Boolean = true): CellBuilder { - val panel = Panel(null, hasSeparator) - panel.add(wrappedComponent) - return component(panel) -}