-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test case for incomplete Superclasses
- Loading branch information
1 parent
1ec5b12
commit 32f856e
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...t/java/sootup/tests/typehierarchy/viewtypehierarchytestcase/IncompleteSuperclassTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package sootup.tests.typehierarchy.viewtypehierarchytestcase; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertFalse; | ||
import static sootup.core.util.ImmutableUtils.immutableList; | ||
|
||
import categories.Java8Test; | ||
import com.google.common.collect.ImmutableList; | ||
import java.util.List; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
import sootup.core.typehierarchy.ViewTypeHierarchy; | ||
import sootup.core.types.ClassType; | ||
import sootup.tests.typehierarchy.JavaTypeHierarchyTestBase; | ||
|
||
/** @author Jonas Klauke * */ | ||
@Category(Java8Test.class) | ||
public class IncompleteSuperclassTest extends JavaTypeHierarchyTestBase { | ||
@Test | ||
public void method() { | ||
ViewTypeHierarchy typeHierarchy = | ||
(ViewTypeHierarchy) customTestWatcher.getView().getTypeHierarchy(); | ||
List<ClassType> superclasses = | ||
typeHierarchy.incompleteSuperClassesOf(getClassType("SubClassB")); | ||
ClassType object = getClassType("java.lang.Object"); | ||
ImmutableList<ClassType> expectedSuperClasses = | ||
immutableList(getClassType("SubClassA"), object); | ||
assertEquals(expectedSuperClasses, superclasses); | ||
assertFalse(customTestWatcher.getView().getClass(object).isPresent()); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
sootup.tests/src/test/resources/javatypehierarchy/IncompleteSuperclass/SubClassA.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
public class SubClassA { | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
sootup.tests/src/test/resources/javatypehierarchy/IncompleteSuperclass/SubClassB.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
public class SubClassB extends SubClassA { | ||
|
||
} |