11package org.utbot.framework.codegen.tree
22
3- import org.utbot.common.PathUtil
43import org.utbot.common.WorkaroundReason
54import org.utbot.common.isStatic
65import org.utbot.common.workaround
76import org.utbot.engine.ArtificialError
7+ import org.utbot.framework.UtSettings
88import org.utbot.framework.assemble.assemble
99import org.utbot.framework.codegen.domain.ForceStaticMocking
1010import org.utbot.framework.codegen.domain.ParametrizedTestSource
1111import org.utbot.framework.codegen.domain.RuntimeExceptionTestsBehaviour.PASS
12- import org.utbot.framework.codegen.domain.models.CgMethodTestSet
1312import org.utbot.framework.codegen.domain.builtin.closeMethodIdOrNull
1413import org.utbot.framework.codegen.domain.builtin.forName
1514import org.utbot.framework.codegen.domain.builtin.getClass
@@ -22,8 +21,6 @@ import org.utbot.framework.codegen.domain.models.CgAllocateArray
2221import org.utbot.framework.codegen.domain.models.CgArrayElementAccess
2322import org.utbot.framework.codegen.domain.models.CgClassId
2423import org.utbot.framework.codegen.domain.models.CgDeclaration
25- import org.utbot.framework.codegen.domain.models.CgDocPreTagStatement
26- import org.utbot.framework.codegen.domain.models.CgDocRegularStmt
2724import org.utbot.framework.codegen.domain.models.CgDocumentationComment
2825import org.utbot.framework.codegen.domain.models.CgEqualTo
2926import org.utbot.framework.codegen.domain.models.CgErrorTestMethod
@@ -34,6 +31,7 @@ import org.utbot.framework.codegen.domain.models.CgGetJavaClass
3431import org.utbot.framework.codegen.domain.models.CgLiteral
3532import org.utbot.framework.codegen.domain.models.CgMethod
3633import org.utbot.framework.codegen.domain.models.CgMethodCall
34+ import org.utbot.framework.codegen.domain.models.CgMethodTestSet
3735import org.utbot.framework.codegen.domain.models.CgMultilineComment
3836import org.utbot.framework.codegen.domain.models.CgNotNullAssertion
3937import org.utbot.framework.codegen.domain.models.CgParameterDeclaration
@@ -53,10 +51,19 @@ import org.utbot.framework.codegen.domain.models.CgValue
5351import org.utbot.framework.codegen.domain.models.CgVariable
5452import org.utbot.framework.codegen.domain.models.convertDocToCg
5553import org.utbot.framework.codegen.domain.models.toStatement
54+ import org.utbot.framework.codegen.services.access.CgCallableAccessManager
55+ import org.utbot.framework.codegen.services.access.CgFieldStateManagerImpl
56+ import org.utbot.framework.codegen.services.framework.TestFrameworkManager
57+ import org.utbot.framework.codegen.tree.CgComponents.getCallableAccessManagerBy
58+ import org.utbot.framework.codegen.tree.CgComponents.getMockFrameworkManagerBy
59+ import org.utbot.framework.codegen.tree.CgComponents.getNameGeneratorBy
60+ import org.utbot.framework.codegen.tree.CgComponents.getStatementConstructorBy
61+ import org.utbot.framework.codegen.tree.CgComponents.getTestFrameworkManagerBy
62+ import org.utbot.framework.codegen.tree.CgComponents.getVariableConstructorBy
63+ import org.utbot.framework.codegen.util.canBeReadFrom
5664import org.utbot.framework.codegen.util.canBeSetFrom
5765import org.utbot.framework.codegen.util.equalTo
5866import org.utbot.framework.codegen.util.inc
59- import org.utbot.framework.codegen.util.canBeReadFrom
6067import org.utbot.framework.codegen.util.length
6168import org.utbot.framework.codegen.util.lessThan
6269import org.utbot.framework.codegen.util.nullLiteral
@@ -67,10 +74,10 @@ import org.utbot.framework.plugin.api.BuiltinClassId
6774import org.utbot.framework.plugin.api.BuiltinMethodId
6875import org.utbot.framework.plugin.api.ClassId
6976import org.utbot.framework.plugin.api.CodegenLanguage
70- import org.utbot.framework.plugin.api.InstrumentedProcessDeathException
7177import org.utbot.framework.plugin.api.ConstructorId
7278import org.utbot.framework.plugin.api.ExecutableId
7379import org.utbot.framework.plugin.api.FieldId
80+ import org.utbot.framework.plugin.api.InstrumentedProcessDeathException
7481import org.utbot.framework.plugin.api.MethodId
7582import org.utbot.framework.plugin.api.TimeoutException
7683import org.utbot.framework.plugin.api.TypeParameters
@@ -83,79 +90,69 @@ import org.utbot.framework.plugin.api.UtDirectSetFieldModel
8390import org.utbot.framework.plugin.api.UtEnumConstantModel
8491import org.utbot.framework.plugin.api.UtExecution
8592import org.utbot.framework.plugin.api.UtExecutionFailure
93+ import org.utbot.framework.plugin.api.UtExecutionResult
8694import org.utbot.framework.plugin.api.UtExecutionSuccess
8795import org.utbot.framework.plugin.api.UtExplicitlyThrownException
8896import org.utbot.framework.plugin.api.UtLambdaModel
8997import org.utbot.framework.plugin.api.UtModel
9098import org.utbot.framework.plugin.api.UtNewInstanceInstrumentation
9199import org.utbot.framework.plugin.api.UtNullModel
100+ import org.utbot.framework.plugin.api.UtOverflowFailure
92101import org.utbot.framework.plugin.api.UtPrimitiveModel
93102import org.utbot.framework.plugin.api.UtReferenceModel
94103import org.utbot.framework.plugin.api.UtSandboxFailure
95104import org.utbot.framework.plugin.api.UtStaticMethodInstrumentation
105+ import org.utbot.framework.plugin.api.UtStreamConsumingFailure
96106import org.utbot.framework.plugin.api.UtSymbolicExecution
97107import org.utbot.framework.plugin.api.UtTimeoutException
98108import org.utbot.framework.plugin.api.UtVoidModel
99109import org.utbot.framework.plugin.api.isNotNull
100110import org.utbot.framework.plugin.api.isNull
101111import org.utbot.framework.plugin.api.onFailure
102112import org.utbot.framework.plugin.api.onSuccess
113+ import org.utbot.framework.plugin.api.util.allSuperTypes
114+ import org.utbot.framework.plugin.api.util.baseStreamClassId
103115import org.utbot.framework.plugin.api.util.doubleArrayClassId
104116import org.utbot.framework.plugin.api.util.doubleClassId
117+ import org.utbot.framework.plugin.api.util.doubleStreamClassId
118+ import org.utbot.framework.plugin.api.util.doubleStreamToArrayMethodId
105119import org.utbot.framework.plugin.api.util.doubleWrapperClassId
106120import org.utbot.framework.plugin.api.util.executable
107- import org.utbot.framework.plugin.api.util.jField
108121import org.utbot.framework.plugin.api.util.floatArrayClassId
109122import org.utbot.framework.plugin.api.util.floatClassId
110123import org.utbot.framework.plugin.api.util.floatWrapperClassId
111124import org.utbot.framework.plugin.api.util.hasField
112125import org.utbot.framework.plugin.api.util.id
113126import org.utbot.framework.plugin.api.util.intClassId
127+ import org.utbot.framework.plugin.api.util.intStreamClassId
128+ import org.utbot.framework.plugin.api.util.intStreamToArrayMethodId
114129import org.utbot.framework.plugin.api.util.isArray
130+ import org.utbot.framework.plugin.api.util.isInaccessibleViaReflection
115131import org.utbot.framework.plugin.api.util.isInnerClassEnclosingClassReference
116132import org.utbot.framework.plugin.api.util.isIterableOrMap
117133import org.utbot.framework.plugin.api.util.isPrimitive
118134import org.utbot.framework.plugin.api.util.isPrimitiveArray
119135import org.utbot.framework.plugin.api.util.isPrimitiveWrapper
120136import org.utbot.framework.plugin.api.util.isRefType
137+ import org.utbot.framework.plugin.api.util.isStatic
138+ import org.utbot.framework.plugin.api.util.isSubtypeOf
121139import org.utbot.framework.plugin.api.util.jClass
140+ import org.utbot.framework.plugin.api.util.jField
122141import org.utbot.framework.plugin.api.util.kClass
142+ import org.utbot.framework.plugin.api.util.longStreamClassId
143+ import org.utbot.framework.plugin.api.util.longStreamToArrayMethodId
123144import org.utbot.framework.plugin.api.util.objectArrayClassId
124145import org.utbot.framework.plugin.api.util.objectClassId
146+ import org.utbot.framework.plugin.api.util.streamClassId
147+ import org.utbot.framework.plugin.api.util.streamToArrayMethodId
125148import org.utbot.framework.plugin.api.util.stringClassId
126149import org.utbot.framework.plugin.api.util.voidClassId
127150import org.utbot.framework.plugin.api.util.wrapIfPrimitive
128- import org.utbot.framework.plugin.api.util.isInaccessibleViaReflection
129151import org.utbot.framework.util.isUnit
130152import org.utbot.summary.SummarySentenceConstants.TAB
131153import java.lang.reflect.InvocationTargetException
132- import java.security.AccessControlException
133154import java.lang.reflect.ParameterizedType
134- import org.utbot.framework.UtSettings
135- import org.utbot.framework.codegen.services.access.CgCallableAccessManager
136- import org.utbot.framework.codegen.services.access.CgFieldStateManagerImpl
137- import org.utbot.framework.codegen.services.framework.TestFrameworkManager
138- import org.utbot.framework.codegen.tree.CgTestClassConstructor.CgComponents.getCallableAccessManagerBy
139- import org.utbot.framework.codegen.tree.CgTestClassConstructor.CgComponents.getMockFrameworkManagerBy
140- import org.utbot.framework.codegen.tree.CgTestClassConstructor.CgComponents.getNameGeneratorBy
141- import org.utbot.framework.codegen.tree.CgTestClassConstructor.CgComponents.getStatementConstructorBy
142- import org.utbot.framework.codegen.tree.CgTestClassConstructor.CgComponents.getTestFrameworkManagerBy
143- import org.utbot.framework.codegen.tree.CgTestClassConstructor.CgComponents.getVariableConstructorBy
144- import org.utbot.framework.plugin.api.UtExecutionResult
145- import org.utbot.framework.plugin.api.UtOverflowFailure
146- import org.utbot.framework.plugin.api.UtStreamConsumingFailure
147- import org.utbot.framework.plugin.api.util.allSuperTypes
148- import org.utbot.framework.plugin.api.util.baseStreamClassId
149- import org.utbot.framework.plugin.api.util.doubleStreamClassId
150- import org.utbot.framework.plugin.api.util.doubleStreamToArrayMethodId
151- import org.utbot.framework.plugin.api.util.intStreamClassId
152- import org.utbot.framework.plugin.api.util.intStreamToArrayMethodId
153- import org.utbot.framework.plugin.api.util.isSubtypeOf
154- import org.utbot.framework.plugin.api.util.longStreamClassId
155- import org.utbot.framework.plugin.api.util.longStreamToArrayMethodId
156- import org.utbot.framework.plugin.api.util.streamClassId
157- import org.utbot.framework.plugin.api.util.streamToArrayMethodId
158- import org.utbot.framework.plugin.api.util.isStatic
155+ import java.security.AccessControlException
159156
160157private const val DEEP_EQUALS_MAX_DEPTH = 5 // TODO move it to plugin settings?
161158
0 commit comments