encapsulate fields: javadoc placement settings (IDEA-52195)

This commit is contained in:
anna
2010-02-12 18:57:11 +03:00
parent 8331adb1d7
commit 9aa9935bf8
6 changed files with 89 additions and 13 deletions
@@ -14,6 +14,7 @@ import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.util.PropertyUtil;
import com.intellij.refactoring.encapsulateFields.EncapsulateFieldsDescriptor;
import com.intellij.refactoring.encapsulateFields.EncapsulateFieldsProcessor;
import com.intellij.refactoring.util.DocCommentPolicy;
import junit.framework.Assert;
import org.jetbrains.annotations.Nullable;
@@ -38,6 +39,18 @@ public class EncapsulateFieldsTest extends MultiFileTestCase{
doTest("i", "A.B", "There is already a <b><code>method <b><code>A.getI()</code></b></code></b> which would be hidden by generated getter");
}
public void testMoveJavadocToGetter() throws Exception {
doTest(new PerformAction() {
public void performAction(VirtualFile rootDir, VirtualFile rootAfter) throws Exception {
final PsiClass aClass = myJavaFacade.findClass("A", GlobalSearchScope.projectScope(myProject));
assertNotNull("Tested class not found", aClass);
final PsiField field = aClass.findFieldByName("i", false);
assertNotNull(field);
doTest(aClass, field, null, true, true);
}
});
}
@Override
protected String getTestDataPath() {
return JavaTestUtil.getJavaTestDataPath();
@@ -115,6 +128,10 @@ public class EncapsulateFieldsTest extends MultiFileTestCase{
public String getAccessorsVisibility() {
return PsiModifier.PUBLIC;
}
public int getJavadocPolicy() {
return DocCommentPolicy.MOVE;
}
});
processor.run();
LocalFileSystem.getInstance().refresh(false);