use of org.jetbrains.kotlin.psi.stubs.KotlinClassStub in project kotlin by JetBrains.
the class KotlinStubsTest method testSuperclassNames.
public void testSuperclassNames() {
PsiFile psiFile = myFixture.configureByText("foo.kt", "import java.util.ArrayList as alist\nclass C(): alist() { }");
List<KtDeclaration> declarations = ((KtFile) psiFile).getDeclarations();
KtClass ktClass = (KtClass) declarations.get(0);
KotlinClassStub stub = KtStubElementTypes.CLASS.createStub(ktClass, null);
List<String> names = stub.getSuperNames();
assertSameElements(names, "ArrayList", "alist");
}
use of org.jetbrains.kotlin.psi.stubs.KotlinClassStub in project kotlin by JetBrains.
the class KotlinStubsTest method testClassIsTrait.
public void testClassIsTrait() {
PsiFile psiFile = myFixture.configureByText("foo.kt", "interface Test { }");
List<KtDeclaration> declarations = ((KtFile) psiFile).getDeclarations();
KtClass ktClass = (KtClass) declarations.get(0);
KotlinClassStub stub = KtStubElementTypes.CLASS.createStub(ktClass, null);
assertEquals(true, stub.isInterface());
}
Aggregations