From c9c81ed70f35bc293a519c074cb0a279ed8ef211 Mon Sep 17 00:00:00 2001 From: "Alexander.Podkhalyuzin" Date: Wed, 22 Feb 2012 13:57:33 +0400 Subject: [PATCH] Patched test to avoid package renaming. --- .../rename/renameKotlinClass/after/Second.kt | 12 ++++++------ .../renameKotlinClass/after/{First.kt => Third.kt} | 2 +- .../rename/renameKotlinClass/before/First.kt | 2 +- .../rename/renameKotlinClass/before/Second.kt | 12 ++++++------ .../refactoring/rename/RenameInKotlinTest.java | 5 ++++- 5 files changed, 18 insertions(+), 15 deletions(-) rename idea/testData/refactoring/rename/renameKotlinClass/after/{First.kt => Third.kt} (54%) diff --git a/idea/testData/refactoring/rename/renameKotlinClass/after/Second.kt b/idea/testData/refactoring/rename/renameKotlinClass/after/Second.kt index 6f1425f51aa..f4fce31f8be 100644 --- a/idea/testData/refactoring/rename/renameKotlinClass/after/Second.kt +++ b/idea/testData/refactoring/rename/renameKotlinClass/after/Second.kt @@ -1,18 +1,18 @@ -package testing.second +package testing.rename2 -import testing.first.Third +import testing.rename.Third import testing.* import java.util.ArrayList -// Extends testing.first.Third +// Extends testing.rename.Third public class Second : Third() { - val temp : testing.first.Third = Third() + val temp : testing.rename.Third = Third() - fun tempName(param : Third) : first.Third { + fun tempName(param : Third) : rename.Third { val local = Third() val otherLocal = param val arr = ArrayList() - return testing.first.Third() + return testing.rename.Third() } } \ No newline at end of file diff --git a/idea/testData/refactoring/rename/renameKotlinClass/after/First.kt b/idea/testData/refactoring/rename/renameKotlinClass/after/Third.kt similarity index 54% rename from idea/testData/refactoring/rename/renameKotlinClass/after/First.kt rename to idea/testData/refactoring/rename/renameKotlinClass/after/Third.kt index d0902675688..0b1577752ca 100644 --- a/idea/testData/refactoring/rename/renameKotlinClass/after/First.kt +++ b/idea/testData/refactoring/rename/renameKotlinClass/after/Third.kt @@ -1,4 +1,4 @@ -package testing.first +package testing.rename public open class Third { } \ No newline at end of file diff --git a/idea/testData/refactoring/rename/renameKotlinClass/before/First.kt b/idea/testData/refactoring/rename/renameKotlinClass/before/First.kt index 14e66920c8a..c44843d38b3 100644 --- a/idea/testData/refactoring/rename/renameKotlinClass/before/First.kt +++ b/idea/testData/refactoring/rename/renameKotlinClass/before/First.kt @@ -1,4 +1,4 @@ -package testing.first +package testing.rename public open class First { } \ No newline at end of file diff --git a/idea/testData/refactoring/rename/renameKotlinClass/before/Second.kt b/idea/testData/refactoring/rename/renameKotlinClass/before/Second.kt index 0bc1ef5f46f..67412fc6328 100644 --- a/idea/testData/refactoring/rename/renameKotlinClass/before/Second.kt +++ b/idea/testData/refactoring/rename/renameKotlinClass/before/Second.kt @@ -1,18 +1,18 @@ -package testing.second +package testing.rename2 -import testing.first.First +import testing.rename.First import testing.* import java.util.ArrayList -// Extends testing.first.First +// Extends testing.rename.First public class Second : First() { - val temp : testing.first.First = First() + val temp : testing.rename.First = First() - fun tempName(param : First) : first.First { + fun tempName(param : First) : rename.First { val local = First() val otherLocal = param val arr = ArrayList() - return testing.first.First() + return testing.rename.First() } } \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/refactoring/rename/RenameInKotlinTest.java b/idea/tests/org/jetbrains/jet/plugin/refactoring/rename/RenameInKotlinTest.java index abf8f1d72ca..4681629d1fa 100644 --- a/idea/tests/org/jetbrains/jet/plugin/refactoring/rename/RenameInKotlinTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/refactoring/rename/RenameInKotlinTest.java @@ -19,6 +19,8 @@ package org.jetbrains.jet.plugin.refactoring.rename; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileManager; +import com.intellij.openapi.vfs.VirtualFileSystem; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; import com.intellij.psi.search.GlobalSearchScope; @@ -47,7 +49,7 @@ public class RenameInKotlinTest extends MultiFileTestCase { } public void testRenameKotlinClass() throws Exception { - doTestWithRenameClass("testing.first.First", "Third"); + doTestWithRenameClass("testing.rename.First", "Third"); } private void doTestWithRenameClass(@NonNls final String qClassName, @NonNls final String newName) throws Exception { @@ -66,6 +68,7 @@ public class RenameInKotlinTest extends MultiFileTestCase { new RenameProcessor(myProject, psiElement, newName, true, true).run(); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); FileDocumentManager.getInstance().saveAllDocuments(); + VirtualFileManager.getInstance().refresh(false); } }); }