Fix of SpringInspectionTestGenerated

This commit is contained in:
Mikhail Glukhikh
2017-04-28 18:22:21 +03:00
parent 5bd3716637
commit d0da11321d
@@ -24,8 +24,10 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.testFramework.InspectionTestUtil
import com.intellij.testFramework.createGlobalContextForTool
import com.intellij.util.xml.highlighting.DomElementsInspection
import org.jetbrains.kotlin.idea.inspections.gradle.DifferentKotlinGradleVersionInspection
import org.jetbrains.kotlin.idea.maven.inspections.DifferentKotlinMavenVersionInspection
import org.jetbrains.plugins.gradle.codeInspection.GradleBaseInspection
fun runInspection(
inspection: LocalInspectionTool, project: Project, files: List<VirtualFile>? = null, withTestDir: String? = null
@@ -33,9 +35,11 @@ fun runInspection(
val wrapper = LocalInspectionToolWrapper(inspection)
val tool = wrapper.tool
when (tool) {
is DifferentKotlinMavenVersionInspection -> tool.testVersionMessage = "\$PLUGIN_VERSION"
is DifferentKotlinGradleVersionInspection -> tool.testVersionMessage = "\$PLUGIN_VERSION"
if (tool is DomElementsInspection<*> || tool is GradleBaseInspection) {
when (tool) {
is DifferentKotlinMavenVersionInspection -> tool.testVersionMessage = "\$PLUGIN_VERSION"
is DifferentKotlinGradleVersionInspection -> tool.testVersionMessage = "\$PLUGIN_VERSION"
}
}
val scope = if (files != null) AnalysisScope(project, files) else AnalysisScope(project)