mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
restore resolve from Python to Java, introduce Java package type
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package com.jetbrains.jython;
|
||||
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.testFramework.ResolveTestCase;
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
@@ -42,6 +40,24 @@ public class PyToJavaResolveTest extends ResolveTestCase {
|
||||
Assert.assertEquals("java.util.List", ((PsiMethod) target).getContainingClass().getQualifiedName());
|
||||
}
|
||||
|
||||
public void testPackageType() throws Exception {
|
||||
PsiElement target = resolve();
|
||||
Assert.assertTrue(target instanceof PsiClass);
|
||||
Assert.assertEquals("java.util.ArrayList", ((PsiClass) target).getQualifiedName());
|
||||
}
|
||||
|
||||
public void testJavaPackage() throws Exception {
|
||||
PsiElement target = resolve();
|
||||
Assert.assertTrue(target instanceof PsiPackage);
|
||||
Assert.assertEquals("java", ((PsiPackage) target).getQualifiedName());
|
||||
}
|
||||
|
||||
public void testJavaLangPackage() throws Exception {
|
||||
PsiElement target = resolve();
|
||||
Assert.assertTrue(target instanceof PsiPackage);
|
||||
Assert.assertEquals("java.lang", ((PsiPackage) target).getQualifiedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PythonTestUtil.getTestDataPath() + "/resolve/pyToJava/";
|
||||
|
||||
Reference in New Issue
Block a user