[java] (IDEA-282971) AssertEqualsBetweenInconvertibleTypesInspection rewritten to UAST review fixes

(cherry picked from commit 96e11216c71800ee5586a4103026ef9d22512915)

IJ-CR-23780

GitOrigin-RevId: 285ebf54150b508b23df431734b1531a4fe5986f
This commit is contained in:
Olga Klisho
2022-04-29 12:49:12 +00:00
committed by intellij-monorepo-bot
parent 458e7358ba
commit 057b1bc48d
3 changed files with 5 additions and 28 deletions
@@ -1,16 +1,12 @@
package com.intellij.codeInspection.tests.java.test.junit
package com.intellij.codeInspection.tests.java
import com.intellij.codeInspection.tests.test.junit.AssertEqualsBetweenInconvertibleTypesInspectionTestBase
import com.intellij.codeInspection.tests.AssertEqualsBetweenInconvertibleTypesInspectionTestBase
import com.intellij.jvm.analysis.JavaJvmAnalysisTestUtil
import com.intellij.openapi.application.PathManager
import java.io.File
class JavaAssertEqualsBetweenInconvertibleTypesInspectionTest : AssertEqualsBetweenInconvertibleTypesInspectionTestBase() {
override fun getBasePath() = JavaJvmAnalysisTestUtil.TEST_DATA_PROJECT_RELATIVE_BASE_PATH + "/codeInspection/assert_equals_between_inconvertible_types"
override fun getTestDataPath(): String = PathManager.getCommunityHomePath().replace(File.separatorChar, '/') + basePath
fun `test AssertEqualsBetweenInconvertibleTypes`() {
myFixture.testHighlighting("AssertEqualsBetweenInconvertibleTypes.java")
}
@@ -1,19 +1,14 @@
package com.intellij.codeInspection.tests.kotlin.test.junit
package com.intellij.codeInspection.tests.kotlin
import com.intellij.codeInspection.tests.test.junit.AssertEqualsBetweenInconvertibleTypesInspectionTestBase
import com.intellij.codeInspection.tests.AssertEqualsBetweenInconvertibleTypesInspectionTestBase
import com.intellij.jvm.analysis.KotlinJvmAnalysisTestUtil
import com.intellij.openapi.application.PathManager
import com.intellij.testFramework.TestDataPath
import java.io.File
private const val inspectionPath = "/codeInspection/assertEqualsBetweenInconvertibleTypes"
@TestDataPath("\$CONTENT_ROOT/testData$inspectionPath")
class KotlinAssertEqualsBetweenInconvertibleTypesTest : AssertEqualsBetweenInconvertibleTypesInspectionTestBase() {
override fun getBasePath() = KotlinJvmAnalysisTestUtil.TEST_DATA_PROJECT_RELATIVE_BASE_PATH + inspectionPath
override fun getTestDataPath(): String = PathManager.getCommunityHomePath().replace(File.separatorChar, '/') + basePath
fun `test AssertEqualsBetweenInconvertibleTypes`() {
myFixture.testHighlighting("AssertEqualsBetweenInconvertibleTypes.kt")
}
@@ -1,10 +1,7 @@
package com.intellij.codeInspection.tests.test.junit
package com.intellij.codeInspection.tests
import com.intellij.codeInspection.AssertBetweenInconvertibleTypesInspection
import com.intellij.codeInspection.InspectionProfileEntry
import com.intellij.codeInspection.tests.UastInspectionTestBase
import com.intellij.openapi.roots.LanguageLevelProjectExtension
import com.intellij.pom.java.LanguageLevel
open class AssertEqualsBetweenInconvertibleTypesInspectionTestBase : UastInspectionTestBase() {
@@ -12,8 +9,6 @@ open class AssertEqualsBetweenInconvertibleTypesInspectionTestBase : UastInspect
override fun setUp() {
super.setUp()
LanguageLevelProjectExtension.getInstance(project).languageLevel = LanguageLevel.JDK_1_8
myFixture.enableInspections(AssertBetweenInconvertibleTypesInspection())
myFixture.addClass("""
package org.junit.jupiter.api;
@@ -99,13 +94,4 @@ open class AssertEqualsBetweenInconvertibleTypesInspectionTestBase : UastInspect
SELF isEqualTo(Object expected);}
""".trimIndent())
}
override fun tearDown() {
try {
myFixture.disableInspections(AssertBetweenInconvertibleTypesInspection())
}
finally {
super.tearDown()
}
}
}