Files
openide/jvm/jvm-analysis-java-tests/testSrc/com/intellij/codeInspection/tests/java/EmptyMethodInspectionTest.java
Tagir Valeev 0385834f13 [jvm-inspections] Fix EmptyMethod compatibility with Kotlin
1. Fix suppression handling for Kotlin in global inspections
2. Fix RefMethodImpl#hasBody for top-level Kotlin functions
3. Move to JVM module
4. Add Kotlin tests
Fixes IDEA-330737 @file:Suppress("EmptyMethod") does not work

GitOrigin-RevId: 83f383e06754f510b6a99e35751263017734bb26
2024-01-29 19:42:30 +00:00

63 lines
1.3 KiB
Java

// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInspection.tests.java;
import com.intellij.JavaTestUtil;
import com.intellij.codeInspection.emptyMethod.EmptyMethodInspection;
import com.intellij.testFramework.JavaInspectionTestCase;
public class EmptyMethodInspectionTest extends JavaInspectionTestCase {
@Override
protected String getTestDataPath() {
return JavaTestUtil.getJavaTestDataPath() + "/inspection";
}
private void doTest() {
doTest(false);
}
private void doTest(final boolean checkRange) {
final EmptyMethodInspection tool = new EmptyMethodInspection();
doTest("emptyMethod/" + getTestName(true), tool, checkRange);
}
public void testSuperCall() {
doTest();
}
public void testSuperCallByRange() {
doTest(true);
}
public void testExternalOverride() {
doTest();
}
public void testSCR8321() {
doTest();
}
public void testInAnonymous() {
doTest(true);
}
public void testSuperFromAnotherPackageCall() {
doTest();
}
public void testSuperWithoutSync() {
doTest();
}
public void testEmptyMethodsHierarchy() {
doTest();
}
public void testEmptyInLambda() {
doTest();
}
public void testNonEmptyInLambda() {
doTest();
}
}