Skip to content

Commit 9329c1d

Browse files
Fix UtBotJavaApiTest
1 parent 5c21f15 commit 9329c1d

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

utbot-framework-test/src/main/java/org/utbot/examples/manual/KotlinWrappers.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
package org.utbot.examples.manual
22

3-
import org.utbot.common.FileUtil
43
import org.utbot.framework.plugin.api.ClassId
54
import org.utbot.framework.plugin.api.FieldId
65
import org.utbot.framework.plugin.api.UtModel
76
import org.utbot.framework.plugin.api.UtPrimitiveModel
8-
import java.nio.file.Path
97

108
object SootUtils {
119
@JvmStatic
1210
fun runSoot(clazz: Class<*>) {
13-
val buildDir = FileUtil.locateClassPath(clazz.kotlin) ?: FileUtil.isolateClassFiles(clazz.kotlin)
14-
val buildDirPath = buildDir.toPath()
15-
16-
if (buildDirPath != previousBuildDir) {
17-
org.utbot.framework.util.runSoot(buildDirPath, null)
18-
previousBuildDir = buildDirPath
19-
}
11+
org.utbot.framework.SootUtils.runSoot(clazz.kotlin)
2012
}
21-
22-
private var previousBuildDir: Path? = null
2313
}
2414

2515
fun fields(

utbot-framework-test/src/test/kotlin/org/utbot/examples/manual/UtBotJavaApiTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@
3131
import java.lang.reflect.Method;
3232
import java.net.URISyntaxException;
3333
import java.net.URL;
34-
import java.util.*;
34+
import java.net.URLClassLoader;
35+
import java.util.Arrays;
36+
import java.util.Collections;
37+
import java.util.HashMap;
38+
import java.util.IdentityHashMap;
39+
import java.util.List;
40+
import java.util.Map;
3541
import java.util.stream.Collectors;
3642

3743
import static org.utbot.external.api.UtModelFactoryKt.classIdForType;
@@ -60,7 +66,6 @@ public class UtBotJavaApiTest {
6066

6167
@BeforeEach
6268
public void setUp() {
63-
SootUtils.runSoot(PrimitiveFields.class);
6469
context = UtContext.Companion.setUtContext(new UtContext(PrimitiveFields.class.getClassLoader()));
6570
modelFactory = new UtModelFactory();
6671
}
@@ -1221,6 +1226,7 @@ public void testOnObjectWithArrayOfComplexArrays() {
12211226

12221227
@Test
12231228
public void testFuzzingSimple() {
1229+
SootUtils.runSoot(StringSwitchExample.class);
12241230
UtBotJavaApi.setStopConcreteExecutorOnExit(false);
12251231

12261232
String classpath = getClassPath(StringSwitchExample.class);

0 commit comments

Comments
 (0)