From aa6829d7c1a80a3b6b805a942d5e11c89c3432c3 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Thu, 28 Sep 2023 18:25:15 +0200 Subject: [PATCH] [java-tests] IDEA-333831 Separate mock JDK and JetBrains annotations for testing Also: avoid manual mocking of Java 10 classes in StreamCollector10Inlining test, use mockJDK11 instead Also: rewrite SliceTestCase and its inheritors to LightJavaCodeInsightFixtureTestCase, as annotations.jar is not included into project created by DaemonAnalyzerTestCase Also: 'mutates' attribute of @Contract annotation is resolvable now, as we can use newer jetbrains-annotations library. Also: documentation tests now don't generate links to JetBrains annotations, which corresponds to the actual behavior in production GitOrigin-RevId: e460826893c1277cb2b78b18aae9d5aca97d8333 --- .../PreferApplicableAnnotations.java | 2 +- ...ssWithReferencesToClassesFromJavaLang.html | 2 +- .../javadocIG/reflectConstructor.html | 4 +- .../org/jetbrains/annotations/annotations.xml | 20 ++ .../dataFlow/fixture/MutabilityBasics.java | 6 +- .../fixture/StreamCollector10Inlining.java | 10 - .../testData/psi/cls/stubBuilder/Nullable.txt | 1 + .../codeInsight/AddAnnotationFixTest.java | 1 + .../codeInsight/ExternalAnnotationsTest.java | 1 + .../NullableNotNullManagerTest.java | 1 + .../NormalCompletionOrderingTest.java | 4 +- .../completion/NormalCompletionTest.java | 16 +- .../javadoc/JavaDocInfoGeneratorTest.java | 21 +- .../DataFlowInspection10Test.java | 46 ---- .../DataFlowInspection11Test.java | 25 +++ .../DataFlowInspectionTestSuite.java | 2 +- .../BytecodeAnalysisIntegrationTest.java | 1 + ...tecodeAnalysisResultsHighlightingTest.java | 1 + .../intellij/java/psi/ClsStubBuilderTest.java | 10 +- .../java/refactoring/SafeDeleteTest.java | 8 + .../java/slicer/SliceBackwardTest.java | 18 +- .../java/slicer/SliceForwardTest.java | 32 +-- .../intellij/java/slicer/SliceTestCase.java | 13 +- .../intellij/java/slicer/SliceTreeTest.java | 47 ++-- .../PackagesTreeStructureTest.java | 8 - .../PointlessBooleanExpressionFixTest.java | 3 + .../dataflow/CreateNullBranchFixTest.java | 3 + .../IfCanBePatternSwitchFixTest.java | 3 + ...mbdaCanBeReplacedWithAnonymousFixTest.java | 3 + java/mockJDK-1.7/jre/lib/annotations.jar | Bin 23831 -> 0 bytes .../jre/lib/annotations.jar_LICENSE | 202 ------------------ java/mockJDK-1.8/jre/lib/annotations.jar | Bin 24037 -> 0 bytes .../jre/lib/annotations.jar_LICENSE | 202 ------------------ java/mockJDK-1.9/jre/lib/annotations.jar | Bin 24037 -> 0 bytes java/mockJDK-11/jre/lib/annotations.jar | Bin 24037 -> 0 bytes .../LightJavaCodeInsightTestCase.java | 14 ++ .../DefaultLightProjectDescriptor.java | 16 +- .../LightJavaCodeInsightFixtureTestCase.java | 2 + .../inspection/SSBasedInspectionTestCase.java | 4 +- .../testFramework/LightPlatformTestCase.java | 7 +- .../JavaInjectedFileChangesHandlerTest.kt | 7 + .../navigation/KtPropertyKeyFoldingTest.kt | 7 + .../inspections/PluginModuleTestCase.java | 8 + ...urnStatementVisitorInspectionTestBase.java | 3 + .../completion/GroovyCompletionTest.groovy | 2 +- .../DuplicateStringLiteralInspectionTest.java | 3 + .../InvalidPropertyKeyInspectionTest.java | 8 + .../i18n/PropertyKeyFoldingTest.kt | 7 + .../AbstractJvmBasicCompletionTestBase.kt | 5 + .../AbstractJavaAgainstKotlinCheckerTest.java | 4 + .../AbstractOutOfBlockModificationTest.kt | 3 +- .../textBuilder/AbstractDecompiledTextTest.kt | 2 +- .../test/KotlinLightProjectDescriptor.java | 7 + .../intellij/plugin/LombokTestUtil.java | 1 + 54 files changed, 270 insertions(+), 556 deletions(-) create mode 100644 java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/jetbrains/annotations/annotations.xml delete mode 100644 java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspection10Test.java create mode 100644 java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspection11Test.java delete mode 100644 java/mockJDK-1.7/jre/lib/annotations.jar delete mode 100644 java/mockJDK-1.7/jre/lib/annotations.jar_LICENSE delete mode 100644 java/mockJDK-1.8/jre/lib/annotations.jar delete mode 100644 java/mockJDK-1.8/jre/lib/annotations.jar_LICENSE delete mode 100644 java/mockJDK-1.9/jre/lib/annotations.jar delete mode 100644 java/mockJDK-11/jre/lib/annotations.jar diff --git a/java/java-tests/testData/codeInsight/completion/normalSorting/PreferApplicableAnnotations.java b/java/java-tests/testData/codeInsight/completion/normalSorting/PreferApplicableAnnotations.java index fe6080708ee9..0f6023f275e4 100644 --- a/java/java-tests/testData/codeInsight/completion/normalSorting/PreferApplicableAnnotations.java +++ b/java/java-tests/testData/codeInsight/completion/normalSorting/PreferApplicableAnnotations.java @@ -1,2 +1,2 @@ -@T +@Tt @interface Foo { } diff --git a/java/java-tests/testData/codeInsight/javadocIG/documentationForJdkClassWithReferencesToClassesFromJavaLang.html b/java/java-tests/testData/codeInsight/javadocIG/documentationForJdkClassWithReferencesToClassesFromJavaLang.html index 8d5bd35d56f8..85fb52bfeab3 100644 --- a/java/java-tests/testData/codeInsight/javadocIG/documentationForJdkClassWithReferencesToClassesFromJavaLang.html +++ b/java/java-tests/testData/codeInsight/javadocIG/documentationForJdkClassWithReferencesToClassesFromJavaLang.html @@ -1,4 +1,4 @@ -
@Contract(pure = true) 
+
@Contract(pure = true) 
 public abstract boolean contains(
Object o
)
Returns true if this list contains the specified element. More formally, returns true if and only if this list contains diff --git a/java/java-tests/testData/codeInsight/javadocIG/reflectConstructor.html b/java/java-tests/testData/codeInsight/javadocIG/reflectConstructor.html index cb51115626f6..4267b3a0a4f5 100644 --- a/java/java-tests/testData/codeInsight/javadocIG/reflectConstructor.html +++ b/java/java-tests/testData/codeInsight/javadocIG/reflectConstructor.html @@ -1,5 +1,5 @@
@CallerSensitive 
-@NotNull 
-@Contract(pure = true) 
+@NotNull 
+@Contract(pure = true) 
 public java.lang.reflect.Constructor<?>[] getDeclaredConstructors()
 throws SecurityException

Throws:

SecurityException

 < java 10 >
