Use Kotlin wrapper for LightCodeInsightTestCase tests
This will help in resolving compatibility issues and will allow to add common functionality to all tests.
This commit is contained in:
@@ -10,14 +10,15 @@ import com.intellij.openapi.editor.CaretModel;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.testFramework.EditorTestUtil;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.SettingsConfigurator;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class AbstractTypingIndentationTestBase extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractTypingIndentationTestBase extends KotlinLightCodeInsightTestCase {
|
||||
public void doNewlineTest(String afterFilePath) throws Exception {
|
||||
doNewlineTest(afterFilePath, false);
|
||||
}
|
||||
|
||||
+3
-2
@@ -10,14 +10,15 @@ import com.intellij.openapi.editor.CaretModel;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.testFramework.EditorTestUtil;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.SettingsConfigurator;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class AbstractTypingIndentationTestBase extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractTypingIndentationTestBase extends KotlinLightCodeInsightTestCase {
|
||||
public void doNewlineTest(String afterFilePath) throws Exception {
|
||||
doNewlineTest(afterFilePath, false);
|
||||
}
|
||||
|
||||
+3
-3
@@ -8,16 +8,16 @@ package org.jetbrains.kotlin.formatter;
|
||||
import com.intellij.application.options.CodeStyle;
|
||||
import com.intellij.openapi.editor.CaretModel;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.testFramework.EditorTestUtil;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.SettingsConfigurator;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class AbstractTypingIndentationTestBase extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractTypingIndentationTestBase extends KotlinLightCodeInsightTestCase {
|
||||
public void doNewlineTest(String afterFilePath) throws Exception {
|
||||
doNewlineTest(afterFilePath, false);
|
||||
}
|
||||
|
||||
@@ -5,14 +5,15 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea
|
||||
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.core.util.CodeInsightUtils
|
||||
import org.jetbrains.kotlin.idea.refactoring.IntroduceRefactoringException
|
||||
import org.jetbrains.kotlin.idea.refactoring.selectElement
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
|
||||
abstract class AbstractExpressionSelectionTest : LightCodeInsightTestCase() {
|
||||
@Suppress("DEPRECATION")
|
||||
abstract class AbstractExpressionSelectionTest : KotlinLightCodeInsightTestCase() {
|
||||
override fun getTestDataPath() = ""
|
||||
|
||||
fun doTestExpressionSelection(path: String) {
|
||||
|
||||
@@ -5,14 +5,15 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea
|
||||
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.core.util.CodeInsightUtils
|
||||
import org.jetbrains.kotlin.idea.refactoring.getExpressionShortText
|
||||
import org.jetbrains.kotlin.idea.refactoring.getSmartSelectSuggestions
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
|
||||
abstract class AbstractSmartSelectionTest : LightCodeInsightTestCase() {
|
||||
@Suppress("DEPRECATION")
|
||||
abstract class AbstractSmartSelectionTest : KotlinLightCodeInsightTestCase() {
|
||||
fun doTestSmartSelection(path: String) {
|
||||
configureByFile(path)
|
||||
|
||||
|
||||
@@ -7,16 +7,17 @@ package org.jetbrains.kotlin.idea.actions
|
||||
|
||||
import com.intellij.ide.actions.CopyReferenceAction
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.psi.KtNamedDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtVisitorVoid
|
||||
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||
import org.junit.runner.RunWith
|
||||
import java.util.*
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||
class QualifiedNamesTest: LightCodeInsightTestCase() {
|
||||
class QualifiedNamesTest : KotlinLightCodeInsightTestCase() {
|
||||
fun testClassRef() {
|
||||
LightPlatformCodeInsightTestCase.configureFromFileText(
|
||||
"class.kt",
|
||||
|
||||
@@ -7,15 +7,16 @@ package org.jetbrains.kotlin.idea.actions
|
||||
|
||||
import com.intellij.ide.actions.CopyReferenceAction
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.psi.KtNamedDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtVisitorVoid
|
||||
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||
import org.junit.runner.RunWith
|
||||
import java.util.*
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||
class QualifiedNamesTest : LightCodeInsightTestCase() {
|
||||
class QualifiedNamesTest : KotlinLightCodeInsightTestCase() {
|
||||
fun testClassRef() {
|
||||
configureFromFileText(
|
||||
"class.kt",
|
||||
|
||||
+3
-2
@@ -15,7 +15,6 @@ import com.intellij.openapi.application.runWriteAction
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction
|
||||
import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase
|
||||
import junit.framework.ComparisonFailure
|
||||
import junit.framework.TestCase
|
||||
@@ -23,6 +22,7 @@ import org.jetbrains.kotlin.formatter.FormatSettingsUtil
|
||||
import org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinDeclarationMover
|
||||
import org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinExpressionMover
|
||||
import org.jetbrains.kotlin.idea.core.script.isScriptChangesNotifierDisabled
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
@@ -56,7 +56,8 @@ abstract class AbstractMoveLeftRightTest : AbstractCodeMoverTest() {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractCodeMoverTest : LightCodeInsightTestCase() {
|
||||
@Suppress("DEPRECATION")
|
||||
abstract class AbstractCodeMoverTest : KotlinLightCodeInsightTestCase() {
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
ApplicationManager.getApplication().isScriptChangesNotifierDisabled = true
|
||||
|
||||
+3
-2
@@ -15,7 +15,6 @@ import com.intellij.openapi.application.runWriteAction
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction
|
||||
import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase
|
||||
import junit.framework.ComparisonFailure
|
||||
import junit.framework.TestCase
|
||||
@@ -23,6 +22,7 @@ import org.jetbrains.kotlin.formatter.FormatSettingsUtil
|
||||
import org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinDeclarationMover
|
||||
import org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinExpressionMover
|
||||
import org.jetbrains.kotlin.idea.core.script.isScriptChangesNotifierDisabled
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
@@ -56,7 +56,8 @@ abstract class AbstractMoveLeftRightTest : AbstractCodeMoverTest() {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractCodeMoverTest : LightCodeInsightTestCase() {
|
||||
@Suppress("DEPRECATION")
|
||||
abstract class AbstractCodeMoverTest : KotlinLightCodeInsightTestCase() {
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
ApplicationManager.getApplication().isScriptChangesNotifierDisabled = true
|
||||
|
||||
+3
-3
@@ -15,14 +15,13 @@ import com.intellij.openapi.application.runWriteAction
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction
|
||||
import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase
|
||||
import junit.framework.ComparisonFailure
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.formatter.FormatSettingsUtil
|
||||
import org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinDeclarationMover
|
||||
import org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinExpressionMover
|
||||
import org.jetbrains.kotlin.idea.core.script.isScriptChangesNotifierDisabled
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
@@ -56,7 +55,8 @@ abstract class AbstractMoveLeftRightTest : AbstractCodeMoverTest() {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractCodeMoverTest : LightCodeInsightTestCase() {
|
||||
@Suppress("DEPRECATION")
|
||||
abstract class AbstractCodeMoverTest : KotlinLightCodeInsightTestCase() {
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
ApplicationManager.getApplication().isScriptChangesNotifierDisabled = true
|
||||
|
||||
+3
-2
@@ -13,18 +13,19 @@ import com.intellij.openapi.editor.SelectionModel;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.rt.execution.junit.FileComparisonFailure;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.idea.codeInsight.surroundWith.expression.*;
|
||||
import org.jetbrains.kotlin.idea.codeInsight.surroundWith.statement.*;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractSurroundWithTest extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractSurroundWithTest extends KotlinLightCodeInsightTestCase {
|
||||
|
||||
public void doTestWithIfSurrounder(String path) throws Exception {
|
||||
doTest(path, new KotlinIfSurrounder());
|
||||
|
||||
+3
-2
@@ -11,15 +11,16 @@ import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractUnwrapRemoveTest extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractUnwrapRemoveTest extends KotlinLightCodeInsightTestCase {
|
||||
public void doTestExpressionRemover(@NotNull String path) throws Exception {
|
||||
doTest(path, KotlinUnwrappers.KotlinExpressionRemover.class);
|
||||
}
|
||||
|
||||
+4
-2
@@ -17,12 +17,12 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiJavaModule;
|
||||
import com.intellij.psi.search.FilenameIndex;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.testFramework.LightProjectDescriptor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.idea.core.script.ScriptUtilsKt;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.plugins.groovy.GroovyFileType;
|
||||
@@ -31,7 +31,9 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class AbstractConfigureProjectByChangingFileTest<C extends KotlinProjectConfigurator> extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractConfigureProjectByChangingFileTest<C extends KotlinProjectConfigurator>
|
||||
extends KotlinLightCodeInsightTestCase {
|
||||
private static final String DEFAULT_VERSION = "default_version";
|
||||
|
||||
private PsiFile moduleInfoFile;
|
||||
|
||||
+4
-2
@@ -16,12 +16,12 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiJavaModule;
|
||||
import com.intellij.psi.search.FilenameIndex;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import com.intellij.testFramework.LightProjectDescriptor;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.idea.core.script.ScriptUtilsKt;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.plugins.groovy.GroovyFileType;
|
||||
@@ -30,7 +30,9 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class AbstractConfigureProjectByChangingFileTest<C extends KotlinProjectConfigurator> extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractConfigureProjectByChangingFileTest<C extends KotlinProjectConfigurator>
|
||||
extends KotlinLightCodeInsightTestCase {
|
||||
private static final String DEFAULT_VERSION = "default_version";
|
||||
|
||||
private PsiFile moduleInfoFile;
|
||||
|
||||
@@ -8,8 +8,8 @@ package org.jetbrains.kotlin.idea.editor;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.testFramework.EditorTestUtil;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.formatter.FormatSettingsUtil;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
||||
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
@@ -17,8 +17,10 @@ import org.jetbrains.kotlin.test.SettingsConfigurator;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(JUnit3WithIdeaConfigurationRunner.class)
|
||||
public class KotlinCommenterTest extends LightCodeInsightTestCase {
|
||||
public class KotlinCommenterTest extends KotlinLightCodeInsightTestCase {
|
||||
private static final String BASE_PATH =
|
||||
new File(PluginTestCaseBase.getTestDataPathBase(), "/editor/commenter/").getAbsolutePath();
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ package org.jetbrains.kotlin.idea.editor;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.testFramework.EditorTestUtil;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.formatter.FormatSettingsUtil;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
||||
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
@@ -17,8 +17,10 @@ import org.jetbrains.kotlin.test.SettingsConfigurator;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(JUnit3WithIdeaConfigurationRunner.class)
|
||||
public class KotlinCommenterTest extends LightCodeInsightTestCase {
|
||||
public class KotlinCommenterTest extends KotlinLightCodeInsightTestCase {
|
||||
private static final String BASE_PATH =
|
||||
new File(PluginTestCaseBase.getTestDataPathBase(), "/editor/commenter/").getAbsolutePath();
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ package org.jetbrains.kotlin.idea.editor;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.testFramework.EditorTestUtil;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.formatter.FormatSettingsUtil;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
||||
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
@@ -17,8 +17,10 @@ import org.jetbrains.kotlin.test.SettingsConfigurator;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(JUnit3WithIdeaConfigurationRunner.class)
|
||||
public class KotlinCommenterTest extends LightCodeInsightTestCase {
|
||||
public class KotlinCommenterTest extends KotlinLightCodeInsightTestCase {
|
||||
private static final String BASE_PATH =
|
||||
new File(PluginTestCaseBase.getTestDataPathBase(), "/editor/commenter/").getAbsolutePath();
|
||||
|
||||
|
||||
+3
-2
@@ -8,10 +8,11 @@ package org.jetbrains.kotlin.idea.editor.backspaceHandler
|
||||
import com.intellij.openapi.actionSystem.IdeActions
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.testFramework.EditorTestUtil
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractBackspaceHandlerTest : LightCodeInsightTestCase() {
|
||||
@Suppress("DEPRECATION")
|
||||
abstract class AbstractBackspaceHandlerTest : KotlinLightCodeInsightTestCase() {
|
||||
fun doTest(path: String) {
|
||||
configureFromFileText("a.kt", loadFile(path))
|
||||
EditorTestUtil.executeAction(getEditor(), IdeActions.ACTION_EDITOR_BACKSPACE)
|
||||
|
||||
+3
-2
@@ -9,14 +9,15 @@ import com.intellij.codeInsight.editorActions.JoinLinesHandler;
|
||||
import com.intellij.openapi.projectRoots.JavaSdk;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.rt.execution.junit.FileComparisonFailure;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class AbstractJoinLinesTest extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractJoinLinesTest extends KotlinLightCodeInsightTestCase {
|
||||
public void doTest(@NotNull String path) throws Exception {
|
||||
configureByFile(path);
|
||||
new JoinLinesHandler(null).execute(getEditor(), getEditor().getCaretModel().getCurrentCaret(),
|
||||
|
||||
@@ -10,29 +10,30 @@ import com.intellij.ide.startup.impl.StartupManagerImpl;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.refactoring.rename.RenameProcessor;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
||||
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(JUnit3WithIdeaConfigurationRunner.class)
|
||||
public class KdocRenameTest extends LightCodeInsightTestCase {
|
||||
public class KdocRenameTest extends KotlinLightCodeInsightTestCase {
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PluginTestCaseBase.getTestDataPathBase() + "/kdoc/rename/";
|
||||
}
|
||||
|
||||
public void testParamReference() throws Exception {
|
||||
public void testParamReference() {
|
||||
doTest("bar");
|
||||
}
|
||||
|
||||
public void testTypeParamReference() throws Exception {
|
||||
public void testTypeParamReference() {
|
||||
doTest("R");
|
||||
}
|
||||
|
||||
public void testCodeReference() throws Exception {
|
||||
public void testCodeReference() {
|
||||
doTest("xyzzy");
|
||||
}
|
||||
|
||||
@@ -42,7 +43,7 @@ public class KdocRenameTest extends LightCodeInsightTestCase {
|
||||
((StartupManagerImpl) StartupManager.getInstance(getProject())).runPostStartupActivities();
|
||||
}
|
||||
|
||||
private void doTest(String newName) throws Exception {
|
||||
private void doTest(String newName) {
|
||||
configureByFile(getTestName(false) + ".kt");
|
||||
PsiElement element = TargetElementUtil
|
||||
.findTargetElement(myEditor,
|
||||
|
||||
@@ -10,29 +10,30 @@ import com.intellij.ide.startup.impl.StartupManagerImpl;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.refactoring.rename.RenameProcessor;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
||||
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@RunWith(JUnit3WithIdeaConfigurationRunner.class)
|
||||
public class KdocRenameTest extends LightCodeInsightTestCase {
|
||||
public class KdocRenameTest extends KotlinLightCodeInsightTestCase {
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return PluginTestCaseBase.getTestDataPathBase() + "/kdoc/rename/";
|
||||
}
|
||||
|
||||
public void testParamReference() throws Exception {
|
||||
public void testParamReference() {
|
||||
doTest("bar");
|
||||
}
|
||||
|
||||
public void testTypeParamReference() throws Exception {
|
||||
public void testTypeParamReference() {
|
||||
doTest("R");
|
||||
}
|
||||
|
||||
public void testCodeReference() throws Exception {
|
||||
public void testCodeReference() {
|
||||
doTest("xyzzy");
|
||||
}
|
||||
|
||||
@@ -42,7 +43,7 @@ public class KdocRenameTest extends LightCodeInsightTestCase {
|
||||
((StartupManagerImpl) StartupManager.getInstance(getProject())).runPostStartupActivities();
|
||||
}
|
||||
|
||||
private void doTest(String newName) throws Exception {
|
||||
private void doTest(String newName) {
|
||||
configureByFile(getTestName(false) + ".kt");
|
||||
PsiElement element = TargetElementUtil
|
||||
.findTargetElement(getEditor(),
|
||||
|
||||
+3
-2
@@ -6,14 +6,15 @@
|
||||
package org.jetbrains.kotlin.idea.navigation
|
||||
|
||||
import com.intellij.openapi.projectRoots.Sdk
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
||||
import org.jetbrains.kotlin.idea.test.invalidateLibraryCache
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractKotlinGotoImplementationTest : LightCodeInsightTestCase() {
|
||||
@Suppress("DEPRECATION")
|
||||
abstract class AbstractKotlinGotoImplementationTest : KotlinLightCodeInsightTestCase() {
|
||||
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
|
||||
+3
-2
@@ -6,13 +6,14 @@
|
||||
package org.jetbrains.kotlin.idea.navigation
|
||||
|
||||
import com.intellij.openapi.projectRoots.Sdk
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
||||
import org.jetbrains.kotlin.idea.test.invalidateLibraryCache
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractKotlinGotoImplementationTest : LightCodeInsightTestCase() {
|
||||
@Suppress("DEPRECATION")
|
||||
abstract class AbstractKotlinGotoImplementationTest : KotlinLightCodeInsightTestCase() {
|
||||
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
|
||||
+3
-2
@@ -8,11 +8,12 @@ package org.jetbrains.kotlin.idea.refactoring.rename;
|
||||
import com.intellij.codeInsight.TargetElementUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.refactoring.rename.RenameProcessor;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
||||
|
||||
public class SimpleNameReferenceRenameTest extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public class SimpleNameReferenceRenameTest extends KotlinLightCodeInsightTestCase {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
|
||||
+3
-2
@@ -8,11 +8,12 @@ package org.jetbrains.kotlin.idea.refactoring.rename;
|
||||
import com.intellij.codeInsight.TargetElementUtil;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.refactoring.rename.RenameProcessor;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightTestCase;
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
||||
|
||||
public class SimpleNameReferenceRenameTest extends LightCodeInsightTestCase {
|
||||
@SuppressWarnings("deprecation")
|
||||
public class SimpleNameReferenceRenameTest extends KotlinLightCodeInsightTestCase {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user