Skip to content

Commit bbb34cd

Browse files
minor fixes
1 parent 2bc68a0 commit bbb34cd

File tree

22 files changed

+75
-99
lines changed

22 files changed

+75
-99
lines changed

utbot-cli/src/main/kotlin/org/utbot/cli/GenerateTestsAbstractCommand.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,15 @@ abstract class GenerateTestsAbstractCommand(name: String, help: String) :
168168
sourceCodeFile: Path? = null,
169169
searchDirectory: Path,
170170
chosenClassesToMockAlways: Set<ClassId>
171-
): List<UtMethodTestSet> {
172-
return testCaseGenerator.generate(
171+
): List<UtMethodTestSet> =
172+
testCaseGenerator.generate(
173173
targetMethods,
174174
mockStrategy,
175175
chosenClassesToMockAlways,
176176
generationTimeout
177177
).map {
178178
if (sourceCodeFile != null) it.summarize(searchDirectory, sourceCodeFile.toFile()) else it
179179
}
180-
}
181180

182181

183182
protected fun withLogger(targetClassFqn: String, block: Runnable) {

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ object FileUtil {
9090

9191
for (clazz in classes) {
9292
val path = clazz.toClassFilePath()
93-
val resource =
94-
clazz.classLoader.getResource(path)
95-
?: ClassLoader.getSystemClassLoader().getResource(path)
96-
?: error("No such file: $path")
93+
val resource = clazz.classLoader.getResource(path) ?: error("No such file: $path")
9794

9895
if (resource.toURI().scheme == "jar") {
9996
val jarLocation = resource.toURI().extractJarName()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import java.lang.reflect.Method
99
*/
1010
fun Method.invokeCatching(obj: Any?, args: List<Any?>) = try {
1111
val invocation = invoke(obj, *args.toTypedArray())
12+
1213
Result.success(invocation)
1314
} catch (e: InvocationTargetException) {
1415
Result.failure<Nothing>(e.targetException)

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

Lines changed: 2 additions & 2 deletions
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
@@ -255,7 +255,7 @@ object UtSettings : AbstractSettings(logger, defaultKeyForSettingsPath, defaultS
255255
/**
256256
* Set to true to use UtCompositeModels in grey-box fuzzing process
257257
*/
258-
var useCompositeModelsInGreyBoxFuzzing: Boolean by getBooleanProperty(true)
258+
var useCompositeModelsInGreyBoxFuzzing: Boolean by getBooleanProperty(false)
259259

260260
/**
261261
* Set the total attempts to improve coverage by fuzzer.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.utbot.framework.plugin.api
22

3-
import org.utbot.framework.plugin.api.util.objectClassId
43
import org.utbot.framework.plugin.api.visible.UtStreamConsumingException
54
import java.io.File
65
import java.util.LinkedList

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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ dependencies {
3535
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlinLoggingVersion
3636
implementation group: 'org.jacoco', name: 'org.jacoco.report', version: jacocoVersion
3737
implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsTextVersion
38-
implementation "org.javaruntype:javaruntype:1.3"
39-
implementation "ru.vyarus:generics-resolver:3.0.3"
40-
implementation "ognl:ognl:3.3.2"
41-
4238
// we need this for construction mocks from composite models
4339
implementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
4440

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ import org.utbot.framework.UtSettings.pathSelectorStepsLimit
3232
import org.utbot.framework.UtSettings.pathSelectorType
3333
import org.utbot.framework.UtSettings.processUnknownStatesDuringConcreteExecution
3434
import org.utbot.framework.UtSettings.useDebugVisualization
35-
import org.utbot.framework.concrete.*
35+
import org.utbot.framework.concrete.UtConcreteExecutionData
36+
import org.utbot.framework.concrete.UtConcreteExecutionResult
37+
import org.utbot.framework.concrete.UtExecutionInstrumentation
3638
import org.utbot.framework.concrete.constructors.UtModelConstructor
39+
import org.utbot.framework.concrete.FuzzerConcreteExecutor
3740
import org.utbot.framework.plugin.api.*
3841
import org.utbot.framework.plugin.api.Step
3942
import org.utbot.framework.plugin.api.util.*
@@ -423,7 +426,6 @@ class UtBotSymbolicEngine(
423426
//Simple fuzzing
424427
fun greyBoxFuzzing(timeBudget: Long = Long.MAX_VALUE) =
425428
flow {
426-
GenericsInfoFactory.disableCache()
427429
val isFuzzable = methodUnderTest.parameters.all { classId ->
428430
classId != Method::class.java.id // causes the child process crash at invocation
429431
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import kotlinx.coroutines.flow.flattenConcat
66
import kotlinx.coroutines.flow.flowOf
77
import org.utbot.engine.UtBotSymbolicEngine
88
import org.utbot.framework.UtSettings
9-
import kotlin.io.path.Path
10-
import kotlin.io.path.appendText
119

1210
/**
1311
* Constructs [TestFlow] for customization and creates flow producer.

utbot-framework/src/main/kotlin/org/utbot/framework/util/SootUtils.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ import soot.jimple.JimpleBody
1616
import soot.options.Options
1717
import soot.toolkits.graph.ExceptionalUnitGraph
1818
import java.io.File
19-
import java.net.URI
20-
import java.nio.file.FileSystems
21-
import java.nio.file.Files
2219
import java.nio.file.Path
23-
import kotlin.io.path.absolutePathString
24-
import kotlin.streams.toList
2520

2621
object SootUtils {
2722
/**
@@ -136,6 +131,7 @@ val ExecutableId.sootMethod: SootMethod
136131
fun jimpleBody(method: ExecutableId): JimpleBody =
137132
method.sootMethod.jimpleBody()
138133

134+
139135
private fun addBasicClasses(vararg classes: Class<*>) {
140136
classes.forEach {
141137
Scene.v().addBasicClass(it.name, SootClass.BODIES)

0 commit comments

Comments
 (0)