chenge signature on params list|args list (IDEADEV-41565)

This commit is contained in:
anna
2009-11-25 23:05:37 +03:00
parent bdcb11f17f
commit 012a0923b2
8 changed files with 197 additions and 21 deletions
@@ -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());
}
}