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;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
protected fun isAllFilesPresentInTest(): Boolean
|
||||
= getTestName(false).startsWith("AllFilesPresentIn")
|
||||
protected fun isAllFilesPresentInTest(): Boolean = KotlinTestUtils.isAllFilesPresentTest(getTestName(false))
|
||||
|
||||
protected open fun fileName(): String
|
||||
= getTestName(false) + ".kt"
|
||||
|
||||
+2
-1
@@ -19,13 +19,14 @@ package org.jetbrains.kotlin.checkers
|
||||
import com.intellij.openapi.roots.ModuleRootModificationUtil
|
||||
import com.intellij.openapi.util.io.FileUtilRt
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.MockLibraryUtil
|
||||
|
||||
abstract class AbstractJavaAgainstKotlinBinariesCheckerTest : AbstractJavaAgainstKotlinCheckerTest() {
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
val testName = getTestName(false)
|
||||
if (testName.startsWith("AllFilesPresentIn")) {
|
||||
if (KotlinTestUtils.isAllFilesPresentTest(testName)) {
|
||||
return
|
||||
}
|
||||
val libraryName = "libFor" + testName
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class AbstractIdeCompiledLightClassTest : KotlinDaemonAnalyzerTe
|
||||
super.setUp()
|
||||
|
||||
val testName = getTestName(false)
|
||||
if (testName.startsWith("AllFilesPresentIn")) return
|
||||
if (KotlinTestUtils.isAllFilesPresentTest(testName)) return
|
||||
|
||||
val filePath = "${KotlinTestUtils.getTestsRoot(this)}/${getTestName(false)}.kt"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user