LightCodeInsightFixtureTestCase: JAVA_1.4 descriptor mocks 1.4 JDK

This commit is contained in:
Tagir Valeev
2017-09-13 12:07:43 +07:00
parent 8385149b78
commit a456ad0308
4 changed files with 10 additions and 1 deletions
@@ -5,7 +5,7 @@ class Simple {
public static void main(Set set, Set setO) {
class O {}
Map someData = new HashMap();
Map someData = Collections.EMPTY_MAP;
set.removeAll(someData.keySet());
setO.removeAll(someData.keySet());
@@ -24,10 +24,12 @@ import com.intellij.openapi.ide.CopyPasteManager
import com.intellij.psi.PsiFile
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
import org.jetbrains.annotations.NotNull
class CopyReferenceActionTest extends LightCodeInsightFixtureTestCase {
private int oldSetting
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_9
@@ -42,6 +42,11 @@ import java.io.File;
*/
public abstract class LightCodeInsightFixtureTestCase extends UsefulTestCase {
public static final LightProjectDescriptor JAVA_1_4 = new DefaultLightProjectDescriptor() {
@Override
public Sdk getSdk() {
return IdeaTestUtil.getMockJdk14();
}
@Override
public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
model.getModuleExtension(LanguageLevelModuleExtension.class).setLanguageLevel(LanguageLevel.JDK_1_4);
@@ -19,6 +19,7 @@ import com.intellij.codeInspection.LocalInspectionTool
import com.intellij.openapi.util.registry.Registry
import com.intellij.testFramework.LightProjectDescriptor
import com.siyeh.ig.LightInspectionTestCase
import org.jetbrains.annotations.NotNull
@SuppressWarnings(["ResultOfMethodCallIgnored", "UnusedReturnValue"])
class IgnoreResultOfCallInspectionTest extends LightInspectionTestCase {
@@ -28,6 +29,7 @@ class IgnoreResultOfCallInspectionTest extends LightInspectionTestCase {
return new IgnoreResultOfCallInspection()
}
@NotNull
@Override
protected LightProjectDescriptor getProjectDescriptor() {
return JAVA_8