Skip to content

Commit 0714477

Browse files
EgorkaKulikovsofurihafe
authored andcommitted
Restore flow with Fuzzing (#1839)
1 parent 04a68f5 commit 0714477

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,11 @@ class WildcardTypeParameter : TypeParameters(emptyList())
11531153
*/
11541154
interface ApplicationContext
11551155

1156+
/**
1157+
* A context to use when no additional data is required.
1158+
*/
1159+
object EmptyApplicationContext: ApplicationContext
1160+
11561161
/**
11571162
* Data we get from Spring application context
11581163
* to manage engine and code generator behaviour.

utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineProcessMain.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,13 @@ private fun EngineProcessModel.setup(kryoHelper: KryoHelper, watchdog: IdleWatch
111111

112112
val generateFlow = when (testGenerator.applicationContext) {
113113
is SpringApplicationContext -> defaultSpringFlow(params.generationTimeout)
114-
else -> testFlow {
114+
is EmptyApplicationContext -> testFlow {
115115
generationTimeout = params.generationTimeout
116116
isSymbolicEngineEnabled = params.isSymbolicEngineEnabled
117117
isFuzzingEnabled = params.isFuzzingEnabled
118118
fuzzingValue = params.fuzzingValue
119119
}
120+
else -> error("Unknown application context ${testGenerator.applicationContext}")
120121
}
121122

122123
val result = testGenerator.generate(

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import org.utbot.framework.CancellationStrategyType.NONE
2626
import org.utbot.framework.CancellationStrategyType.SAVE_PROCESSED_RESULTS
2727
import org.utbot.framework.UtSettings
2828
import org.utbot.framework.plugin.api.ClassId
29+
import org.utbot.framework.plugin.api.EmptyApplicationContext
2930
import org.utbot.framework.plugin.api.JavaDocCommentStyle
30-
import org.utbot.framework.plugin.api.SpringApplicationContext
3131
import org.utbot.framework.plugin.api.util.LockFile
3232
import org.utbot.framework.plugin.api.util.withStaticsSubstitutionRequired
3333
import org.utbot.framework.plugin.services.JdkInfoService
@@ -170,10 +170,9 @@ object UtTestsDialogProcessor {
170170
}.toMap()
171171
}
172172

173+
val applicationContext = EmptyApplicationContext
173174
// TODO: obtain bean definitions and other info from `utbot-spring-analyzer`
174-
val springApplicationContext = SpringApplicationContext(
175-
beanQualifiedNames = emptyList(),
176-
)
175+
//SpringApplicationContext(beanQualifiedNames = emptyList())
177176

178177
val process = EngineProcess.createBlocking(project, classNameToPath)
179178

@@ -184,7 +183,7 @@ object UtTestsDialogProcessor {
184183
classpath,
185184
pluginJarsPath.joinToString(separator = File.pathSeparator),
186185
JdkInfoService.provide(),
187-
springApplicationContext,
186+
applicationContext,
188187
) {
189188
ApplicationManager.getApplication().runReadAction(Computable {
190189
indicator.isCanceled

0 commit comments

Comments
 (0)