move the test to a different package, to make sure it will run as part of regular IDEA tests

This commit is contained in:
Dmitry Jemerov
2011-04-13 17:10:36 +02:00
parent 6747bd7e13
commit a04e605f45

View File

@@ -0,0 +1,49 @@
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;
import com.jetbrains.python.PythonTestUtil;
import junit.framework.Assert;
/**
* @author yole
*/
@TestDataPath("$CONTENT_ROOT/../testData/resolve/pyToJava/")
public class PyToJavaResolveTest extends ResolveTestCase {
private PsiElement resolve() throws Exception {
PsiReference ref = configureByFile(getTestName(false) + ".py");
return ref.resolve();
}
public void testSimple() throws Exception {
PsiElement target = resolve();
Assert.assertTrue(target instanceof PsiClass);
Assert.assertEquals("java.util.ArrayList", ((PsiClass) target).getQualifiedName());
}
public void testMethod() throws Exception {
PsiElement target = resolve();
Assert.assertTrue(target instanceof PsiMethod);
Assert.assertEquals("java.util.ArrayList", ((PsiMethod) target).getContainingClass().getQualifiedName());
}
public void testField() throws Exception {
PsiElement target = resolve();
Assert.assertTrue(target instanceof PsiField);
Assert.assertEquals("java.lang.System", ((PsiField) target).getContainingClass().getQualifiedName());
}
public void testReturnValue() throws Exception {
PsiElement target = resolve();
Assert.assertTrue(target instanceof PsiMethod);
Assert.assertEquals("java.util.List", ((PsiMethod) target).getContainingClass().getQualifiedName());
}
@Override
protected String getTestDataPath() {
return PythonTestUtil.getTestDataPath() + "/resolve/pyToJava/";
}
}