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.PsiMember;
11 import com.intellij.refactoring.changeSignature.JavaChangeSignatureHandler;
12 import com.intellij.testFramework.LightCodeInsightTestCase;
13 import org.jetbrains.annotations.NonNls;
15 public class ChangeSignatureTargetTest extends LightCodeInsightTestCase {
17 protected String getTestDataPath() {
18 return JavaTestUtil.getJavaTestDataPath();
21 public void testInMethodParameters() throws Exception {
25 public void testInMethodArguments() throws Exception {
29 public void testInClassTypeParameters() throws Exception {
33 public void testInTypeArguments() throws Exception {
38 protected Sdk getProjectJDK() {
39 return JavaSdkImpl.getMockJdk15("java 1.5");
42 private void doTest(String expectedMemberName) throws Exception {
43 String basePath = "/refactoring/changeSignatureTarget/" + getTestName(true);
44 @NonNls final String filePath = basePath + ".java";
45 configureByFile(filePath);
46 final PsiMember member = new JavaChangeSignatureHandler().findTargetMember(getFile(), getEditor());
47 assertNotNull(member);
48 assertEquals(expectedMemberName, member.getName());