Refactoring: extract method for check test is AllFilesPresent test
This commit is contained in:
committed by
Nikolay Krasko
parent
5cd23daf4e
commit
e562b73eff
@@ -962,4 +962,9 @@ public class KotlinTestUtils {
|
|||||||
}
|
}
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isAllFilesPresentTest(String testName) {
|
||||||
|
//noinspection SpellCheckingInspection
|
||||||
|
return testName.toLowerCase().startsWith("allfilespresentin");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -124,8 +124,7 @@ public abstract class KotlinLightCodeInsightFixtureTestCase : LightCodeInsightFi
|
|||||||
return KotlinLightProjectDescriptor.INSTANCE
|
return KotlinLightProjectDescriptor.INSTANCE
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun isAllFilesPresentInTest(): Boolean
|
protected fun isAllFilesPresentInTest(): Boolean = KotlinTestUtils.isAllFilesPresentTest(getTestName(false))
|
||||||
= getTestName(false).startsWith("AllFilesPresentIn")
|
|
||||||
|
|
||||||
protected open fun fileName(): String
|
protected open fun fileName(): String
|
||||||
= getTestName(false) + ".kt"
|
= getTestName(false) + ".kt"
|
||||||
|
|||||||
+2
-1
@@ -19,13 +19,14 @@ package org.jetbrains.kotlin.checkers
|
|||||||
import com.intellij.openapi.roots.ModuleRootModificationUtil
|
import com.intellij.openapi.roots.ModuleRootModificationUtil
|
||||||
import com.intellij.openapi.util.io.FileUtilRt
|
import com.intellij.openapi.util.io.FileUtilRt
|
||||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
||||||
|
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||||
import org.jetbrains.kotlin.test.MockLibraryUtil
|
import org.jetbrains.kotlin.test.MockLibraryUtil
|
||||||
|
|
||||||
abstract class AbstractJavaAgainstKotlinBinariesCheckerTest : AbstractJavaAgainstKotlinCheckerTest() {
|
abstract class AbstractJavaAgainstKotlinBinariesCheckerTest : AbstractJavaAgainstKotlinCheckerTest() {
|
||||||
override fun setUp() {
|
override fun setUp() {
|
||||||
super.setUp()
|
super.setUp()
|
||||||
val testName = getTestName(false)
|
val testName = getTestName(false)
|
||||||
if (testName.startsWith("AllFilesPresentIn")) {
|
if (KotlinTestUtils.isAllFilesPresentTest(testName)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val libraryName = "libFor" + testName
|
val libraryName = "libFor" + testName
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public abstract class AbstractIdeCompiledLightClassTest : KotlinDaemonAnalyzerTe
|
|||||||
super.setUp()
|
super.setUp()
|
||||||
|
|
||||||
val testName = getTestName(false)
|
val testName = getTestName(false)
|
||||||
if (testName.startsWith("AllFilesPresentIn")) return
|
if (KotlinTestUtils.isAllFilesPresentTest(testName)) return
|
||||||
|
|
||||||
val filePath = "${KotlinTestUtils.getTestsRoot(this)}/${getTestName(false)}.kt"
|
val filePath = "${KotlinTestUtils.getTestsRoot(this)}/${getTestName(false)}.kt"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user