diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgMethodTestSet.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgMethodTestSet.kt index 6bf8e4e32b..03345a4e84 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgMethodTestSet.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgMethodTestSet.kt @@ -11,51 +11,28 @@ import org.utbot.framework.plugin.api.UtSymbolicExecution import org.utbot.framework.plugin.api.util.objectClassId import org.utbot.framework.plugin.api.util.voidClassId import org.utbot.fuzzer.UtFuzzedExecution -import soot.jimple.JimpleBody data class CgMethodTestSet constructor( val executableId: ExecutableId, - val jimpleBody: JimpleBody? = null, val errors: Map = emptyMap(), val clustersInfo: List>, ) { var executions: List = emptyList() private set - constructor(from: UtMethodTestSet) : this( - from.method, - from.jimpleBody, - from.errors, - from.clustersInfo - ) { + constructor(from: UtMethodTestSet) : this(from.method, from.errors, from.clustersInfo) { executions = from.executions } + /** - * For JavaScript purposes. + * Constructor for JavaScript and Python purposes. */ constructor( executableId: ExecutableId, - execs: List = emptyList(), - errors: Map = emptyMap() - ) : this( - executableId, - null, - errors, - listOf(null to execs.indices) - ) { - executions = execs - } - - constructor( - executableId: ExecutableId, + errors: Map = emptyMap(), executions: List = emptyList(), - ) : this( - executableId, - null, - emptyMap(), - - listOf(null to executions.indices) - ) { + clustersInfo: List> = listOf(null to executions.indices), + ) : this(executableId, errors, clustersInfo) { this.executions = executions } diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgTestClassConstructor.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgTestClassConstructor.kt index 08ff0a478a..64dd4579ef 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgTestClassConstructor.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgTestClassConstructor.kt @@ -173,7 +173,7 @@ open class CgTestClassConstructor(val context: CgContext) : testSet: CgMethodTestSet, regions: MutableList> ) { - val (methodUnderTest, _, _, clustersInfo) = testSet + val (methodUnderTest, _, clustersInfo) = testSet for ((clusterSummary, executionIndices) in clustersInfo) { val currentTestCaseTestMethods = mutableListOf() @@ -208,7 +208,7 @@ open class CgTestClassConstructor(val context: CgContext) : testSet: CgMethodTestSet, regions: MutableList> ) { - val (methodUnderTest, _, _, _) = testSet + val (methodUnderTest, _, _) = testSet for (preparedTestSet in testSet.prepareTestSetsForParameterizedTestGeneration()) { val dataProviderMethodName = nameGenerator.dataProviderMethodNameFor(preparedTestSet.executableId) diff --git a/utbot-js/src/main/kotlin/api/JsTestGenerator.kt b/utbot-js/src/main/kotlin/api/JsTestGenerator.kt index 43ab39d189..a8af69a5cc 100644 --- a/utbot-js/src/main/kotlin/api/JsTestGenerator.kt +++ b/utbot-js/src/main/kotlin/api/JsTestGenerator.kt @@ -162,9 +162,9 @@ class JsTestGenerator( ) } val testSet = CgMethodTestSet( - execId, - testsForGenerator, - errorsForGenerator + executableId = execId, + errors = errorsForGenerator, + executions = testsForGenerator, ) testSets += testSet paramNames[execId] = funcNode.parameters.map { it.name.toString() } diff --git a/utbot-python/src/main/kotlin/org/utbot/python/PythonTestGenerationProcessor.kt b/utbot-python/src/main/kotlin/org/utbot/python/PythonTestGenerationProcessor.kt index ea957ad3c2..92daed49dc 100644 --- a/utbot-python/src/main/kotlin/org/utbot/python/PythonTestGenerationProcessor.kt +++ b/utbot-python/src/main/kotlin/org/utbot/python/PythonTestGenerationProcessor.kt @@ -187,8 +187,8 @@ object PythonTestGenerationProcessor { val testCode = codegen.pythonGenerateAsStringWithTestReport( notEmptyTests.map { testSet -> CgMethodTestSet( - methodIds[testSet.method] as ExecutableId, - testSet.executions + executableId = methodIds[testSet.method] as ExecutableId, + executions = testSet.executions ) }, allImports