mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
extract Java-related tests to a separate module
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/pluginTestSrc">
|
||||
<sourceFolder url="file://$MODULE_DIR$/pluginTestSrc" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="testFramework-java" />
|
||||
<orderEntry type="library" name="JUnit3" level="project" />
|
||||
<orderEntry type="module" module-name="java-impl" />
|
||||
<orderEntry type="module" module-name="python-tests" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.jetbrains.python;
|
||||
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.testFramework.ResolveTestCase;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class PyToJavaResolveTest extends ResolveTestCase {
|
||||
protected Sdk getTestProjectJdk() {
|
||||
return JavaSdkImpl.getMockJdk15("java 1.5");
|
||||
}
|
||||
|
||||
private PsiElement resolve() throws Exception {
|
||||
PsiReference ref = configureByFile(getTestName(false) + ".py");
|
||||
return ref.resolve();
|
||||
}
|
||||
|
||||
public void testSimple() throws Exception {
|
||||
PsiElement target = resolve();
|
||||
assertTrue(target instanceof PsiClass);
|
||||
assertEquals("java.util.ArrayList", ((PsiClass) target).getQualifiedName());
|
||||
}
|
||||
|
||||
public void testMethod() throws Exception {
|
||||
PsiElement target = resolve();
|
||||
assertTrue(target instanceof PsiMethod);
|
||||
assertEquals("java.util.ArrayList", ((PsiMethod) target).getContainingClass().getQualifiedName());
|
||||
}
|
||||
|
||||
public void testField() throws Exception {
|
||||
PsiElement target = resolve();
|
||||
assertTrue(target instanceof PsiField);
|
||||
assertEquals("java.lang.System", ((PsiField) target).getContainingClass().getQualifiedName());
|
||||
}
|
||||
|
||||
public void testReturnValue() throws Exception {
|
||||
PsiElement target = resolve();
|
||||
assertTrue(target instanceof PsiMethod);
|
||||
assertEquals("java.util.List", ((PsiMethod) target).getContainingClass().getQualifiedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PythonTestUtil.getTestDataPath() + "/resolve/pyToJava/";
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ public class PythonAllTestsSuite {
|
||||
PyResolveTest.class,
|
||||
PyMultiFileResolveTest.class,
|
||||
PyResolveCalleeTest.class,
|
||||
PyToJavaResolveTest.class,
|
||||
PyAssignmentMappingTest.class,
|
||||
PythonCompletionTest.class,
|
||||
PyInheritorsSearchTest.class,
|
||||
@@ -30,6 +29,7 @@ public class PythonAllTestsSuite {
|
||||
PythonDemorganLawIntentionTest.class,
|
||||
PyQuickFixTest.class,
|
||||
PySelectWordTest.class,
|
||||
PySurroundWithTest.class
|
||||
};
|
||||
|
||||
public static TestSuite suite() {
|
||||
|
||||
Reference in New Issue
Block a user