Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e6accca

Browse files
committedDec 28, 2022
Global refactorings
1 parent 1eba966 commit e6accca

File tree

198 files changed

+1629
-1932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+1629
-1932
lines changed
 

‎settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ include("utbot-intellij")
2323
include("utbot-sample")
2424
include("utbot-fuzzers")
2525
include("utbot-fuzzing")
26+
include("utbot-greyboxfuzzer")
2627
include("utbot-junit-contest")
2728
include("utbot-analytics")
2829
include("utbot-analytics-torch")

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import java.nio.file.Path
3939
import java.nio.file.Paths
4040
import java.time.LocalDateTime
4141
import java.time.temporal.ChronoUnit
42-
import org.utbot.engine.greyboxfuzzer.util.CustomClassLoader
4342

4443
private const val LONG_GENERATION_TIMEOUT = 1_200_000L
4544

@@ -145,11 +144,16 @@ abstract class GenerateTestsAbstractCommand(name: String, help: String) :
145144
val classRelativePath = classFqnToPath(classFqn) + ".class"
146145
val classAbsoluteURL = classLoader.getResource(classRelativePath) ?: return null
147146
val classAbsolutePath =
148-
if (classAbsoluteURL.toURI().scheme == "jar") {
149-
replaceSeparator(classAbsoluteURL.file.removePrefix("file:"))
150-
.removeSuffix(classRelativePath)
151-
.removeSuffix("/")
152-
.removeSuffix("!")
147+
if (UtSettings.useGreyBoxFuzzing) {
148+
if (classAbsoluteURL.toURI().scheme == "jar") {
149+
replaceSeparator(classAbsoluteURL.file.removePrefix("file:"))
150+
.removeSuffix(classRelativePath)
151+
.removeSuffix("/")
152+
.removeSuffix("!")
153+
} else {
154+
replaceSeparator(classAbsoluteURL.toPath().toString())
155+
.removeSuffix(classRelativePath)
156+
}
153157
} else {
154158
replaceSeparator(classAbsoluteURL.toPath().toString())
155159
.removeSuffix(classRelativePath)
@@ -164,7 +168,6 @@ abstract class GenerateTestsAbstractCommand(name: String, help: String) :
164168
searchDirectory: Path,
165169
chosenClassesToMockAlways: Set<ClassId>
166170
): List<UtMethodTestSet> {
167-
CustomClassLoader.classLoader = classLoader
168171
return testCaseGenerator.generate(
169172
targetMethods,
170173
mockStrategy,

0 commit comments

Comments
 (0)