\ No newline at end of file diff --git a/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/jetbrains/annotations/annotations.xml b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/jetbrains/annotations/annotations.xml new file mode 100644 index 000000000000..96bf3b56f610 --- /dev/null +++ b/java/java-tests/testData/codeInspection/bytecodeAnalysis/annotations/org/jetbrains/annotations/annotations.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/MutabilityBasics.java b/java/java-tests/testData/inspection/dataFlow/fixture/MutabilityBasics.java index 62900d029f06..176d7f4bcb81 100644 --- a/java/java-tests/testData/inspection/dataFlow/fixture/MutabilityBasics.java +++ b/java/java-tests/testData/inspection/dataFlow/fixture/MutabilityBasics.java @@ -12,12 +12,12 @@ public class MutabilityBasics { return Collections.emptyList(); } - @Contract(mutates = "param") + @Contract(mutates = "param") static > void sort(List collection) { Collections.sort(collection); } - @Contract(mutates = "param1") + @Contract(mutates = "param1") static > void addAll(Collection collection, List other) { sort(other); collection.addAll(other); @@ -33,7 +33,7 @@ public class MutabilityBasics { interface Point { int get(); - @Contract(mutates = "this") + @Contract(mutates = "this") void set(int x); @Contract(pure = true) diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/StreamCollector10Inlining.java b/java/java-tests/testData/inspection/dataFlow/fixture/StreamCollector10Inlining.java index a8cee7ee9da8..5c166fc0afe4 100644 --- a/java/java-tests/testData/inspection/dataFlow/fixture/StreamCollector10Inlining.java +++ b/java/java-tests/testData/inspection/dataFlow/fixture/StreamCollector10Inlining.java @@ -1,5 +1,3 @@ -package java.util.stream; - import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -7,14 +5,6 @@ import java.util.*; import java.util.function.*; import java.util.stream.*; -// Mock -class Collectors { - public static native Collector> toList(); - public static native Collector> toUnmodifiableList(); - public static native Collector> toUnmodifiableSet(); - public static native Collector> toUnmodifiableMap(Function keyMapper, Function valueMapper); -} - public class StreamCollector10Inlining { @Nullable diff --git a/java/java-tests/testData/psi/cls/stubBuilder/Nullable.txt b/java/java-tests/testData/psi/cls/stubBuilder/Nullable.txt index 5f492a770b1b..867a42fb5626 100644 --- a/java/java-tests/testData/psi/cls/stubBuilder/Nullable.txt +++ b/java/java-tests/testData/psi/cls/stubBuilder/Nullable.txt @@ -9,6 +9,7 @@ PsiJavaFileStub [org.jetbrains.annotations] PsiRefListStub[IMPLEMENTS_LIST:] PsiMethodStub[annotation value:java.lang.String default=""] PsiModifierListStub[mask=1025] + PsiAnnotationStub[@org.jetbrains.annotations.NonNls] PsiTypeParameterListStub PsiParameterListStub PsiRefListStub[THROWS_LIST:] diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/AddAnnotationFixTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/AddAnnotationFixTest.java index 6716e2fe9633..9a3c519de792 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/AddAnnotationFixTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/AddAnnotationFixTest.java @@ -77,6 +77,7 @@ public class AddAnnotationFixTest extends UsefulTestCase { javaCodeStyleSettings.USE_EXTERNAL_ANNOTATIONS = false; } }); + ModuleRootModificationUtil.updateModel(myFixture.getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); } @Override diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/ExternalAnnotationsTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/ExternalAnnotationsTest.java index 95d69c4ab78f..a3a97c7d88b0 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/ExternalAnnotationsTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/ExternalAnnotationsTest.java @@ -40,6 +40,7 @@ public class ExternalAnnotationsTest extends UsefulTestCase { myFixture.setUp(); Module myModule = builder.getFixture().getModule(); ModuleRootModificationUtil.updateModel(myModule, model -> { + DefaultLightProjectDescriptor.addJetBrainsAnnotations(model); String contentUrl = VfsUtilCore.pathToUrl(myFixture.getTempDirPath()); model.addContentEntry(contentUrl).addSourceFolder(contentUrl + "/src", false); final JavaModuleExternalPaths extension = model.getModuleExtension(JavaModuleExternalPaths.class); diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/NullableNotNullManagerTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/NullableNotNullManagerTest.java index 04a076a40504..3ea60b714eab 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/NullableNotNullManagerTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/NullableNotNullManagerTest.java @@ -45,6 +45,7 @@ public class NullableNotNullManagerTest extends LightJavaCodeInsightFixtureTestC super.configureModule(module, model, contentEntry); VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByPath(JavaTestUtil.getJavaTestDataPath() + "/nullableAnnotations/"); + addJetBrainsAnnotations(model); MavenDependencyUtil.addFromMaven(model, "com.google.code.findbugs:jsr305:3.0.2"); // Library order is important PsiTestUtil.newLibrary("lib_2.0").classesRoot(file.findChild("lib_2.0")).addTo(model); diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionOrderingTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionOrderingTest.java index 3c05879c9339..35e180a1c1de 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionOrderingTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionOrderingTest.java @@ -404,8 +404,8 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase { @NeedsIndex.ForStandardLibrary public void testPreferApplicableAnnotations() { myFixture.addClass( - "\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Target;\n\n@Target(ElementType.ANNOTATION_TYPE)\n@interface TMetaAnno {}\n\n@Target(ElementType.LOCAL_VARIABLE)\n@interface TLocalAnno {}"); - checkPreferredItems(0, "TMetaAnno", "Target", "TabLayoutPolicy", "TabPlacement"); + "\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Target;\n\n@Target(ElementType.ANNOTATION_TYPE)\n@interface TtMetaAnno {}\n\n@Target(ElementType.LOCAL_VARIABLE)\n@interface TtLocalAnno {}"); + checkPreferredItems(0, "TtMetaAnno", "TtLocalAnno"); } @NeedsIndex.ForStandardLibrary diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionTest.java index 2a0a77c9799b..078489f8f43d 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/NormalCompletionTest.java @@ -1659,8 +1659,8 @@ public class NormalCompletionTest extends NormalCompletionTestCase { @NeedsIndex.SmartMode(reason = "JavaGenerateMemberCompletionContributor.fillCompletionVariants provides dialog option in smart mode only") public void testImplementViaOverrideCompletion() { configure(); - myFixture.assertPreferredCompletionItems(0, "Override", "Override/Implement methods...", "public void run"); - getLookup().setCurrentItem(getLookup().getItems().get(2)); + myFixture.assertPreferredCompletionItems(0, "Override", "OverrideOnly", "Override/Implement methods...", "MustBeInvokedByOverriders", "public void run"); + getLookup().setCurrentItem(getLookup().getItems().get(4)); myFixture.type('\n'); checkResult(); } @@ -1668,8 +1668,8 @@ public class NormalCompletionTest extends NormalCompletionTestCase { @NeedsIndex.SmartMode(reason = "JavaGenerateMemberCompletionContributor.fillCompletionVariants provides dialog option in smart mode only") public void testSuggestToOverrideMethodsWhenTypingOverrideAnnotation() { configure(); - myFixture.assertPreferredCompletionItems(0, "Override", "Override/Implement methods..."); - getLookup().setCurrentItem(getLookup().getItems().get(1)); + myFixture.assertPreferredCompletionItems(0, "Override", "OverrideOnly", "Override/Implement methods..."); + getLookup().setCurrentItem(getLookup().getItems().get(2)); myFixture.type('\n'); NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); checkResult(); @@ -1678,8 +1678,8 @@ public class NormalCompletionTest extends NormalCompletionTestCase { @NeedsIndex.SmartMode(reason = "JavaGenerateMemberCompletionContributor.fillCompletionVariants provides dialog option in smart mode only") public void testSuggestToOverrideMethodsWhenTypingOverrideAnnotationBeforeMethod() { configure(); - myFixture.assertPreferredCompletionItems(0, "Override", "Override/Implement methods..."); - getLookup().setCurrentItem(getLookup().getItems().get(1)); + myFixture.assertPreferredCompletionItems(0, "Override", "OverrideOnly", "Override/Implement methods..."); + getLookup().setCurrentItem(getLookup().getItems().get(2)); myFixture.type('\n'); NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); checkResult(); @@ -1688,8 +1688,8 @@ public class NormalCompletionTest extends NormalCompletionTestCase { @NeedsIndex.SmartMode(reason = "JavaGenerateMemberCompletionContributor.fillCompletionVariants provides dialog option in smart mode only") public void testSuggestToOverrideMethodsInMulticaretMode() { configure(); - myFixture.assertPreferredCompletionItems(0, "Override", "Override/Implement methods..."); - getLookup().setCurrentItem(getLookup().getItems().get(1)); + myFixture.assertPreferredCompletionItems(0, "Override", "OverrideOnly", "Override/Implement methods..."); + getLookup().setCurrentItem(getLookup().getItems().get(2)); myFixture.type('\n'); NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); checkResult(); diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/javadoc/JavaDocInfoGeneratorTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/javadoc/JavaDocInfoGeneratorTest.java index f87a660e9bc1..bdddc3ffdd6a 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/javadoc/JavaDocInfoGeneratorTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/javadoc/JavaDocInfoGeneratorTest.java @@ -28,6 +28,7 @@ import com.intellij.rt.execution.junit.FileComparisonFailure; import com.intellij.testFramework.DumbModeTestUtils; import com.intellij.testFramework.IdeaTestUtil; import com.intellij.testFramework.PsiTestUtil; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.lang.JavaVersion; import com.intellij.util.ui.UIUtil; @@ -55,6 +56,15 @@ public class JavaDocInfoGeneratorTest extends JavaCodeInsightTestCase { return IdeaTestUtil.getMockJdk(JavaVersion.compose(myJdkVersion)); } + @Override + protected void setUpModule() { + super.setUpModule(); + if (!getTestName(false).equals("HideNonDocumentedFlowAnnotations")) { + ModuleRootModificationUtil.updateModel( + myModule, model -> DefaultLightProjectDescriptor.addJetBrainsAnnotations(model)); + } + } + @Override protected @NotNull LanguageLevel getProjectLanguageLevel() { return LanguageLevel.HIGHEST; @@ -236,7 +246,7 @@ public class JavaDocInfoGeneratorTest extends JavaCodeInsightTestCase { } public void testHideNonDocumentedFlowAnnotations() { - Sdk sdk = removeAnnotationsJar(PsiTestUtil.addJdkAnnotations(IdeaTestUtil.getMockJdk17())); + Sdk sdk = PsiTestUtil.addJdkAnnotations(IdeaTestUtil.getMockJdk17()); WriteAction.runAndWait(() -> ProjectJdkTable.getInstance().addJdk(sdk, getTestRootDisposable())); ModuleRootModificationUtil.setModuleSdk(myModule, sdk); @@ -251,15 +261,6 @@ public class JavaDocInfoGeneratorTest extends JavaCodeInsightTestCase { assertFalse(doc, doc.contains("Flow")); } - private static Sdk removeAnnotationsJar(Sdk sdk) { - SdkModificator modificator = sdk.getSdkModificator(); - VirtualFile annotationsJar = ContainerUtil.find(modificator.getRoots(OrderRootType.CLASSES), r -> r.getName().contains("annotations")); - modificator.setName(modificator.getName() + "-" + annotationsJar.getPath()); - modificator.removeRoot(annotationsJar, OrderRootType.CLASSES); - modificator.commitChanges(); - return sdk; - } - public void testMatchingParameterNameFromParent() { configureByFile(); PsiClass psiClass = ((PsiJavaFile)myFile).getClasses()[1]; diff --git a/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspection10Test.java b/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspection10Test.java deleted file mode 100644 index 5a1d97e2faf6..000000000000 --- a/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspection10Test.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2000-2018 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.java.codeInspection; - -import com.intellij.JavaTestUtil; -import com.intellij.openapi.module.Module; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.roots.ContentEntry; -import com.intellij.openapi.roots.LanguageLevelModuleExtension; -import com.intellij.openapi.roots.ModifiableRootModel; -import com.intellij.pom.java.LanguageLevel; -import com.intellij.testFramework.IdeaTestUtil; -import com.intellij.testFramework.LightProjectDescriptor; -import com.intellij.testFramework.PsiTestUtil; -import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; -import org.jetbrains.annotations.NotNull; - -public class DataFlowInspection10Test extends DataFlowInspectionTestCase { - private static final DefaultLightProjectDescriptor PROJECT_DESCRIPTOR = new DefaultLightProjectDescriptor() { - @Override - public Sdk getSdk() { - return PsiTestUtil.addJdkAnnotations(IdeaTestUtil.getMockJdk(LanguageLevel.JDK_10.toJavaVersion())); - } - - @Override - public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { - model.getModuleExtension(LanguageLevelModuleExtension.class).setLanguageLevel(LanguageLevel.JDK_10); - } - }; - - @NotNull - @Override - protected LightProjectDescriptor getProjectDescriptor() { - return PROJECT_DESCRIPTOR; - } - - @Override - protected String getTestDataPath() { - return JavaTestUtil.getJavaTestDataPath() + "/inspection/dataFlow/fixture/"; - } - - public void testStreamCollector10Inlining() { doTest(); } - - public void testAvoidWarningAtNotInferredType() { doTest();} - - public void testSameArguments() { doTest(); } -} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspection11Test.java b/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspection11Test.java new file mode 100644 index 000000000000..497f7080c95b --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspection11Test.java @@ -0,0 +1,25 @@ +// Copyright 2000-2018 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.java.codeInspection; + +import com.intellij.JavaTestUtil; +import com.intellij.testFramework.LightProjectDescriptor; +import org.jetbrains.annotations.NotNull; + +public class DataFlowInspection11Test extends DataFlowInspectionTestCase { + @NotNull + @Override + protected LightProjectDescriptor getProjectDescriptor() { + return JAVA_11_ANNOTATED; + } + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath() + "/inspection/dataFlow/fixture/"; + } + + public void testStreamCollector10Inlining() { doTest(); } + + public void testAvoidWarningAtNotInferredType() { doTest();} + + public void testSameArguments() { doTest(); } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspectionTestSuite.java b/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspectionTestSuite.java index fd7b8ddace9d..bb508fba1de7 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspectionTestSuite.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInspection/DataFlowInspectionTestSuite.java @@ -16,7 +16,7 @@ import org.junit.platform.suite.api.Suite; DataFlowInspectionTest.class, DataFlowInspection8Test.class, DataFlowInspection9Test.class, - DataFlowInspection10Test.class, + DataFlowInspection11Test.class, DataFlowInspection16Test.class, DataFlowInspection20Test.class, DataFlowInspection21Test.class, diff --git a/java/java-tests/testSrc/com/intellij/java/codeInspection/bytecodeAnalysis/BytecodeAnalysisIntegrationTest.java b/java/java-tests/testSrc/com/intellij/java/codeInspection/bytecodeAnalysis/BytecodeAnalysisIntegrationTest.java index 4fe5c1f9ab0f..6bfa6a4d07cc 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInspection/bytecodeAnalysis/BytecodeAnalysisIntegrationTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInspection/bytecodeAnalysis/BytecodeAnalysisIntegrationTest.java @@ -55,6 +55,7 @@ public class BytecodeAnalysisIntegrationTest extends LightJavaCodeInsightFixture public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { super.configureModule(module, model, contentEntry); + addJetBrainsAnnotations(model); MavenDependencyUtil.addFromMaven(model, "org.apache.velocity:velocity:1.7"); MavenDependencyUtil.addFromMaven(model, "commons-collections:commons-collections:3.2.1"); diff --git a/java/java-tests/testSrc/com/intellij/java/codeInspection/bytecodeAnalysis/BytecodeAnalysisResultsHighlightingTest.java b/java/java-tests/testSrc/com/intellij/java/codeInspection/bytecodeAnalysis/BytecodeAnalysisResultsHighlightingTest.java index 76cbeb33f831..b0993615fb36 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInspection/bytecodeAnalysis/BytecodeAnalysisResultsHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInspection/bytecodeAnalysis/BytecodeAnalysisResultsHighlightingTest.java @@ -20,6 +20,7 @@ public class BytecodeAnalysisResultsHighlightingTest extends DataFlowInspectionT @Override public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { super.configureModule(module, model, contentEntry); + DefaultLightProjectDescriptor.addJetBrainsAnnotations(model); PsiTestUtil.addProjectLibrary(model, "velocity", IntelliJProjectConfiguration.getProjectLibraryClassesRootPaths("Velocity")); PsiTestUtil.addProjectLibrary(model, "commons-lang", IntelliJProjectConfiguration.getProjectLibraryClassesRootPaths("commons-lang3")); } diff --git a/java/java-tests/testSrc/com/intellij/java/psi/ClsStubBuilderTest.java b/java/java-tests/testSrc/com/intellij/java/psi/ClsStubBuilderTest.java index 52e390868d96..7a3199ba44e4 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/ClsStubBuilderTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/ClsStubBuilderTest.java @@ -2,6 +2,7 @@ package com.intellij.java.psi; import com.intellij.JavaTestUtil; +import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.io.IoTestUtil; import com.intellij.openapi.vfs.LocalFileSystem; @@ -11,11 +12,11 @@ import com.intellij.psi.impl.compiled.ClsFileImpl; import com.intellij.psi.stubs.PsiFileStub; import com.intellij.psi.stubs.StubBase; import com.intellij.testFramework.IdeaTestUtil; -import com.intellij.testFramework.LightIdeaTestCase; +import com.intellij.testFramework.LightJavaCodeInsightTestCase; import java.io.File; -public class ClsStubBuilderTest extends LightIdeaTestCase { +public class ClsStubBuilderTest extends LightJavaCodeInsightTestCase { public void testUtilList() { doClassTest("java.util.List"); } public void testNullable() { doClassTest("org.jetbrains.annotations.Nullable"); } public void testUtilCollections() { doClassTest("java.util.Collections"); } @@ -69,6 +70,11 @@ public class ClsStubBuilderTest extends LightIdeaTestCase { doTest(clsFile, getTestName(false) + ".txt"); } + @Override + protected Sdk getProjectJDK() { + return IdeaTestUtil.getMockJdk17(); + } + private static void doTest(VirtualFile clsFile, String resultFileName) { try { PsiFileStub stub = ClsFileImpl.buildFileStub(clsFile, clsFile.contentsToByteArray()); diff --git a/java/java-tests/testSrc/com/intellij/java/refactoring/SafeDeleteTest.java b/java/java-tests/testSrc/com/intellij/java/refactoring/SafeDeleteTest.java index 8f4797546cc9..1299c5ee99a8 100644 --- a/java/java-tests/testSrc/com/intellij/java/refactoring/SafeDeleteTest.java +++ b/java/java-tests/testSrc/com/intellij/java/refactoring/SafeDeleteTest.java @@ -9,6 +9,7 @@ import com.intellij.ide.scratch.ScratchRootType; import com.intellij.lang.java.JavaLanguage; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.openapi.roots.ModuleRootModificationUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.PsiClass; @@ -21,6 +22,7 @@ import com.intellij.refactoring.RefactoringSettings; import com.intellij.refactoring.safeDelete.SafeDeleteHandler; import com.intellij.testFramework.IdeaTestUtil; import com.intellij.testFramework.PsiTestUtil; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.intellij.util.PathUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -28,6 +30,12 @@ import org.jetbrains.jps.model.java.JavaSourceRootType; import org.jetbrains.jps.model.java.JpsJavaExtensionService; public class SafeDeleteTest extends MultiFileTestCase { + @Override + protected void setUp() throws Exception { + super.setUp(); + ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); + } + @NotNull @Override protected String getTestDataPath() { diff --git a/java/java-tests/testSrc/com/intellij/java/slicer/SliceBackwardTest.java b/java/java-tests/testSrc/com/intellij/java/slicer/SliceBackwardTest.java index 3f349a1fb2f4..68d2f48df22d 100644 --- a/java/java-tests/testSrc/com/intellij/java/slicer/SliceBackwardTest.java +++ b/java/java-tests/testSrc/com/intellij/java/slicer/SliceBackwardTest.java @@ -18,14 +18,12 @@ package com.intellij.java.slicer; import com.intellij.analysis.AnalysisScope; import com.intellij.codeInsight.daemon.impl.HighlightInfo; import com.intellij.execution.filters.ExceptionAnalysisProvider; +import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.openapi.editor.RangeMarker; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; import com.intellij.slicer.*; -import com.intellij.testFramework.IdeaTestUtil; -import com.intellij.testFramework.PsiTestUtil; +import com.intellij.testFramework.LightProjectDescriptor; import com.intellij.util.ArrayUtil; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; @@ -36,8 +34,8 @@ import java.util.Map; public class SliceBackwardTest extends SliceTestCase { @Override - protected Sdk getTestProjectJdk() { - return PsiTestUtil.addJdkAnnotations(IdeaTestUtil.getMockJdk11()); + protected @NotNull LightProjectDescriptor getProjectDescriptor() { + return JAVA_17_ANNOTATED; } private void doTest() throws Exception { @@ -49,18 +47,18 @@ public class SliceBackwardTest extends SliceTestCase { } @Override - protected @NotNull LanguageLevel getProjectLanguageLevel() { - return LanguageLevel.JDK_16; + protected String getBasePath() { + return "/java/java-tests/testData/codeInsight/slice/backward/"; } private void doTest(@NotNull String filter, @NotNull String @NotNull... stack) throws Exception { - configureByFile("/codeInsight/slice/backward/"+getTestName(false)+".java"); + myFixture.configureByFile(getTestName(false)+".java"); Map sliceUsageName2Offset = SliceTestUtil.extractSliceOffsetsFromDocument(getEditor().getDocument()); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); PsiElement element = SliceHandler.create(true).getExpressionAtCaret(getEditor(), getFile()); assertNotNull(element); SliceTestUtil.Node tree = SliceTestUtil.buildTree(element, sliceUsageName2Offset); - Collection errors = highlightErrors(); + Collection errors = myFixture.doHighlighting(HighlightSeverity.ERROR); assertEmpty(errors); SliceAnalysisParams params = new SliceAnalysisParams(); params.scope = new AnalysisScope(getProject()); diff --git a/java/java-tests/testSrc/com/intellij/java/slicer/SliceForwardTest.java b/java/java-tests/testSrc/com/intellij/java/slicer/SliceForwardTest.java index 960375c08dd2..cb61380737f0 100644 --- a/java/java-tests/testSrc/com/intellij/java/slicer/SliceForwardTest.java +++ b/java/java-tests/testSrc/com/intellij/java/slicer/SliceForwardTest.java @@ -17,6 +17,7 @@ package com.intellij.java.slicer; import com.intellij.analysis.AnalysisScope; import com.intellij.codeInsight.daemon.impl.HighlightInfo; +import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.openapi.editor.RangeMarker; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; @@ -26,14 +27,19 @@ import java.util.Collection; import java.util.Map; public class SliceForwardTest extends SliceTestCase { - private void dotest() throws Exception { - configureByFile("/codeInsight/slice/forward/"+getTestName(false)+".java"); + @Override + protected String getBasePath() { + return "/java/java-tests/testData/codeInsight/slice/forward/"; + } + + private void dotest() { + myFixture.configureByFile(getTestName(false)+".java"); Map sliceUsageName2Offset = SliceTestUtil.extractSliceOffsetsFromDocument(getEditor().getDocument()); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); PsiElement element = SliceHandler.create(false).getExpressionAtCaret(getEditor(), getFile()); assertNotNull(element); SliceTestUtil.Node tree = SliceTestUtil.buildTree(element, sliceUsageName2Offset); - Collection errors = highlightErrors(); + Collection errors = myFixture.doHighlighting(HighlightSeverity.ERROR); assertEmpty(errors); SliceAnalysisParams params = new SliceAnalysisParams(); params.scope = new AnalysisScope(getProject()); @@ -42,14 +48,14 @@ public class SliceForwardTest extends SliceTestCase { SliceTestUtil.checkUsages(usage, tree); } - public void testSimple() throws Exception { dotest();} - public void testInterMethod() throws Exception { dotest();} - public void testParameters() throws Exception { dotest();} - public void testRequireNonNull() throws Exception { dotest();} - public void testAppend() throws Exception { dotest();} - public void testOverloadedMember() throws Exception { dotest();} - public void testOverloadedMember2() throws Exception { dotest();} - public void testOverloadedMember3() throws Exception { dotest();} - public void testOneInterfaceTwoImplementations() throws Exception { dotest();} - public void testOneInterfaceTwoImplementations2() throws Exception { dotest();} + public void testSimple() { dotest();} + public void testInterMethod() { dotest();} + public void testParameters() { dotest();} + public void testRequireNonNull() { dotest();} + public void testAppend() { dotest();} + public void testOverloadedMember() { dotest();} + public void testOverloadedMember2() { dotest();} + public void testOverloadedMember3() { dotest();} + public void testOneInterfaceTwoImplementations() { dotest();} + public void testOneInterfaceTwoImplementations2() { dotest();} } \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/slicer/SliceTestCase.java b/java/java-tests/testSrc/com/intellij/java/slicer/SliceTestCase.java index 33bff16b2d79..d9c419fac0de 100644 --- a/java/java-tests/testSrc/com/intellij/java/slicer/SliceTestCase.java +++ b/java/java-tests/testSrc/com/intellij/java/slicer/SliceTestCase.java @@ -15,14 +15,13 @@ */ package com.intellij.java.slicer; -import com.intellij.codeInsight.daemon.DaemonAnalyzerTestCase; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.testFramework.IdeaTestUtil; -import com.intellij.testFramework.PsiTestUtil; +import com.intellij.testFramework.LightProjectDescriptor; +import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase; +import org.jetbrains.annotations.NotNull; -public abstract class SliceTestCase extends DaemonAnalyzerTestCase { +public abstract class SliceTestCase extends LightJavaCodeInsightFixtureTestCase { @Override - protected Sdk getTestProjectJdk() { - return PsiTestUtil.addJdkAnnotations(IdeaTestUtil.getMockJdk17()); + protected @NotNull LightProjectDescriptor getProjectDescriptor() { + return JAVA_1_7_ANNOTATED; } } diff --git a/java/java-tests/testSrc/com/intellij/java/slicer/SliceTreeTest.java b/java/java-tests/testSrc/com/intellij/java/slicer/SliceTreeTest.java index 1c84daefd07e..9b87e52e2e02 100644 --- a/java/java-tests/testSrc/com/intellij/java/slicer/SliceTreeTest.java +++ b/java/java-tests/testSrc/com/intellij/java/slicer/SliceTreeTest.java @@ -3,6 +3,8 @@ package com.intellij.java.slicer; import com.intellij.analysis.AnalysisScope; import com.intellij.codeInsight.daemon.impl.HighlightInfo; +import com.intellij.lang.annotation.HighlightSeverity; +import com.intellij.openapi.actionSystem.IdeActions; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; @@ -19,12 +21,17 @@ import org.jetbrains.annotations.NonNls; import java.util.*; public class SliceTreeTest extends SliceTestCase { - private SliceTreeStructure configureTree(@NonNls String name) throws Exception { - configureByFile("/codeInsight/slice/backward/"+ name +".java"); + @Override + protected String getBasePath() { + return "/java/java-tests/testData/codeInsight/slice/backward/"; + } + + private SliceTreeStructure configureTree(@NonNls String name) { + myFixture.configureByFile(name + ".java"); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); PsiElement element = SliceHandler.create(true).getExpressionAtCaret(getEditor(), getFile()); assertNotNull(element); - Collection errors = highlightErrors(); + Collection errors = myFixture.doHighlighting(HighlightSeverity.ERROR); assertEmpty(errors); SliceAnalysisParams params = new SliceAnalysisParams(); @@ -34,7 +41,7 @@ public class SliceTreeTest extends SliceTestCase { SliceUsage usage = LanguageSlicing.getProvider(element).createRootUsage(element, params); - ToolWindowHeadlessManagerImpl.MockToolWindow toolWindow = new ToolWindowHeadlessManagerImpl.MockToolWindow(myProject); + ToolWindowHeadlessManagerImpl.MockToolWindow toolWindow = new ToolWindowHeadlessManagerImpl.MockToolWindow(getProject()); SlicePanel panel = new SlicePanel(getProject(), true, new SliceRootNode(getProject(), new DuplicateMap(), usage), false, toolWindow) { @Override public boolean isAutoScroll() { @@ -68,7 +75,7 @@ public class SliceTreeTest extends SliceTestCase { } } - public void testTypingDoesNotInterfereWithDuplicates() throws Exception { + public void testTypingDoesNotInterfereWithDuplicates() { SliceTreeStructure treeStructure = configureTree("DupSlice"); SliceNode root = treeStructure.getRootElement(); List nodes = new ArrayList<>(); @@ -83,7 +90,7 @@ public class SliceTreeTest extends SliceTestCase { } } - type(" xx"); + myFixture.type(" xx"); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); backspace(); backspace(); @@ -109,7 +116,11 @@ public class SliceTreeTest extends SliceTestCase { assertTrue(hasDups.isEmpty()); } - public void testLeafExpressionsAreEmptyInCaseOfInfinitelyExpandingTreeWithDuplicateNodes() throws Exception { + private void backspace() { + myFixture.performEditorAction(IdeActions.ACTION_EDITOR_BACKSPACE); + } + + public void testLeafExpressionsAreEmptyInCaseOfInfinitelyExpandingTreeWithDuplicateNodes() { SliceTreeStructure treeStructure = configureTree("Tuple"); SliceNode root = treeStructure.getRootElement(); SliceLeafAnalyzer analyzer = JavaSlicerAnalysisUtil.createLeafAnalyzer(); @@ -118,7 +129,7 @@ public class SliceTreeTest extends SliceTestCase { assertEmpty(leaves); } - public void testLeafExpressionsSimple() throws Exception { + public void testLeafExpressionsSimple() { SliceTreeStructure treeStructure = configureTree("DupSlice"); SliceNode root = treeStructure.getRootElement(); SliceLeafAnalyzer analyzer = JavaSlicerAnalysisUtil.createLeafAnalyzer(); @@ -129,7 +140,7 @@ public class SliceTreeTest extends SliceTestCase { assertEquals(1111111111, ((PsiLiteral)element).getValue()); } - public void testLeafExpressionsMoreComplex() throws Exception { + public void testLeafExpressionsMoreComplex() { SliceTreeStructure treeStructure = configureTree("Duplicate"); SliceNode root = treeStructure.getRootElement(); SliceLeafAnalyzer analyzer = JavaSlicerAnalysisUtil.createLeafAnalyzer(); @@ -147,7 +158,7 @@ public class SliceTreeTest extends SliceTestCase { } @SuppressWarnings("ConstantConditions") - public void testGroupByValuesCorrectLeaves() throws Exception { + public void testGroupByValuesCorrectLeaves() { SliceTreeStructure treeStructure = configureTree("DuplicateLeaves"); SliceRootNode root = treeStructure.getRootElement(); SliceLeafAnalyzer analyzer = JavaSlicerAnalysisUtil.createLeafAnalyzer(); @@ -192,7 +203,7 @@ public class SliceTreeTest extends SliceTestCase { assertEquals(child.getValue().getElement(), leaf); } - public void testNullness() throws Exception { + public void testNullness() { SliceTreeStructure treeStructure = configureTree("Nulls"); SliceRootNode root = treeStructure.getRootElement(); Map map = SliceNullnessAnalyzerBase.createMap(); @@ -292,7 +303,7 @@ public class SliceTreeTest extends SliceTestCase { assertEquals(dataExpected, dataActual); } - public void testDoubleNullness() throws Exception { + public void testDoubleNullness() { SliceTreeStructure treeStructure = configureTree("DoubleNulls"); SliceRootNode root = treeStructure.getRootElement(); Map map = SliceNullnessAnalyzerBase.createMap(); @@ -310,7 +321,7 @@ public class SliceTreeTest extends SliceTestCase { """); } - public void testGroupByLeavesWithLists() throws Exception { + public void testGroupByLeavesWithLists() { SliceTreeStructure treeStructure = configureTree(getTestName(false)); SliceRootNode root = treeStructure.getRootElement(); SliceLeafAnalyzer analyzer = JavaSlicerAnalysisUtil.createLeafAnalyzer(); @@ -321,13 +332,13 @@ public class SliceTreeTest extends SliceTestCase { assertEquals(ContainerUtil.newHashSet("\"uuu\"", "\"xxx\""), names); } - public void testCollectionTrack() throws Exception { + public void testCollectionTrack() { Set names = groupByLeaves(); assertEquals(3, names.size()); assertEquals(ContainerUtil.newHashSet("\"uuu\"", "\"x\"", "\"y\""), names); } - private Set groupByLeaves() throws Exception { + private Set groupByLeaves() { SliceTreeStructure treeStructure = configureTree(getTestName(false)); SliceRootNode root = treeStructure.getRootElement(); SliceLeafAnalyzer analyzer = JavaSlicerAnalysisUtil.createLeafAnalyzer(); @@ -336,17 +347,17 @@ public class SliceTreeTest extends SliceTestCase { return ContainerUtil.map2Set(leaves, PsiElement::getText); } - public void testArrayCopyTrack() throws Exception { + public void testArrayCopyTrack() { Set names = groupByLeaves(); assertOrderedEquals(Collections.singletonList("\"x\""), assertOneElement(names)); } - public void testMapValuesTrack() throws Exception { + public void testMapValuesTrack() { Set names = groupByLeaves(); assertOrderedEquals(Collections.singletonList("\"y\""), assertOneElement(names)); } - public void testMapKeysTrack() throws Exception { + public void testMapKeysTrack() { Set names = groupByLeaves(); assertOrderedEquals(Collections.singletonList("\"x\""), assertOneElement(names)); } diff --git a/java/java-tests/testSrc/com/intellij/projectView/PackagesTreeStructureTest.java b/java/java-tests/testSrc/com/intellij/projectView/PackagesTreeStructureTest.java index ae27e96eb052..bb551353cf47 100644 --- a/java/java-tests/testSrc/com/intellij/projectView/PackagesTreeStructureTest.java +++ b/java/java-tests/testSrc/com/intellij/projectView/PackagesTreeStructureTest.java @@ -100,10 +100,6 @@ public class PackagesTreeStructureTest extends TestSourceBasedTestCase { SwingUtilities.class -PsiPackage: META-INF MANIFEST.MF - MANIFEST.MF - -PsiPackage: org - +PsiPackage: intellij.lang.annotations - +PsiPackage: jetbrains.annotations LICENSE """ , 4); @@ -151,10 +147,6 @@ public class PackagesTreeStructureTest extends TestSourceBasedTestCase { SwingUtilities.class -PsiPackage: META-INF MANIFEST.MF - MANIFEST.MF - -PsiPackage: org - +PsiPackage: intellij.lang.annotations - +PsiPackage: jetbrains.annotations LICENSE """ , 3); diff --git a/java/java-tests/testSrc/com/siyeh/ig/fixes/PointlessBooleanExpressionFixTest.java b/java/java-tests/testSrc/com/siyeh/ig/fixes/PointlessBooleanExpressionFixTest.java index 1ae1e68de8d5..a51011826d78 100644 --- a/java/java-tests/testSrc/com/siyeh/ig/fixes/PointlessBooleanExpressionFixTest.java +++ b/java/java-tests/testSrc/com/siyeh/ig/fixes/PointlessBooleanExpressionFixTest.java @@ -4,6 +4,8 @@ package com.siyeh.ig.fixes; +import com.intellij.openapi.roots.ModuleRootModificationUtil; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.IGQuickFixesTestCase; import com.siyeh.ig.controlflow.PointlessBooleanExpressionInspection; @@ -17,6 +19,7 @@ public class PointlessBooleanExpressionFixTest extends IGQuickFixesTestCase { myFixture.enableInspections(inspection); myRelativePath = "pointlessboolean"; myDefaultHint = InspectionGadgetsBundle.message("constant.conditional.expression.simplify.quickfix"); + ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); } public void testNegation() { doTest(); } diff --git a/java/java-tests/testSrc/com/siyeh/ig/fixes/dataflow/CreateNullBranchFixTest.java b/java/java-tests/testSrc/com/siyeh/ig/fixes/dataflow/CreateNullBranchFixTest.java index 3f73aa5c7d2f..7345e313937e 100644 --- a/java/java-tests/testSrc/com/siyeh/ig/fixes/dataflow/CreateNullBranchFixTest.java +++ b/java/java-tests/testSrc/com/siyeh/ig/fixes/dataflow/CreateNullBranchFixTest.java @@ -2,8 +2,10 @@ package com.siyeh.ig.fixes.dataflow; import com.intellij.codeInspection.dataFlow.DataFlowInspection; +import com.intellij.openapi.roots.ModuleRootModificationUtil; import com.intellij.pom.java.LanguageLevel; import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.IGQuickFixesTestCase; @@ -14,6 +16,7 @@ public class CreateNullBranchFixTest extends IGQuickFixesTestCase { super.setUp(); myFixture.enableInspections(new DataFlowInspection()); myRelativePath = "dataflow/create_null_branch"; + ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); } @Override diff --git a/java/java-tests/testSrc/com/siyeh/ig/fixes/migration/IfCanBePatternSwitchFixTest.java b/java/java-tests/testSrc/com/siyeh/ig/fixes/migration/IfCanBePatternSwitchFixTest.java index 9b8008fb10ee..840948896b73 100644 --- a/java/java-tests/testSrc/com/siyeh/ig/fixes/migration/IfCanBePatternSwitchFixTest.java +++ b/java/java-tests/testSrc/com/siyeh/ig/fixes/migration/IfCanBePatternSwitchFixTest.java @@ -2,10 +2,12 @@ package com.siyeh.ig.fixes.migration; import com.intellij.codeInspection.CommonQuickFixBundle; +import com.intellij.openapi.roots.ModuleRootModificationUtil; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.PsiKeyword; import com.intellij.testFramework.IdeaTestUtil; import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.siyeh.ig.IGQuickFixesTestCase; import com.siyeh.ig.migration.IfCanBeSwitchInspection; @@ -18,6 +20,7 @@ public class IfCanBePatternSwitchFixTest extends IGQuickFixesTestCase { myFixture.enableInspections(inspection); myRelativePath = "migration/if_can_be_switch"; myDefaultHint = CommonQuickFixBundle.message("fix.replace.x.with.y", PsiKeyword.IF, PsiKeyword.SWITCH); + ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); } @Override diff --git a/java/java-tests/testSrc/com/siyeh/ig/fixes/style/LambdaCanBeReplacedWithAnonymousFixTest.java b/java/java-tests/testSrc/com/siyeh/ig/fixes/style/LambdaCanBeReplacedWithAnonymousFixTest.java index d7ef9edbf8bb..dee5a0c0b9c6 100644 --- a/java/java-tests/testSrc/com/siyeh/ig/fixes/style/LambdaCanBeReplacedWithAnonymousFixTest.java +++ b/java/java-tests/testSrc/com/siyeh/ig/fixes/style/LambdaCanBeReplacedWithAnonymousFixTest.java @@ -17,8 +17,10 @@ package com.siyeh.ig.fixes.style; import com.intellij.application.options.CodeStyle; import com.intellij.lang.java.JavaLanguage; +import com.intellij.openapi.roots.ModuleRootModificationUtil; import com.intellij.psi.codeStyle.CodeStyleSettings; import com.intellij.psi.codeStyle.CommonCodeStyleSettings; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.IGQuickFixesTestCase; import com.siyeh.ig.style.LambdaCanBeReplacedWithAnonymousInspection; @@ -29,6 +31,7 @@ public class LambdaCanBeReplacedWithAnonymousFixTest extends IGQuickFixesTestCas super.setUp(); myFixture.enableInspections(new LambdaCanBeReplacedWithAnonymousInspection()); myDefaultHint = InspectionGadgetsBundle.message("lambda.can.be.replaced.with.anonymous.quickfix"); + ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); } public void testSimpleRunnable() { diff --git a/java/mockJDK-1.7/jre/lib/annotations.jar b/java/mockJDK-1.7/jre/lib/annotations.jar deleted file mode 100644 index cfbf21525baec2e548915074fc12bcf389eb6cab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23831 zcmeHPdvF`ad0+5#BnXIaQKVjwL`noH@u?@J$O1{wf<%!F0Wp?oSp$Jb3Ni%H04P(A zlv*=((x!RI_NY}e{lgvCYC1`5Sx)SvsmE5-s+FSpHFZ77q_N^A>K}Dd+if$cU;TY| z0Pb#aIPeHIGG~IByT#q@?zfNMe*5kBeY?YZ^9!tu6*G3_%tLOb`jxN(w$JTzZSV~C zw|#V#vEfwIzem(>Z@G4I64B|Z#+8b?&o$`jcYA%U`}+6!!@&tL7T+)`Mq|N9xZBau z+HSYH!m2l}DSzOI=)gOC+}66$ZtabV{W?Ewr`>9|Dh2!JiIAoa1t?e~I@y*vhCLA@7>fb8OJ$E4&{~v8dsK`cj{1XPbzC>sQT1tYGt>BubFBLuT7|BrtmW$uMeb`2g#5AC z)sMdaJfe577J;o5*gAnVS=gdJcfV`@fbWoZX#YsB+rlabj{1-L+oX2!#-qXTo}D5r~B2=u$+W=;&KCP9T++Hj#x@$Yt}y(2R023(IeE-kFc?U?_SV#6^^6 z!k3`*ne z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C0ixmEm3s^DSe&!Fe}dl&6;t>xWdEVY$YP|yFn zI4FtXXI*NxVOJHHg;?1{qGw36wiy}>CdNW?p0e6p&+{sd^R_8uN!4swP+2djXL{zk zZKftIWmQon9h9Ey@7%D<)u=VHEUv7E&@=vz1-p#P3+HlgwX#kG9%w=O9%M-0GC%z< DHLDCK diff --git a/java/mockJDK-1.8/jre/lib/annotations.jar_LICENSE b/java/mockJDK-1.8/jre/lib/annotations.jar_LICENSE deleted file mode 100644 index 4c4a741bfd61..000000000000 --- a/java/mockJDK-1.8/jre/lib/annotations.jar_LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2000-2016 JetBrains s.r.o. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/java/mockJDK-1.9/jre/lib/annotations.jar b/java/mockJDK-1.9/jre/lib/annotations.jar deleted file mode 100644 index b78e2de180d4dda13f4350cb13237982fece9189..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24037 zcmeHPYit`=c0Lp-jYN^wTbBHYX z&K;67b2%JxM0LGFm%z;B%-nm=eSG)abI&>VMsK=3UZQrQ58n9oFd2RwR%x0*Uo?c)lEd_s~=Y->SAaqG9Qk`rxxcI6PeV8nlDVQs=0hBo4FX6 znL6qBhBAgXp{+#nMKyqT`1thH8NYWnrzQ&O`sB689RK{($-8G~ChyIh4va7763Mh0 zn9b(4vbjV7IR^b+zgI8VUvH#Mb?~5I+1%!I?HK-2j8vwerqikWHc@-!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I&~yGFmIL-Vn_cXaeEOfkCYbPCKZd(D_B}}Jr=S)2sMh7vuVPsDn zJ>N^`>*Z_k%aOB{U0U>PBNw!6b-C0ixmEm3s^DSe&!Fe}dl&6;t>xWdEVY$YP|yFn zI4FtXXI*NxVOJHHg;?1{qGw36wiy}>CdNW?p0e6p&+{sd^R_8uN!4swP+2djXL{zk zZKftIWmQon9h9Ey@7%D<)u=VHEUv7E&@=vz1-p#P3+HlgwX#kG9%w=O9%M-0GC%z< DHLDCK diff --git a/java/testFramework/src/com/intellij/testFramework/LightJavaCodeInsightTestCase.java b/java/testFramework/src/com/intellij/testFramework/LightJavaCodeInsightTestCase.java index c4ba6ddabee9..5435b5cf353d 100644 --- a/java/testFramework/src/com/intellij/testFramework/LightJavaCodeInsightTestCase.java +++ b/java/testFramework/src/com/intellij/testFramework/LightJavaCodeInsightTestCase.java @@ -2,12 +2,16 @@ package com.intellij.testFramework; import com.intellij.openapi.Disposable; +import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleTypeId; import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.roots.ContentEntry; import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.openapi.roots.ModifiableRootModel; import com.intellij.openapi.util.Disposer; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.impl.JavaPsiFacadeEx; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import org.jetbrains.annotations.NotNull; import java.util.regex.Matcher; @@ -90,6 +94,16 @@ public abstract class LightJavaCodeInsightTestCase extends LightPlatformCodeInsi return IdeaTestUtil.getMockJdk18(); } + @Override + protected @NotNull LightProjectDescriptor getProjectDescriptor() { + return new SimpleLightProjectDescriptor(getModuleTypeId(), getProjectJDK()) { + @Override + protected void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { + DefaultLightProjectDescriptor.addJetBrainsAnnotations(model); + } + }; + } + @NotNull @Override protected String getModuleTypeId() { diff --git a/java/testFramework/src/com/intellij/testFramework/fixtures/DefaultLightProjectDescriptor.java b/java/testFramework/src/com/intellij/testFramework/fixtures/DefaultLightProjectDescriptor.java index 486eaf340cbd..5b6e3ecd456c 100644 --- a/java/testFramework/src/com/intellij/testFramework/fixtures/DefaultLightProjectDescriptor.java +++ b/java/testFramework/src/com/intellij/testFramework/fixtures/DefaultLightProjectDescriptor.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.function.Supplier; public class DefaultLightProjectDescriptor extends LightProjectDescriptor { - + private static final String JETBRAINS_ANNOTATIONS_COORDINATES = "org.jetbrains:annotations-java5:24.0.0"; private @Nullable Supplier customSdk; private final List mavenLibraries = new ArrayList<>(); @@ -80,6 +80,20 @@ public class DefaultLightProjectDescriptor extends LightProjectDescriptor { mavenLibraries.add(new RequiredLibrary(library, includeTransitive)); return this; } + + public DefaultLightProjectDescriptor withJetBrainsAnnotations() { + return withRepositoryLibrary(JETBRAINS_ANNOTATIONS_COORDINATES); + } + + /** + * Adds old non-type-use JetBrains annotations as a module dependency. + * Currently, many tests assume that this dependency is present. + * + * @param model model to modify + */ + public static void addJetBrainsAnnotations(@NotNull ModifiableRootModel model) { + MavenDependencyUtil.addFromMaven(model, JETBRAINS_ANNOTATIONS_COORDINATES); + } private static class RequiredLibrary { public final String mavenCoordinates; diff --git a/java/testFramework/src/com/intellij/testFramework/fixtures/LightJavaCodeInsightFixtureTestCase.java b/java/testFramework/src/com/intellij/testFramework/fixtures/LightJavaCodeInsightFixtureTestCase.java index edb973aa08cb..4fd352782372 100644 --- a/java/testFramework/src/com/intellij/testFramework/fixtures/LightJavaCodeInsightFixtureTestCase.java +++ b/java/testFramework/src/com/intellij/testFramework/fixtures/LightJavaCodeInsightFixtureTestCase.java @@ -56,6 +56,7 @@ public abstract class LightJavaCodeInsightFixtureTestCase extends UsefulTestCase @Override public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { model.getModuleExtension(LanguageLevelModuleExtension.class).setLanguageLevel(myLanguageLevel); + addJetBrainsAnnotations(model); } } @@ -78,6 +79,7 @@ public abstract class LightJavaCodeInsightFixtureTestCase extends UsefulTestCase public static final @NotNull LightProjectDescriptor JAVA_15 = new ProjectDescriptor(LanguageLevel.JDK_15); public static final @NotNull LightProjectDescriptor JAVA_16 = new ProjectDescriptor(LanguageLevel.JDK_16); public static final @NotNull LightProjectDescriptor JAVA_17 = new ProjectDescriptor(LanguageLevel.JDK_17); + public static final @NotNull LightProjectDescriptor JAVA_17_ANNOTATED = new ProjectDescriptor(LanguageLevel.JDK_17, true); public static final @NotNull LightProjectDescriptor JAVA_18 = new ProjectDescriptor(LanguageLevel.JDK_18); public static final @NotNull LightProjectDescriptor JAVA_19 = new ProjectDescriptor(LanguageLevel.JDK_19); public static final @NotNull LightProjectDescriptor JAVA_20 = new ProjectDescriptor(LanguageLevel.JDK_20_PREVIEW); diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/inspection/SSBasedInspectionTestCase.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/inspection/SSBasedInspectionTestCase.java index caf54a1b9e29..b36cfbe9fbfa 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/inspection/SSBasedInspectionTestCase.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/inspection/SSBasedInspectionTestCase.java @@ -13,6 +13,8 @@ import com.intellij.testFramework.fixtures.*; import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl; import org.jetbrains.annotations.NotNull; +import static com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.JAVA_1_7; + /** * @author Bas Leijdekkers */ @@ -25,7 +27,7 @@ public abstract class SSBasedInspectionTestCase extends UsefulTestCase { super.setUp(); final IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory(); final TestFixtureBuilder fixtureBuilder = - factory.createLightFixtureBuilder(new DefaultLightProjectDescriptor(), getTestName(false)); + factory.createLightFixtureBuilder(JAVA_1_7, getTestName(false)); final IdeaProjectTestFixture fixture = fixtureBuilder.getFixture(); myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture, new LightTempDirTestFixtureImpl(true)); myInspection = new SSBasedInspection(); diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java index 1e635a1ad377..eee01c40d37b 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java @@ -36,10 +36,7 @@ import com.intellij.openapi.project.RootsChangeRescanningInfo; import com.intellij.openapi.project.ex.ProjectManagerEx; import com.intellij.openapi.project.impl.ProjectImpl; import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.roots.AnnotationOrderRootType; -import com.intellij.openapi.roots.ModuleRootManager; -import com.intellij.openapi.roots.OrderRootType; -import com.intellij.openapi.roots.ProjectRootManager; +import com.intellij.openapi.roots.*; import com.intellij.openapi.roots.ex.ProjectRootManagerEx; import com.intellij.openapi.roots.impl.ProjectRootManagerImpl; import com.intellij.openapi.roots.impl.libraries.LibraryTableTracker; @@ -626,7 +623,7 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da ourProject = project; } - private static class SimpleLightProjectDescriptor extends LightProjectDescriptor { + protected static class SimpleLightProjectDescriptor extends LightProjectDescriptor { private final @NotNull String myModuleTypeId; private final @Nullable Sdk mySdk; diff --git a/plugins/IntelliLang/IntelliLang-tests/test/com/intellij/psi/impl/source/tree/injected/JavaInjectedFileChangesHandlerTest.kt b/plugins/IntelliLang/IntelliLang-tests/test/com/intellij/psi/impl/source/tree/injected/JavaInjectedFileChangesHandlerTest.kt index 9c177f3caafd..77be5a88211f 100644 --- a/plugins/IntelliLang/IntelliLang-tests/test/com/intellij/psi/impl/source/tree/injected/JavaInjectedFileChangesHandlerTest.kt +++ b/plugins/IntelliLang/IntelliLang-tests/test/com/intellij/psi/impl/source/tree/injected/JavaInjectedFileChangesHandlerTest.kt @@ -15,6 +15,7 @@ import com.intellij.openapi.editor.Document import com.intellij.openapi.editor.Editor import com.intellij.openapi.fileEditor.TextEditor import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider +import com.intellij.openapi.roots.ModuleRootModificationUtil import com.intellij.openapi.ui.TestDialog import com.intellij.openapi.ui.TestDialogManager import com.intellij.openapi.util.TextRange @@ -23,6 +24,7 @@ import com.intellij.psi.codeStyle.CodeStyleManager import com.intellij.psi.injection.Injectable import com.intellij.psi.util.parentOfType import com.intellij.testFramework.UsefulTestCase +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor import com.intellij.testFramework.fixtures.InjectionTestFixture import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase import com.intellij.util.SmartList @@ -35,6 +37,11 @@ import org.jetbrains.uast.expressions.UStringConcatenationsFacade class JavaInjectedFileChangesHandlerTest : JavaCodeInsightFixtureTestCase() { + override fun setUp() { + super.setUp() + ModuleRootModificationUtil.updateModel(module, DefaultLightProjectDescriptor::addJetBrainsAnnotations) + } + fun `test edit multiline in fragment-editor`() { with(myFixture) { diff --git a/plugins/devkit/devkit-kotlin-tests/testSrc/org/jetbrains/idea/devkit/kotlin/navigation/KtPropertyKeyFoldingTest.kt b/plugins/devkit/devkit-kotlin-tests/testSrc/org/jetbrains/idea/devkit/kotlin/navigation/KtPropertyKeyFoldingTest.kt index cb168b3d116d..6a12c14f8898 100644 --- a/plugins/devkit/devkit-kotlin-tests/testSrc/org/jetbrains/idea/devkit/kotlin/navigation/KtPropertyKeyFoldingTest.kt +++ b/plugins/devkit/devkit-kotlin-tests/testSrc/org/jetbrains/idea/devkit/kotlin/navigation/KtPropertyKeyFoldingTest.kt @@ -2,13 +2,20 @@ package org.jetbrains.idea.devkit.kotlin.navigation import com.intellij.codeInsight.assertFolded +import com.intellij.openapi.roots.ModuleRootModificationUtil import com.intellij.testFramework.IdeaTestUtil import com.intellij.testFramework.builders.JavaModuleFixtureBuilder +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase import com.intellij.util.PathUtil class KtPropertyKeyFoldingTest : JavaCodeInsightFixtureTestCase() { + override fun setUp() { + super.setUp() + ModuleRootModificationUtil.updateModel(module, DefaultLightProjectDescriptor::addJetBrainsAnnotations) + } + override fun tuneFixture(moduleBuilder: JavaModuleFixtureBuilder<*>) { super.tuneFixture(moduleBuilder) moduleBuilder.addJdk(IdeaTestUtil.getMockJdk18Path().path) diff --git a/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/PluginModuleTestCase.java b/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/PluginModuleTestCase.java index b89b5241effb..c542a2cad34d 100644 --- a/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/PluginModuleTestCase.java +++ b/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/PluginModuleTestCase.java @@ -15,6 +15,9 @@ */ package org.jetbrains.idea.devkit.inspections; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.roots.ContentEntry; +import com.intellij.openapi.roots.ModifiableRootModel; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.LightProjectDescriptor; import com.intellij.testFramework.TestDataFile; @@ -27,6 +30,11 @@ import org.jetbrains.idea.devkit.module.PluginModuleType; public abstract class PluginModuleTestCase extends LightJavaCodeInsightFixtureTestCase { private static final DefaultLightProjectDescriptor ourProjectDescriptor = new DefaultLightProjectDescriptor() { + @Override + public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { + super.configureModule(module, model, contentEntry); + addJetBrainsAnnotations(model); + } @NotNull @Override diff --git a/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/internal/UnsafeReturnStatementVisitorInspectionTestBase.java b/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/internal/UnsafeReturnStatementVisitorInspectionTestBase.java index 9961bcf41f83..cb0ab2e9f263 100644 --- a/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/internal/UnsafeReturnStatementVisitorInspectionTestBase.java +++ b/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/internal/UnsafeReturnStatementVisitorInspectionTestBase.java @@ -1,10 +1,12 @@ // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.idea.devkit.inspections.internal; +import com.intellij.openapi.roots.ModuleRootModificationUtil; import com.intellij.openapi.util.Iconable; import com.intellij.psi.JavaRecursiveElementWalkingVisitor; import com.intellij.psi.PsiElement; import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase; import com.intellij.util.PathUtil; import org.jetbrains.annotations.NotNull; @@ -15,6 +17,7 @@ public abstract class UnsafeReturnStatementVisitorInspectionTestBase extends Jav protected void setUp() throws Exception { super.setUp(); myFixture.enableInspections(new UnsafeReturnStatementVisitorInspection()); + ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); } @Override diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy index a87e77fcf0b5..cc54de54d672 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy @@ -1436,7 +1436,7 @@ import java.lang.annotation.Target; configure('@T @interface Foo {}') myFixture.completeBasic() - myFixture.assertPreferredCompletionItems 0, 'TMetaAnno', 'Target', 'TabLayoutPolicy', 'TabPlacement' + myFixture.assertPreferredCompletionItems 0, 'TMetaAnno', 'Target', 'TestOnly', 'TabLayoutPolicy', 'TabPlacement' } void testDiamondCompletion1() { diff --git a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/DuplicateStringLiteralInspectionTest.java b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/DuplicateStringLiteralInspectionTest.java index 52b3fc0628bb..825e3268351c 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/DuplicateStringLiteralInspectionTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/DuplicateStringLiteralInspectionTest.java @@ -6,6 +6,8 @@ import com.intellij.codeInspection.duplicateStringLiteral.DuplicateStringLiteral import com.intellij.java.i18n.JavaI18nBundle; import com.intellij.openapi.application.PluginPathManager; import com.intellij.openapi.application.impl.NonBlockingReadActionImpl; +import com.intellij.openapi.roots.ModuleRootModificationUtil; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase; import java.util.List; @@ -17,6 +19,7 @@ public class DuplicateStringLiteralInspectionTest extends JavaCodeInsightFixture public void setUp() throws Exception { super.setUp(); myFixture.enableInspections(myInspection); + ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); } @Override diff --git a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspectionTest.java b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspectionTest.java index c76190b23455..cffa81730139 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspectionTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspectionTest.java @@ -17,9 +17,17 @@ package com.intellij.codeInspection.i18n; import com.intellij.codeInspection.ex.LocalInspectionToolWrapper; import com.intellij.openapi.application.PluginPathManager; +import com.intellij.openapi.roots.ModuleRootModificationUtil; import com.intellij.testFramework.JavaInspectionTestCase; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; public class InvalidPropertyKeyInspectionTest extends JavaInspectionTestCase { + @Override + protected void setUp() throws Exception { + super.setUp(); + ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotations); + } + private void doTest() { LocalInspectionToolWrapper tool = new LocalInspectionToolWrapper(new InvalidPropertyKeyInspection()); doTest("invalidPropertyKey/" + getTestName(true), tool); diff --git a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/PropertyKeyFoldingTest.kt b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/PropertyKeyFoldingTest.kt index c06513e8c21c..151e89c1f1da 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/PropertyKeyFoldingTest.kt +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/PropertyKeyFoldingTest.kt @@ -2,13 +2,20 @@ package com.intellij.codeInspection.i18n import com.intellij.codeInsight.assertFolded +import com.intellij.openapi.roots.ModuleRootModificationUtil import com.intellij.testFramework.IdeaTestUtil import com.intellij.testFramework.builders.JavaModuleFixtureBuilder +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase import com.intellij.util.PathUtil class PropertyKeyFoldingTest : JavaCodeInsightFixtureTestCase() { + override fun setUp() { + super.setUp() + ModuleRootModificationUtil.updateModel(module, DefaultLightProjectDescriptor::addJetBrainsAnnotations) + } + override fun tuneFixture(moduleBuilder: JavaModuleFixtureBuilder<*>) { super.tuneFixture(moduleBuilder) moduleBuilder.addJdk(IdeaTestUtil.getMockJdk18Path().path) diff --git a/plugins/kotlin/completion/tests-shared/test/org/jetbrains/kotlin/idea/completion/test/AbstractJvmBasicCompletionTestBase.kt b/plugins/kotlin/completion/tests-shared/test/org/jetbrains/kotlin/idea/completion/test/AbstractJvmBasicCompletionTestBase.kt index 7d8d54f28975..f128db8d64fc 100644 --- a/plugins/kotlin/completion/tests-shared/test/org/jetbrains/kotlin/idea/completion/test/AbstractJvmBasicCompletionTestBase.kt +++ b/plugins/kotlin/completion/tests-shared/test/org/jetbrains/kotlin/idea/completion/test/AbstractJvmBasicCompletionTestBase.kt @@ -3,6 +3,7 @@ package org.jetbrains.kotlin.idea.completion.test import com.intellij.codeInsight.completion.CompletionType import com.intellij.openapi.projectRoots.Sdk +import com.intellij.openapi.roots.ModifiableRootModel import com.intellij.testFramework.IdeaTestUtil import com.intellij.testFramework.LightProjectDescriptor import org.jetbrains.kotlin.idea.test.KotlinJdkAndLibraryProjectDescriptor @@ -41,5 +42,9 @@ object KotlinJdkAndLibraryProjectDescriptorOnJdk8 : KotlinJdkAndLibraryProjectDe libraryFiles = KotlinWithJdkAndRuntimeLightProjectDescriptor.getInstance().libraryFiles, librarySourceFiles = KotlinWithJdkAndRuntimeLightProjectDescriptor.getInstance().librarySourceFiles, ) { + override fun addDefaultLibraries(model: ModifiableRootModel) { + // Skip adding JetBrains annotation for completion tests + } + override fun getSdk(): Sdk = IdeaTestUtil.getMockJdk18() } \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/checkers/AbstractJavaAgainstKotlinCheckerTest.java b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/checkers/AbstractJavaAgainstKotlinCheckerTest.java index 8feb202bc734..13aa8053eae0 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/checkers/AbstractJavaAgainstKotlinCheckerTest.java +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/checkers/AbstractJavaAgainstKotlinCheckerTest.java @@ -7,9 +7,11 @@ import com.intellij.codeInspection.dataFlow.DataFlowInspection; import com.intellij.codeInspection.nullable.NullableStuffInspection; import com.intellij.openapi.module.Module; import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.roots.ModuleRootModificationUtil; import com.intellij.openapi.util.io.FileUtil; import com.intellij.pom.java.LanguageLevel; import com.intellij.testFramework.IdeaTestUtil; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; import com.siyeh.ig.bugs.StaticCallOnSubclassInspection; import com.siyeh.ig.bugs.StaticFieldReferenceOnSubclassInspection; import kotlin.collections.CollectionsKt; @@ -94,6 +96,8 @@ public abstract class AbstractJavaAgainstKotlinCheckerTest extends KotlinDaemonA protected Module createMainModule() throws IOException { Module module = super.createMainModule(); + ModuleRootModificationUtil.updateModel(module, DefaultLightProjectDescriptor::addJetBrainsAnnotations); + String configFileText = getConfigFileText(); if (configFileText == null) { return module; diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/AbstractOutOfBlockModificationTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/AbstractOutOfBlockModificationTest.kt index f4cc8be219ee..1eaf836a489b 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/AbstractOutOfBlockModificationTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/AbstractOutOfBlockModificationTest.kt @@ -90,7 +90,8 @@ abstract class AbstractOutOfBlockModificationTest : KotlinLightCodeInsightFixtur } - assertEquals("no library dependencies have to be recalculated",0, resolverTracker.librariesComputed.size) + assertEquals("no library dependencies have to be recalculated",0, + resolverTracker.librariesComputed.filterNot { it.name?.startsWith("org.jetbrains:annotations") ?: false }.size) } } diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/decompiler/textBuilder/AbstractDecompiledTextTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/decompiler/textBuilder/AbstractDecompiledTextTest.kt index 8a4aa760a30d..f3830351299f 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/decompiler/textBuilder/AbstractDecompiledTextTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/decompiler/textBuilder/AbstractDecompiledTextTest.kt @@ -59,7 +59,7 @@ abstract class AbstractJvmDecompiledTextTest : AbstractDecompiledTextTest("/deco fun findTestLibraryRoot(module: Module): VirtualFile? { for (orderEntry in ModuleRootManager.getInstance(module).orderEntries) { - if (orderEntry is LibraryOrderEntry) { + if (orderEntry is LibraryOrderEntry && orderEntry.libraryName?.startsWith("org.jetbrains:annotations") != true) { return orderEntry.getRootFiles(OrderRootType.CLASSES)[0] } } diff --git a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightProjectDescriptor.java b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightProjectDescriptor.java index aba15ee3c9a7..c4acb7762ddb 100644 --- a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightProjectDescriptor.java +++ b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightProjectDescriptor.java @@ -9,6 +9,8 @@ import com.intellij.openapi.roots.ContentEntry; import com.intellij.openapi.roots.ModifiableRootModel; import com.intellij.testFramework.IdeaTestUtil; import com.intellij.testFramework.LightProjectDescriptor; +import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; +import com.intellij.testFramework.fixtures.MavenDependencyUtil; import org.jetbrains.annotations.NotNull; public class KotlinLightProjectDescriptor extends LightProjectDescriptor { @@ -30,9 +32,14 @@ public class KotlinLightProjectDescriptor extends LightProjectDescriptor { @Override public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { + addDefaultLibraries(model); configureModule(module, model); } + protected void addDefaultLibraries(@NotNull ModifiableRootModel model) { + DefaultLightProjectDescriptor.addJetBrainsAnnotations(model); + } + public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model) { } } diff --git a/plugins/lombok/src/test/java/de/plushnikov/intellij/plugin/LombokTestUtil.java b/plugins/lombok/src/test/java/de/plushnikov/intellij/plugin/LombokTestUtil.java index 663f8d03afda..bcd179ff3559 100644 --- a/plugins/lombok/src/test/java/de/plushnikov/intellij/plugin/LombokTestUtil.java +++ b/plugins/lombok/src/test/java/de/plushnikov/intellij/plugin/LombokTestUtil.java @@ -19,6 +19,7 @@ public final class LombokTestUtil { public static final DefaultLightProjectDescriptor LOMBOK_DESCRIPTOR = new DefaultLightProjectDescriptor() { @Override public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { + DefaultLightProjectDescriptor.addJetBrainsAnnotations(model); MavenDependencyUtil.addFromMaven(model, LOMBOK_MAVEN_COORDINATES); MavenDependencyUtil.addFromMaven(model, JACKSON_MAVEN_COORDINATES); MavenDependencyUtil.addFromMaven(model, "com.google.guava:guava:27.0.1-jre");