Fix IDEA tests in Android plugin
This commit is contained in:
+4
-3
@@ -56,11 +56,12 @@ public abstract class AbstractAndroidCompletionTest : KotlinAndroidTestCase() {
|
||||
private fun completionType() = CompletionType.BASIC
|
||||
|
||||
fun doTest(testPath: String?) {
|
||||
myFixture!!.copyDirectoryToProject(getResDir()!!, "res")
|
||||
myFixture!!.configureByFile(testPath!! + getTestName(true) + ".kt");
|
||||
myFixture.copyDirectoryToProject(getResDir()!!, "res")
|
||||
val virtualFile = myFixture.copyFileToProject(testPath + getTestName(true) + ".kt", "src/" + getTestName(true) + ".kt");
|
||||
myFixture.configureFromExistingVirtualFile(virtualFile)
|
||||
val fileText = FileUtil.loadFile(File(testPath + getTestName(true) + ".kt"), true)
|
||||
testCompletion(fileText, TargetPlatform.JVM, {
|
||||
count -> myFixture!!.complete(completionType())
|
||||
count -> myFixture.complete(completionType())
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@ public abstract class AbstractAndroidFindUsagesTest : KotlinAndroidTestCase() {
|
||||
public fun doTest(path: String) {
|
||||
val f = myFixture!!
|
||||
f.copyDirectoryToProject(getResDir()!!, "res")
|
||||
f.configureByFile(path + getTestName(true) + ".kt")
|
||||
val virtualFile = f.copyFileToProject(path + getTestName(true) + ".kt", "src/" + getTestName(true) + ".kt");
|
||||
f.configureFromExistingVirtualFile(virtualFile)
|
||||
|
||||
val targetElement = TargetElementUtilBase.findTargetElement(f.getEditor(), TargetElementUtilBase.ELEMENT_NAME_ACCEPTED or TargetElementUtilBase.REFERENCED_ELEMENT_ACCEPTED)
|
||||
val propUsages = f.findUsages(targetElement!!)
|
||||
|
||||
+2
-1
@@ -33,7 +33,8 @@ public abstract class AbstractAndroidGotoTest : KotlinAndroidTestCase() {
|
||||
public fun doTest(path: String) {
|
||||
val f = myFixture!!
|
||||
f.copyDirectoryToProject(getResDir()!!, "res")
|
||||
f.configureByFile(path + getTestName(true) + ".kt");
|
||||
val virtualFile = f.copyFileToProject(path + getTestName(true) + ".kt", "src/" + getTestName(true) + ".kt");
|
||||
f.configureFromExistingVirtualFile(virtualFile)
|
||||
|
||||
val resolved = GotoDeclarationAction.findTargetElement(f.getProject(), f.getEditor(), f.getCaretOffset())
|
||||
if (f.getElementAtCaret() !is JetProperty) fail("element at caret must be a property, not a ${f.getElementAtCaret().javaClass}")
|
||||
|
||||
+2
-1
@@ -35,7 +35,8 @@ public abstract class AbstractAndroidRenameTest : KotlinAndroidTestCase() {
|
||||
public fun doTest(path: String) {
|
||||
val f = myFixture!!
|
||||
f.copyDirectoryToProject(getResDir()!!, "res")
|
||||
f.configureByFile(path + getTestName(true) + ".kt")
|
||||
val virtualFile = f.copyFileToProject(path + getTestName(true) + ".kt", "src/" + getTestName(true) + ".kt");
|
||||
f.configureFromExistingVirtualFile(virtualFile)
|
||||
val editor = f.getEditor()
|
||||
val file = f.getFile()
|
||||
val completionEditor = InjectedLanguageUtil.getEditorForInjectedLanguageNoCommit(editor, file)
|
||||
|
||||
Reference in New Issue
Block a user