diff --git a/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt b/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt index afb56ebb20..fcfb6abc0c 100644 --- a/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt +++ b/utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt @@ -144,7 +144,7 @@ sealed class UtResult * - coverage information (instructions) if this execution was obtained from the concrete execution. * - comments, method names and display names created by utbot-summary module. */ -open class UtExecution( +abstract class UtExecution( val stateBefore: EnvironmentModels, val stateAfter: EnvironmentModels, val result: UtExecutionResult, @@ -224,6 +224,27 @@ class UtSymbolicExecution( } } +/** + * Execution that result in an error (e.g., JVM crash or another concrete execution error). + * + * Contains: + * - state before the execution; + * - result (a [UtExecutionFailure] or its subclass); + * - coverage information (instructions) if this execution was obtained from the concrete execution. + * - comments, method names and display names created by utbot-summary module. + * + * This execution does not contain any "after" state, as it is generally impossible to obtain + * in case of failure. [MissingState] is used instead. + */ +class UtFailedExecution( + stateBefore: EnvironmentModels, + result: UtExecutionFailure, + coverage: Coverage? = null, + summary: List? = null, + testMethodName: String? = null, + displayName: String? = null +) : UtExecution(stateBefore, MissingState, result, coverage, summary, testMethodName, displayName) + open class EnvironmentModels( val thisInstance: UtModel?, val parameters: List, diff --git a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt index 9a55432678..2a6e3e0139 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt @@ -68,6 +68,7 @@ import org.utbot.framework.plugin.api.UtAssembleModel import org.utbot.framework.plugin.api.UtConcreteExecutionFailure import org.utbot.framework.plugin.api.UtError import org.utbot.framework.plugin.api.UtExecution +import org.utbot.framework.plugin.api.UtFailedExecution import org.utbot.framework.plugin.api.UtInstrumentation import org.utbot.framework.plugin.api.UtMethod import org.utbot.framework.plugin.api.UtNullModel @@ -518,9 +519,8 @@ class UtBotSymbolicEngine( stateBefore: EnvironmentModels, e: ConcreteExecutionFailureException ) { - val failedConcreteExecution = UtExecution( + val failedConcreteExecution = UtFailedExecution( stateBefore = stateBefore, - stateAfter = MissingState, result = UtConcreteExecutionFailure(e) )