5 package com.intellij.refactoring;
7 import com.intellij.JavaTestUtil;
8 import com.intellij.openapi.projectRoots.Sdk;
9 import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
10 import com.intellij.psi.PsiElement;
11 import com.intellij.psi.PsiMember;
12 import com.intellij.refactoring.changeSignature.JavaChangeSignatureHandler;
13 import com.intellij.testFramework.LightCodeInsightTestCase;
14 import org.jetbrains.annotations.NonNls;
16 public class ChangeSignatureTargetTest extends LightCodeInsightTestCase {
18 protected String getTestDataPath() {
19 return JavaTestUtil.getJavaTestDataPath();
22 public void testInMethodParameters() throws Exception {
26 public void testInMethodArguments() throws Exception {
30 public void testInClassTypeParameters() throws Exception {
34 public void testInTypeArguments() throws Exception {
39 protected Sdk getProjectJDK() {
40 return JavaSdkImpl.getMockJdk15("java 1.5");
43 private void doTest(String expectedMemberName) throws Exception {
44 String basePath = "/refactoring/changeSignatureTarget/" + getTestName(true);
45 @NonNls final String filePath = basePath + ".java";
46 configureByFile(filePath);
47 final PsiElement member = new JavaChangeSignatureHandler().findTargetMember(getFile(), getEditor());
48 assertNotNull(member);
49 assertEquals(expectedMemberName, ((PsiMember)member).getName());