File tree Expand file tree Collapse file tree 3 files changed +44
-6
lines changed
utbot-framework-test/src/test/kotlin/org/utbot/examples/mixed
utbot-framework/src/main/kotlin/org/utbot/engine
utbot-sample/src/main/java/org/utbot/examples/mixed Expand file tree Collapse file tree 3 files changed +44
-6
lines changed Original file line number Diff line number Diff line change 1+ package org.utbot.examples.mixed
2+
3+ import org.junit.jupiter.api.Test
4+ import org.utbot.framework.plugin.api.CodegenLanguage
5+ import org.utbot.testcheckers.eq
6+ import org.utbot.testing.DoNotCalculate
7+ import org.utbot.testing.UtValueTestCaseChecker
8+
9+ internal class SerializableExampleTest : UtValueTestCaseChecker (testClass = SerializableExample : :class) {
10+
11+ @Test
12+ fun testExample () {
13+ check(
14+ SerializableExample ::example,
15+ eq(1 ),
16+ )
17+ }
18+ }
Original file line number Diff line number Diff line change 11package org.utbot.engine
22
3+ import org.utbot.engine.types.OBJECT_TYPE
34import org.utbot.engine.types.TypeRegistry
45import org.utbot.framework.plugin.api.ClassId
56import org.utbot.framework.plugin.api.id
@@ -54,14 +55,20 @@ class Hierarchy(private val typeRegistry: TypeRegistry) {
5455
5556private fun findAncestors (id : ClassId ) =
5657 with (Scene .v().getSootClass(id.name)) {
57- if (this .isInterface) {
58- Scene .v().activeHierarchy.getSuperinterfacesOfIncluding(this )
58+ val superClasses = mutableListOf<SootClass >()
59+ val superInterfaces = mutableListOf<SootClass >()
60+
61+ if (isInterface) {
62+ superClasses + = OBJECT_TYPE .sootClass
63+ superInterfaces + = Scene .v().activeHierarchy.getSuperinterfacesOfIncluding(this )
5964 } else {
60- Scene .v().activeHierarchy.getSuperclassesOfIncluding(this ) +
61- this .interfaces.flatMap {
62- Scene .v().activeHierarchy.getSuperinterfacesOfIncluding(it)
63- }
65+ superClasses + = Scene .v().activeHierarchy.getSuperclassesOfIncluding(this )
66+ superInterfaces + = superClasses
67+ .flatMap { it.interfaces }
68+ .flatMap { Scene .v().activeHierarchy.getSuperinterfacesOfIncluding(it) }
6469 }
70+
71+ superClasses + superInterfaces
6572 }
6673
6774private fun findInheritors (id : ClassId ) =
Original file line number Diff line number Diff line change 1+ package org .utbot .examples .mixed ;
2+
3+ import java .io .File ;
4+
5+ public class SerializableExample {
6+ public void example () {
7+ join ("string" , File .separator , System .currentTimeMillis ());
8+ }
9+
10+ public static <T > String join (T ... elements ) {
11+ return null ;
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments