Skip to content

Commit e041973

Browse files
committed
fix compile
#349
1 parent c12d032 commit e041973

File tree

20 files changed

+151
-205
lines changed

20 files changed

+151
-205
lines changed

utbot-analytics/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ dependencies {
2020
implementation project(":utbot-fuzzers")
2121
implementation project(":utbot-instrumentation")
2222
implementation project(":utbot-framework")
23-
implementation project(':utbot-instrumentation')
24-
implementation project(':utbot-summary')
2523
testImplementation project(':utbot-sample')
2624
testImplementation group: 'junit', name: 'junit', version: junit4_version
2725

utbot-framework/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ repositories {
1010
//noinspection GroovyAssignabilityCheck
1111
configurations {
1212
z3native
13-
fetchInstrumentationJar
1413
}
1514

1615
compileKotlin {
@@ -74,8 +73,6 @@ dependencies {
7473
z3native group: 'com.microsoft.z3', name: 'z3-native-win64', version: z3_version, ext: 'zip'
7574
z3native group: 'com.microsoft.z3', name: 'z3-native-linux64', version: z3_version, ext: 'zip'
7675
z3native group: 'com.microsoft.z3', name: 'z3-native-osx', version: z3_version, ext: 'zip'
77-
78-
fetchInstrumentationJar project(path: ':utbot-instrumentation', configuration:'instrumentationArchive')
7976
}
8077

8178
processResources {
@@ -84,9 +81,6 @@ processResources {
8481
into "lib/x64"
8582
}
8683
}
87-
from(configurations.fetchInstrumentationJar) {
88-
into "lib"
89-
}
9084
}
9185

9286
test {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import soot.*
2222
import java.awt.color.ICC_ProfileRGB
2323
import java.io.PrintStream
2424
import java.security.AccessControlContext
25+
import java.security.AccessControlException
2526
import java.util.concurrent.atomic.AtomicInteger
2627
import kotlin.math.max
2728
import kotlin.math.min

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,10 @@ import org.utbot.framework.concrete.UtConcreteExecutionResult
3333
import org.utbot.framework.concrete.UtExecutionInstrumentation
3434
import org.utbot.framework.plugin.api.*
3535
import org.utbot.framework.plugin.api.Step
36-
import org.utbot.framework.plugin.api.UtAssembleModel
37-
import org.utbot.framework.plugin.api.UtConcreteExecutionFailure
38-
import org.utbot.framework.plugin.api.UtError
39-
import org.utbot.framework.plugin.api.UtExecution
40-
import org.utbot.framework.plugin.api.UtInstrumentation
41-
import org.utbot.framework.plugin.api.UtMethod
42-
import org.utbot.framework.plugin.api.UtNullModel
43-
import org.utbot.framework.plugin.api.UtOverflowFailure
44-
import org.utbot.framework.plugin.api.UtResult
4536
import org.utbot.framework.plugin.api.util.*
4637
import org.utbot.framework.util.graph
4738
import org.utbot.framework.util.jimpleBody
4839
import org.utbot.fuzzer.*
49-
import org.utbot.fuzzer.names.MethodBasedNameSuggester
50-
import org.utbot.fuzzer.names.ModelBasedNameSuggester
5140
import org.utbot.fuzzer.providers.ObjectModelProvider
5241
import org.utbot.instrumentation.ConcreteExecutor
5342
import org.utbot.jcdb.api.ClassId

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/Domain.kt

Lines changed: 104 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ package org.utbot.framework.codegen
33
import org.utbot.framework.DEFAULT_CONCRETE_EXECUTION_TIMEOUT_IN_CHILD_PROCESS_MS
44
import org.utbot.framework.codegen.model.constructor.builtin.mockitoClassId
55
import org.utbot.framework.codegen.model.constructor.builtin.ongoingStubbingClassId
6+
import org.utbot.framework.codegen.model.constructor.util.argumentsClassId
7+
import org.utbot.framework.codegen.model.tree.CgClassType
8+
import org.utbot.framework.codegen.model.tree.TypeParameters
9+
import org.utbot.framework.codegen.model.tree.type
610
import org.utbot.framework.plugin.api.*
711
import org.utbot.framework.plugin.api.util.*
812
import org.utbot.jcdb.api.ClassId
@@ -103,29 +107,33 @@ object MockitoStaticMocking : StaticsMocking(displayName = "Mockito static mocki
103107

104108
val mockedStaticClassId get() = builtInClass(name = "org.mockito.MockedStatic")
105109

106-
val mockedConstructionClassId: ClassId get() {
107-
return builtInClass(name = "org.mockito.MockedConstruction")
108-
}
110+
val mockedConstructionClassId: ClassId
111+
get() {
112+
return builtInClass(name = "org.mockito.MockedConstruction")
113+
}
109114

110-
val mockStaticMethodId get() = mockitoClassId.newBuiltinStaticMethodId(
111-
name = "mockStatic",
112-
returnType = mockedStaticClassId,
113-
arguments = listOf(objectClassId)
114-
)
115+
val mockStaticMethodId
116+
get() = mockitoClassId.newBuiltinStaticMethodId(
117+
name = "mockStatic",
118+
returnType = mockedStaticClassId,
119+
arguments = listOf(objectClassId)
120+
)
115121

116-
val mockConstructionMethodId get() = mockitoClassId.newBuiltinStaticMethodId(
117-
name = "mockConstruction",
118-
returnType = mockedConstructionClassId,
119-
// actually second argument is lambda
120-
arguments = listOf(objectClassId, objectClassId)
121-
)
122+
val mockConstructionMethodId
123+
get() = mockitoClassId.newBuiltinStaticMethodId(
124+
name = "mockConstruction",
125+
returnType = mockedConstructionClassId,
126+
// actually second argument is lambda
127+
arguments = listOf(objectClassId, objectClassId)
128+
)
122129

123-
val mockedStaticWhen get() = mockedStaticClassId.newBuiltinMethod(
124-
name = "when",
125-
returnType = ongoingStubbingClassId,
126-
// argument type is actually a functional interface
127-
arguments = listOf(objectClassId)
128-
)
130+
val mockedStaticWhen
131+
get() = mockedStaticClassId.newBuiltinMethod(
132+
name = "when",
133+
returnType = ongoingStubbingClassId,
134+
// argument type is actually a functional interface
135+
arguments = listOf(objectClassId)
136+
)
129137

130138
fun mockedStaticWhen(nullable: Boolean): MethodId = mockedStaticClassId.newBuiltinMethod(
131139
name = "when",
@@ -153,7 +161,7 @@ sealed class TestFramework(
153161
abstract val methodSourceAnnotationId: ClassId
154162
abstract val methodSourceAnnotationFqn: String
155163
abstract val nestedClassesShouldBeStatic: Boolean
156-
abstract val argListClassId: ClassId
164+
abstract val argListClassId: CgClassType
157165

158166
val assertEquals by lazy { assertionId("assertEquals", objectClassId, objectClassId) }
159167

@@ -163,7 +171,13 @@ sealed class TestFramework(
163171

164172
val assertArrayEquals by lazy { arrayAssertionId("assertArrayEquals", Array<Any>::class.id, Array<Any>::class.id) }
165173

166-
open val assertBooleanArrayEquals by lazy { assertionId("assertArrayEquals", booleanArrayClassId, booleanArrayClassId) }
174+
open val assertBooleanArrayEquals by lazy {
175+
assertionId(
176+
"assertArrayEquals",
177+
booleanArrayClassId,
178+
booleanArrayClassId
179+
)
180+
}
167181

168182
val assertByteArrayEquals by lazy { arrayAssertionId("assertArrayEquals", byteArrayClassId, byteArrayClassId) }
169183

@@ -175,9 +189,23 @@ sealed class TestFramework(
175189

176190
val assertLongArrayEquals by lazy { arrayAssertionId("assertArrayEquals", longArrayClassId, longArrayClassId) }
177191

178-
val assertFloatArrayEquals by lazy { arrayAssertionId("assertArrayEquals", floatArrayClassId, floatArrayClassId, floatClassId) }
192+
val assertFloatArrayEquals by lazy {
193+
arrayAssertionId(
194+
"assertArrayEquals",
195+
floatArrayClassId,
196+
floatArrayClassId,
197+
floatClassId
198+
)
199+
}
179200

180-
val assertDoubleArrayEquals by lazy { arrayAssertionId("assertArrayEquals", doubleArrayClassId, doubleArrayClassId, doubleClassId) }
201+
val assertDoubleArrayEquals by lazy {
202+
arrayAssertionId(
203+
"assertArrayEquals",
204+
doubleArrayClassId,
205+
doubleArrayClassId,
206+
doubleClassId
207+
)
208+
}
181209

182210
val assertNull by lazy { assertionId("assertNull", objectClassId) }
183211

@@ -228,19 +256,25 @@ object TestNg : TestFramework(displayName = "TestNG") {
228256

229257
override val arraysAssertionsClass: ClassId get() = builtInClass(TEST_NG_ARRAYS_ASSERTIONS)
230258

231-
override val assertBooleanArrayEquals: MethodId get() = assertionId("assertEquals", booleanArrayClassId, booleanArrayClassId)
259+
override val assertBooleanArrayEquals: MethodId
260+
get() = assertionId(
261+
"assertEquals",
262+
booleanArrayClassId,
263+
booleanArrayClassId
264+
)
232265

233266
val throwingRunnableClassId get() = builtInClass("${assertionsClass.name}\$ThrowingRunnable")
234267

235-
val assertThrows get() = assertionsClass.newBuiltinStaticMethodId(
236-
name = "assertThrows",
237-
// TODO: actually the return type is 'T extends java.lang.Throwable'
238-
returnType = java.lang.Throwable::class.id,
239-
arguments = listOf(
240-
Class::class.id,
241-
throwingRunnableClassId
268+
val assertThrows
269+
get() = assertionsClass.newBuiltinStaticMethodId(
270+
name = "assertThrows",
271+
// TODO: actually the return type is 'T extends java.lang.Throwable'
272+
returnType = java.lang.Throwable::class.id,
273+
arguments = listOf(
274+
Class::class.id,
275+
throwingRunnableClassId
276+
)
242277
)
243-
)
244278

245279
override val testAnnotationId: ClassId get() = builtInClass("$mainPackage.annotations.Test")
246280

@@ -250,25 +284,15 @@ object TestNg : TestFramework(displayName = "TestNG") {
250284

251285
override val nestedClassesShouldBeStatic = true
252286

253-
override val argListClassId: ClassId
287+
override val argListClassId: CgClassType
254288
get() {
255-
val outerArrayId = Array<Array<Any?>?>::class.id
256-
val innerArrayId = BuiltinClassId(
257-
name = objectArrayClassId.name,
258-
simpleName = objectArrayClassId.simpleName,
259-
canonicalName = objectArrayClassId.canonicalName,
260-
packageName = objectArrayClassId.packageName,
261-
elementClassId = objectClassId,
262-
typeParameters = TypeParameters(listOf(objectClassId))
263-
)
264-
265-
return BuiltinClassId(
266-
name = outerArrayId.name,
267-
simpleName = outerArrayId.simpleName,
268-
canonicalName = outerArrayId.canonicalName,
269-
packageName = outerArrayId.packageName,
270-
elementClassId = innerArrayId,
271-
typeParameters = TypeParameters(listOf(innerArrayId))
289+
return type<Array<Any>>(
290+
isNullable = true,
291+
TypeParameters(
292+
listOf(
293+
type<Array<Any>>(isNullable = true, TypeParameters(listOf(type<Any>())))
294+
)
295+
)
272296
)
273297
}
274298

@@ -345,15 +369,11 @@ object Junit4 : TestFramework("JUnit4") {
345369

346370
val ignoreAnnotationClassId get() = builtInClass("$JUNIT4_PACKAGE.Ignore")
347371

348-
val enclosedClassId = BuiltinClassId(
349-
name = "org.junit.experimental.runners.Enclosed",
350-
canonicalName = "org.junit.experimental.runners.Enclosed",
351-
simpleName = "Enclosed"
352-
)
372+
val enclosedClassId get() = builtInClass("org.junit.experimental.runners.Enclosed")
353373

354374
override val nestedClassesShouldBeStatic = true
355375

356-
override val argListClassId: ClassId
376+
override val argListClassId: CgClassType
357377
get() = parametrizedTestsNotSupportedError
358378

359379
@OptIn(ExperimentalStdlibApi::class)
@@ -384,21 +404,18 @@ object Junit5 : TestFramework("JUnit5") {
384404

385405
val timeoutClassId get() = builtInClass("$JUNIT5_PACKAGE.Timeout")
386406

387-
val timeunitClassId get() = builtInClass("TimeUnit")
407+
val timeunitClassId get() = builtInClass("TimeUnit")
388408

389409
val durationClassId get() = builtInClass("java.time.Duration")
390410

391-
val ofMillis get() = durationClassId.newBuiltinStaticMethodId(
392-
name = "ofMillis",
393-
returnType = durationClassId,
394-
arguments = listOf(longClassId)
395-
)
411+
val ofMillis
412+
get() = durationClassId.newBuiltinStaticMethodId(
413+
name = "ofMillis",
414+
returnType = durationClassId,
415+
arguments = listOf(longClassId)
416+
)
396417

397-
val nestedTestClassAnnotationId = BuiltinClassId(
398-
name = "$JUNIT5_PACKAGE.Nested",
399-
canonicalName = "$JUNIT5_PACKAGE.Nested",
400-
simpleName = "Nested"
401-
)
418+
val nestedTestClassAnnotationId get() = builtInClass("$JUNIT5_PACKAGE.Nested", isNested = true)
402419

403420
override val testAnnotationId get() = builtInClass("$JUNIT5_PACKAGE.Test")
404421

@@ -410,41 +427,36 @@ object Junit5 : TestFramework("JUnit5") {
410427

411428
override val arraysAssertionsClass get() = assertionsClass
412429

413-
val assertThrows get() = assertionsClass.newBuiltinStaticMethodId(
414-
name = "assertThrows",
415-
// TODO: actually the return type is 'T extends java.lang.Throwable'
416-
returnType = java.lang.Throwable::class.id,
417-
arguments = listOf(
418-
Class::class.id,
419-
executableClassId
430+
val assertThrows
431+
get() = assertionsClass.newBuiltinStaticMethodId(
432+
name = "assertThrows",
433+
// TODO: actually the return type is 'T extends java.lang.Throwable'
434+
returnType = java.lang.Throwable::class.id,
435+
arguments = listOf(
436+
Class::class.id,
437+
executableClassId
438+
)
420439
)
421-
)
422440

423-
val assertTimeoutPreemptively get() = assertionsClass.newBuiltinStaticMethodId(
424-
name = "assertTimeoutPreemptively",
425-
returnType = voidWrapperClassId,
426-
arguments = listOf(
427-
durationClassId,
428-
executableClassId
441+
val assertTimeoutPreemptively
442+
get() = assertionsClass.newBuiltinStaticMethodId(
443+
name = "assertTimeoutPreemptively",
444+
returnType = voidWrapperClassId,
445+
arguments = listOf(
446+
durationClassId,
447+
executableClassId
448+
)
429449
)
430-
)
431450

432451
val displayNameClassId get() = builtInClass("$JUNIT5_PACKAGE.DisplayName")
433452

434453
val disabledAnnotationClassId get() = builtInClass("$JUNIT5_PACKAGE.Disabled")
435454

436455
override val nestedClassesShouldBeStatic = false
437456

438-
override val argListClassId: ClassId
457+
override val argListClassId: CgClassType
439458
get() {
440-
val arrayListId = java.util.ArrayList::class.id
441-
return BuiltinClassId(
442-
name = arrayListId.name,
443-
simpleName = arrayListId.simpleName,
444-
canonicalName = arrayListId.canonicalName,
445-
packageName = arrayListId.packageName,
446-
typeParameters = TypeParameters(listOf(argumentsClassId))
447-
)
459+
return type<java.util.ArrayList<Any>>(parameters = TypeParameters(listOf(argumentsClassId.type(true))))
448460
}
449461

450462
private const val junitVersion = "1.9.0" // TODO read it from gradle.properties

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/CodeGenerator.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.utbot.framework.codegen.model
22

33
import org.utbot.framework.codegen.*
44
import org.utbot.framework.codegen.model.constructor.CgMethodTestSet
5+
import org.utbot.framework.codegen.model.constructor.TestClassModel
56
import org.utbot.framework.codegen.model.constructor.context.CgContext
67
import org.utbot.framework.codegen.model.constructor.tree.CgTestClassConstructor
78
import org.utbot.framework.codegen.model.constructor.tree.TestsGenerationReport

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/CgMethodTestSet.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package org.utbot.framework.codegen.model.constructor
33
import org.utbot.framework.plugin.api.*
44
import org.utbot.framework.plugin.api.util.executableId
55
import org.utbot.framework.plugin.api.util.objectClassId
6+
import org.utbot.framework.plugin.api.util.voidClassId
67
import org.utbot.jcdb.api.ClassId
8+
import org.utbot.jcdb.api.FieldId
79
import soot.jimple.JimpleBody
810

911
data class CgMethodTestSet private constructor(

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/TestClassContext.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package org.utbot.framework.codegen.model.constructor
33
import org.utbot.framework.codegen.model.constructor.context.CgContextOwner
44
import org.utbot.framework.codegen.model.tree.CgAnnotation
55
import org.utbot.framework.codegen.model.tree.CgMethod
6-
import org.utbot.framework.plugin.api.ClassId
76
import org.utbot.framework.codegen.model.tree.CgTestClass
7+
import org.utbot.jcdb.api.ClassId
88

99
/**
1010
* This class stores context information needed to build [CgTestClass].

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/TestClassModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.utbot.framework.codegen.model.constructor
22

3-
import org.utbot.framework.plugin.api.ClassId
43
import org.utbot.framework.plugin.api.util.enclosingClass
4+
import org.utbot.jcdb.api.ClassId
55

66
// TODO: seems like this class needs to be renamed
77
/**

0 commit comments

Comments
 (0)