mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
chenge signature on params list|args list (IDEADEV-41565)
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* User: anna
|
||||
* Date: 25-Nov-2009
|
||||
*/
|
||||
package com.intellij.refactoring;
|
||||
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.psi.PsiMember;
|
||||
import com.intellij.refactoring.changeSignature.ChangeSignatureTargetUtil;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class ChangeSignatureTargetTest extends LightCodeInsightTestCase {
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return JavaTestUtil.getJavaTestDataPath();
|
||||
}
|
||||
|
||||
public void testInMethodParameters() throws Exception {
|
||||
doTest("foo");
|
||||
}
|
||||
|
||||
public void testInMethodArguments() throws Exception {
|
||||
doTest("foo");
|
||||
}
|
||||
|
||||
public void testInClassTypeParameters() throws Exception {
|
||||
doTest("A1");
|
||||
}
|
||||
|
||||
public void testInTypeArguments() throws Exception {
|
||||
doTest("A1");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Sdk getProjectJDK() {
|
||||
return JavaSdkImpl.getMockJdk15("java 1.5");
|
||||
}
|
||||
|
||||
private void doTest(String expectedMemberName) throws Exception {
|
||||
String basePath = "/refactoring/changeSignatureTarget/" + getTestName(false);
|
||||
@NonNls final String filePath = basePath + ".java";
|
||||
configureByFile(filePath);
|
||||
final PsiMember member = ChangeSignatureTargetUtil.findTargetMember(getFile(), getEditor());
|
||||
assertNotNull(member);
|
||||
assertEquals(expectedMemberName, member.getName());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user