[jvm] IJ-CR-27366 Fix test case with constructor inspection name and descriptors

GitOrigin-RevId: 0ab3700050c8097c61ec449028dad29e4d5e31a9
This commit is contained in:
Bart van Helvert
2022-08-09 11:36:07 +00:00
committed by intellij-monorepo-bot
parent 07e6ec4678
commit 42f2aa048d
3 changed files with 8 additions and 9 deletions
@@ -89,9 +89,9 @@ jvm.inspections.testonly.visiblefortesting=@VisibleForTesting makes little sense
jvm.inspections.test.method.without.assertion.display.name=Test method without any assertions
jvm.inspections.test.method.without.assertion.problem.descriptor=Test method <code>#ref()</code> contains no assertions #loc
jvm.inspections.test.case.with.constructor.display.name=JUnit TestCase with non-trivial constructors
jvm.inspections.test.case.with.constructor.problem.descriptor=Initialization logic in constructor <code>#ref()</code> instead of 'setup' life cycle method #loc
jvm.inspections.test.case.with.constructor.problem.descriptor.initializer=Initialization logic in initializer instead of 'setup' life cycle method
jvm.inspections.test.case.with.constructor.display.name=TestCase with non-trivial constructors
jvm.inspections.test.case.with.constructor.problem.descriptor=Initialization logic in constructor <code>#ref()</code> instead of 'setup()' life cycle method #loc
jvm.inspections.test.case.with.constructor.problem.descriptor.initializer=Initialization logic in initializer instead of 'setup()' life cycle method
jvm.inspections.junit3.super.teardown.display.name=JUnit 3 'super.tearDown()' is not called from 'finally' block
jvm.inspections.junit3.super.teardown.problem.descriptor=<code>#ref()</code> is not called from 'finally' block #loc
@@ -56,7 +56,7 @@ class JavaTestCaseWithConstructorInspectionTest : TestCaseWithConstructorInspect
import junit.framework.TestCase;
public class TestCaseWithConstructorInspection1 extends TestCase {
public <warning descr="Initialization logic in constructor 'TestCaseWithConstructorInspection1()' instead of 'setup' life cycle method">TestCaseWithConstructorInspection1</warning>() {
public <warning descr="Initialization logic in constructor 'TestCaseWithConstructorInspection1()' instead of 'setup()' life cycle method">TestCaseWithConstructorInspection1</warning>() {
System.out.println("");
}
}
@@ -68,7 +68,7 @@ class JavaTestCaseWithConstructorInspectionTest : TestCaseWithConstructorInspect
import junit.framework.TestCase;
public class TestCaseWithConstructorInspection3 extends TestCase {
public <warning descr="Initialization logic in constructor 'TestCaseWithConstructorInspection3()' instead of 'setup' life cycle method">TestCaseWithConstructorInspection3</warning>() {
public <warning descr="Initialization logic in constructor 'TestCaseWithConstructorInspection3()' instead of 'setup()' life cycle method">TestCaseWithConstructorInspection3</warning>() {
super();
System.out.println("TestCaseWithConstructorInspection3.TestCaseWithConstructorInspection3");
}
@@ -80,7 +80,7 @@ class JavaTestCaseWithConstructorInspectionTest : TestCaseWithConstructorInspect
fun `test highlighting Junit 4`() {
myFixture.testHighlighting(ULanguage.JAVA, """
public class JUnit4TestCaseWithConstructor {
public <warning descr="Initialization logic in constructor 'JUnit4TestCaseWithConstructor()' instead of 'setup' life cycle method">JUnit4TestCaseWithConstructor</warning>() {
public <warning descr="Initialization logic in constructor 'JUnit4TestCaseWithConstructor()' instead of 'setup()' life cycle method">JUnit4TestCaseWithConstructor</warning>() {
System.out.println();
System.out.println();
System.out.println();
@@ -59,18 +59,17 @@ class KotlinTestCaseWithConstructorInspectionTest : TestCaseWithConstructorInspe
import junit.framework.TestCase
class TestCaseWithConstructorInspection1() : TestCase() {
<warning descr="Initialization logic in constructor 'constructor()' instead of 'setup' life cycle method">constructor</warning>(x: Int) : this() {
<warning descr="Initialization logic in constructor 'constructor()' instead of 'setup()' life cycle method">constructor</warning>(x: Int) : this() {
println(x)
}
}
""".trimIndent(), "TestCaseWithConstructorInspection1")
}
fun `test highlighting Junit 4`() {
myFixture.testHighlighting(ULanguage.KOTLIN, """
public class JUnit4TestCaseWithConstructor {
<warning descr="Initialization logic in constructor 'constructor()' instead of 'setup' life cycle method">constructor</warning>() {
<warning descr="Initialization logic in constructor 'constructor()' instead of 'setup()' life cycle method">constructor</warning>() {
println()
println()
println()