diff --git a/idea/testData/refactoring/pullUp/j2k/fromClassToClass.kt.after b/idea/testData/refactoring/pullUp/j2k/fromClassToClass.kt.after index fc464b450dc..875257d1fb7 100644 --- a/idea/testData/refactoring/pullUp/j2k/fromClassToClass.kt.after +++ b/idea/testData/refactoring/pullUp/j2k/fromClassToClass.kt.after @@ -21,7 +21,7 @@ abstract class A { var X = "1" + "2" // INFO: {"checked": "true"} - @JvmStatic + @kotlin.jvm.JvmStatic fun foo2(n: Int): String { return "_" + n + "_" } diff --git a/idea/testData/refactoring/pullUp/j2k/fromClassToClassAndMakeAbstract.kt.after b/idea/testData/refactoring/pullUp/j2k/fromClassToClassAndMakeAbstract.kt.after index 4100e573a43..a355d03f1e5 100644 --- a/idea/testData/refactoring/pullUp/j2k/fromClassToClassAndMakeAbstract.kt.after +++ b/idea/testData/refactoring/pullUp/j2k/fromClassToClassAndMakeAbstract.kt.after @@ -19,7 +19,7 @@ abstract class A { var X = "1" + "2" // INFO: {"checked": "true", "toAbstract": "true"} - @JvmStatic + @kotlin.jvm.JvmStatic fun foo2(n: Int): String { return "_" + n + "_" } diff --git a/idea/testData/refactoring/pullUp/j2k/fromClassToInterface.kt.after b/idea/testData/refactoring/pullUp/j2k/fromClassToInterface.kt.after index 2b6de9bd773..1b814f30f16 100644 --- a/idea/testData/refactoring/pullUp/j2k/fromClassToInterface.kt.after +++ b/idea/testData/refactoring/pullUp/j2k/fromClassToInterface.kt.after @@ -15,7 +15,7 @@ interface A { var X = "1" + "2" // INFO: {"checked": "true"} - @JvmStatic + @kotlin.jvm.JvmStatic fun foo2(n: Int): String { return "_" + n + "_" } diff --git a/idea/testData/refactoring/pullUp/j2k/fromClassToNestedClass.kt.after b/idea/testData/refactoring/pullUp/j2k/fromClassToNestedClass.kt.after index f54eb7ca958..c94bb3c9e32 100644 --- a/idea/testData/refactoring/pullUp/j2k/fromClassToNestedClass.kt.after +++ b/idea/testData/refactoring/pullUp/j2k/fromClassToNestedClass.kt.after @@ -23,7 +23,7 @@ class T { var X = "1" + "2" // INFO: {"checked": "true"} - @JvmStatic + @kotlin.jvm.JvmStatic fun foo2(n: Int): String { return "_" + n + "_" } diff --git a/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt b/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt index 8dca401fbb0..e193caf83e3 100644 --- a/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt +++ b/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt @@ -1,8 +1,8 @@ // WITH_RUNTIME abstract class B( - // INFO: {"checked": "true"} - val n: Int, - // INFO: {"checked": "true"} - val s: String, - val b: Boolean + // INFO: {"checked": "true"} + val n: Int, + // INFO: {"checked": "true"} + val s: String, + val b: Boolean ): A() \ No newline at end of file diff --git a/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt.after b/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt.after index 57fa567d9c5..1f9f578ef8f 100644 --- a/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt.after +++ b/idea/testData/refactoring/pullUp/k2j/constructorParameterToClass.kt.after @@ -1,6 +1,6 @@ // WITH_RUNTIME abstract class B( - // INFO: {"checked": "true"} + // INFO: {"checked": "true"} // INFO: {"checked": "true"} val b: Boolean ): A() diff --git a/idea/tests/org/jetbrains/kotlin/idea/refactoring/AbstractMemberPullPushTest.kt b/idea/tests/org/jetbrains/kotlin/idea/refactoring/AbstractMemberPullPushTest.kt index 3eec7864f08..89f9d8a250b 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/refactoring/AbstractMemberPullPushTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/refactoring/AbstractMemberPullPushTest.kt @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.idea.refactoring import com.google.gson.JsonParser import com.intellij.openapi.util.Key import com.intellij.openapi.util.io.FileUtil +import com.intellij.psi.PsiDocumentManager import com.intellij.psi.PsiElement import com.intellij.psi.PsiFile import com.intellij.refactoring.BaseRefactoringProcessor @@ -26,23 +27,15 @@ import com.intellij.refactoring.classMembers.MemberInfoBase import com.intellij.refactoring.util.CommonRefactoringUtil import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture import org.jetbrains.kotlin.idea.refactoring.memberInfo.KtPsiClassWrapper -import org.jetbrains.kotlin.idea.test.ConfigLibraryUtil import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase -import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor -import org.jetbrains.kotlin.idea.test.PluginTestCaseBase import org.jetbrains.kotlin.psi.NotNullableUserDataProperty -import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.util.findElementsByCommentPrefix import java.io.File abstract class AbstractMemberPullPushTest : KotlinLightCodeInsightFixtureTestCase() { - override fun getProjectDescriptor() = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE - val fixture: JavaCodeInsightTestFixture get() = myFixture - override fun getTestDataPath() = PluginTestCaseBase.getTestDataPathBase() - protected fun doTest(path: String, action: (mainFile: PsiFile) -> Unit) { val mainFile = File(path) val afterFile = File("$path.after") @@ -58,11 +51,6 @@ abstract class AbstractMemberPullPushTest : KotlinLightCodeInsightFixtureTestCas val extraFilesToPsi = extraFiles.associateBy { fixture.configureByFile(it.name) } val file = fixture.configureByFile(mainFileName) - val addKotlinRuntime = InTextDirectivesUtils.findStringWithPrefixes(file.text, "// WITH_RUNTIME") != null - if (addKotlinRuntime) { - ConfigLibraryUtil.configureKotlinRuntimeAndSdk(myModule, PluginTestCaseBase.mockJdk()) - } - try { markMembersInfo(file) extraFilesToPsi.keys.forEach(::markMembersInfo) @@ -70,6 +58,9 @@ abstract class AbstractMemberPullPushTest : KotlinLightCodeInsightFixtureTestCas action(file) assert(!conflictFile.exists()) { "Conflict file $conflictFile should not exist" } + + PsiDocumentManager.getInstance(project).commitAllDocuments() + KotlinTestUtils.assertEqualsToFile(afterFile, file.text!!) for ((extraPsiFile, extraFile) in extraFilesToPsi) { KotlinTestUtils.assertEqualsToFile(File("${extraFile.path}.after"), extraPsiFile.text) @@ -83,14 +74,7 @@ abstract class AbstractMemberPullPushTest : KotlinLightCodeInsightFixtureTestCas } KotlinTestUtils.assertEqualsToFile(conflictFile, message) } - finally { - if (addKotlinRuntime) { - ConfigLibraryUtil.unConfigureKotlinRuntimeAndSdk(myModule, PluginTestCaseBase.mockJdk()) - } - } } - - } internal fun markMembersInfo(file: PsiFile) {