Skip to content

Commit f6d9667

Browse files
merge
1 parent 51ded78 commit f6d9667

File tree

25 files changed

+185
-170
lines changed

25 files changed

+185
-170
lines changed

utbot-core/src/main/kotlin/org/utbot/common/KClassUtil.kt

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ import java.lang.reflect.Method
88
* NOTE: vararg parameters must be passed as an array of the corresponding type.
99
*/
1010
fun Method.invokeCatching(obj: Any?, args: List<Any?>) = try {
11-
val invocation =
12-
try {
13-
invoke(obj, *args.toTypedArray())
14-
} catch (e: Throwable) {
15-
null
16-
}
11+
val invocation = invoke(obj, *args.toTypedArray())
12+
1713
Result.success(invocation)
1814
} catch (e: InvocationTargetException) {
1915
Result.failure<Nothing>(e.targetException)

utbot-framework-api/src/main/kotlin/org/utbot/framework/UtSettings.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ object UtSettings : AbstractSettings(logger, defaultKeyForSettingsPath, defaultS
240240
/**
241241
* Set to true to start fuzzing if symbolic execution haven't return anything
242242
*/
243-
var useFuzzing: Boolean by getBooleanProperty(false)
243+
var useFuzzing: Boolean by getBooleanProperty(true)
244244

245245
/**
246246
* Set to true to use grey-box fuzzing

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ data class UtArrayModel(
480480
* @param instantiationCall is an [UtExecutableCallModel] to instantiate represented object. It **must** not return `null`.
481481
* @param modificationsChain is a chain of [UtStatementModel] to construct object state.
482482
*/
483-
data class UtAssembleModel constructor(
483+
data class UtAssembleModel private constructor(
484484
override val id: Int?,
485485
override val classId: ClassId,
486486
override val modelName: String,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.utbot.common.currentThreadInfo
55
import org.utbot.framework.plugin.api.util.UtContext.Companion.setUtContext
66
import kotlin.coroutines.CoroutineContext
77
import kotlinx.coroutines.ThreadContextElement
8-
//import mu.KotlinLogging
8+
import mu.KotlinLogging
99

1010
val utContext: UtContext
1111
get() = UtContext.currentContext()
@@ -75,7 +75,7 @@ inline fun <T> withUtContext(context: UtContext, block: () -> T): T = setUtConte
7575
try {
7676
return@use block.invoke()
7777
} catch (e: Exception) {
78-
//KotlinLogging.logger("withUtContext").error { e }
78+
KotlinLogging.logger("withUtContext").error { e }
7979
throw e
8080
}
8181
}

utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/util/constructor/ValueConstructor.kt

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import org.utbot.framework.plugin.api.util.anyInstance
4242
import org.utbot.framework.plugin.api.util.constructLambda
4343
import org.utbot.framework.plugin.api.util.constructStaticLambda
4444
import org.utbot.framework.plugin.api.util.constructor
45-
import org.utbot.framework.plugin.api.util.id
4645
import org.utbot.framework.plugin.api.util.isStatic
4746
import org.utbot.framework.plugin.api.util.jClass
4847
import org.utbot.framework.plugin.api.util.jField

utbot-framework/build.gradle

-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ repositories {
66

77
configurations {
88
z3native
9-
fetchInstrumentationJar
109
}
1110

1211
dependencies {
@@ -36,10 +35,6 @@ dependencies {
3635
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlinLoggingVersion
3736
implementation group: 'org.jacoco', name: 'org.jacoco.report', version: jacocoVersion
3837
implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsTextVersion
39-
implementation "org.javaruntype:javaruntype:1.3"
40-
implementation "ru.vyarus:generics-resolver:3.0.3"
41-
implementation "ognl:ognl:3.3.2"
42-
4338
// we need this for construction mocks from composite models
4439
implementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
4540

@@ -51,7 +46,6 @@ dependencies {
5146
z3native group: 'com.microsoft.z3', name: 'z3-native-win64', version: z3Version, ext: 'zip'
5247
z3native group: 'com.microsoft.z3', name: 'z3-native-linux64', version: z3Version, ext: 'zip'
5348
z3native group: 'com.microsoft.z3', name: 'z3-native-osx', version: z3Version, ext: 'zip'
54-
fetchInstrumentationJar project(path: ':utbot-instrumentation', configuration:'instrumentationArchive')
5549
}
5650

5751
processResources {
@@ -60,7 +54,4 @@ processResources {
6054
into "lib/x64"
6155
}
6256
}
63-
from(configurations.fetchInstrumentationJar) {
64-
into "lib"
65-
}
6657
}

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

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import org.utbot.fuzzing.utils.Trie
4646
import org.utbot.greyboxfuzzer.GreyBoxFuzzer
4747
import org.utbot.greyboxfuzzer.util.FuzzerUtModelConstructor
4848
import org.utbot.instrumentation.ConcreteExecutor
49-
import ru.vyarus.java.generics.resolver.context.GenericsInfoFactory
5049
import org.utbot.instrumentation.instrumentation.execution.UtConcreteExecutionData
5150
import org.utbot.instrumentation.instrumentation.execution.UtConcreteExecutionResult
5251
import org.utbot.instrumentation.instrumentation.execution.UtExecutionInstrumentation

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/context/CgContext.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,8 @@ data class CgContext(
551551
}
552552
}
553553

554-
private var nestedClassIndex = 0
555554
private fun createClassIdForNestedClass(testClassModel: TestClassModel): ClassId {
556-
val simpleName = "${testClassModel.classUnderTest.simpleName}Test${nestedClassIndex++}"
555+
val simpleName = "${testClassModel.classUnderTest.simpleName}Test"
557556
return BuiltinClassId(
558557
canonicalName = currentTestClass.canonicalName + "." + simpleName,
559558
simpleName = simpleName,

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/models/CgElement.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class CgClass(
134134
val body: CgClassBody,
135135
val isStatic: Boolean,
136136
val isNested: Boolean,
137-
): CgStatement {
137+
): CgElement {
138138
val packageName
139139
get() = id.packageName
140140

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgAbstractRenderer.kt

+1-9
Original file line numberDiff line numberDiff line change
@@ -623,15 +623,7 @@ abstract class CgAbstractRenderer(
623623
is Boolean -> toStringConstant()
624624
// String is "\"" + "str" + "\"", RawString is "str"
625625
is String -> if (asRawString) "$this".escapeCharacters() else toStringConstant()
626-
else -> {
627-
val t = this@toStringConstant.type
628-
val illegalType = t.toString().contains("$") || !t.isPublic
629-
if (this == null && UtSettings.greyBoxFuzzingCompetitionMode && !illegalType) {
630-
"(${this@toStringConstant.type}) null"
631-
} else {
632-
"$this"
633-
}
634-
}
626+
else -> "$this"
635627
}
636628
}
637629

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/renderer/CgJavaRenderer.kt

-5
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,6 @@ internal class CgJavaRenderer(context: CgRendererContext, printer: CgPrinter = C
238238
renderExceptions(element)
239239
}
240240

241-
private fun getTypeStringRepresentation(typeId: ClassId): String =
242-
when {
243-
typeId.isArray -> getTypeStringRepresentation(typeId.elementClassId!!) + "[]"
244-
else -> typeId.toString()
245-
}
246241

247242
override fun renderMethodSignature(element: CgMockMethod) {
248243
val returnType = element.returnType.asString()

0 commit comments

Comments
 (0)