Skip to content

Commit ac82a66

Browse files
committed
Initial take on UtExecution refactoring
Make `UtExecution` abstract, introduce `UtFailedExecution` as its child
1 parent 517c9f6 commit ac82a66

File tree

2 files changed

+12
-3
lines changed
  • utbot-framework/src/main/kotlin/org/utbot/engine
  • utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api

2 files changed

+12
-3
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ sealed class UtResult
144144
* - coverage information (instructions) if this execution was obtained from the concrete execution.
145145
* - comments, method names and display names created by utbot-summary module.
146146
*/
147-
open class UtExecution(
147+
abstract class UtExecution(
148148
val stateBefore: EnvironmentModels,
149149
val stateAfter: EnvironmentModels,
150150
val result: UtExecutionResult,
@@ -224,6 +224,15 @@ class UtSymbolicExecution(
224224
}
225225
}
226226

227+
class UtFailedExecution(
228+
stateBefore: EnvironmentModels,
229+
result: UtExecutionResult,
230+
coverage: Coverage? = null,
231+
summary: List<DocStatement>? = null,
232+
testMethodName: String? = null,
233+
displayName: String? = null
234+
) : UtExecution(stateBefore, MissingState, result, coverage, summary, testMethodName, displayName)
235+
227236
open class EnvironmentModels(
228237
val thisInstance: UtModel?,
229238
val parameters: List<UtModel>,

utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import org.utbot.framework.plugin.api.UtAssembleModel
6868
import org.utbot.framework.plugin.api.UtConcreteExecutionFailure
6969
import org.utbot.framework.plugin.api.UtError
7070
import org.utbot.framework.plugin.api.UtExecution
71+
import org.utbot.framework.plugin.api.UtFailedExecution
7172
import org.utbot.framework.plugin.api.UtInstrumentation
7273
import org.utbot.framework.plugin.api.UtMethod
7374
import org.utbot.framework.plugin.api.UtNullModel
@@ -515,9 +516,8 @@ class UtBotSymbolicEngine(
515516
stateBefore: EnvironmentModels,
516517
e: ConcreteExecutionFailureException
517518
) {
518-
val failedConcreteExecution = UtExecution(
519+
val failedConcreteExecution = UtFailedExecution(
519520
stateBefore = stateBefore,
520-
stateAfter = MissingState,
521521
result = UtConcreteExecutionFailure(e)
522522
)
523523

0 commit comments

Comments
 (0)