diff --git a/plugins/devkit/testSources/codeInsight/CreateClassFixTest.java b/plugins/devkit/testSources/codeInsight/CreateClassFixTest.java index 1c866c053398..b9c2a77c7bcf 100644 --- a/plugins/devkit/testSources/codeInsight/CreateClassFixTest.java +++ b/plugins/devkit/testSources/codeInsight/CreateClassFixTest.java @@ -46,7 +46,7 @@ import java.util.Arrays; import java.util.List; @RunWith(Parameterized.class) -public class CreateClassFixTest extends UsefulTestCase{ +public class CreateClassFixTest extends UsefulTestCase { protected CodeInsightTestFixture myFixture; @org.junit.runners.Parameterized.Parameter(0) public String myTestName; @@ -54,13 +54,15 @@ public class CreateClassFixTest extends UsefulTestCase{ @Before public void setUp() throws Exception { + super.setUp(); final Ref ex = new Ref<>(); Runnable runnable = new Runnable() { public void run() { try { CreateClassFixTest.super.setUp(); final JavaTestFixtureFactory fixtureFactory = JavaTestFixtureFactory.getFixtureFactory(); - final TestFixtureBuilder testFixtureBuilder = JavaTestFixtureFactory.createFixtureBuilder(getClass().getSimpleName()); + final TestFixtureBuilder testFixtureBuilder = + JavaTestFixtureFactory.createFixtureBuilder(getClass().getSimpleName()); myFixture = fixtureFactory.createCodeInsightFixture(testFixtureBuilder.getFixture()); myFixture.setTestDataPath(PluginPathManager.getPluginHomePath("devkit") + "/testData"); @@ -81,6 +83,7 @@ public class CreateClassFixTest extends UsefulTestCase{ } } + @SuppressWarnings("MethodDoesntCallSuperMethod") @After public void tearDown() throws Exception { final Ref ex = new Ref<>(); @@ -106,9 +109,9 @@ public class CreateClassFixTest extends UsefulTestCase{ @Parameterized.Parameters(name = "{0} : {1}") public static List data() { - return Arrays.asList(new Object[]{"Action", true}, - new Object[]{"Impl", true}, - new Object[]{"Intf", true}, + return Arrays.asList(new Object[]{"Action", true}, + new Object[]{"Impl", true}, + new Object[]{"Intf", true}, new Object[]{"Intf", false}); } diff --git a/plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java b/plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java index 72ebc477c5b3..4387dd773f2d 100644 --- a/plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java +++ b/plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java @@ -60,7 +60,7 @@ public class PluginXmlDomStubsTest extends DomStubTest { " Attribute:text:nestedGroupActionText\n"); } - public void testXInclude() throws Exception { + public void testXInclude() { prepareFile("pluginWithXInclude-extensionPoints.xml"); prepareFile("pluginWithXInclude-main.xml"); prepareFile("pluginWithXInclude.xml"); diff --git a/plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy b/plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy index bec6376495fa..6cb34a55f202 100644 --- a/plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy +++ b/plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy @@ -67,7 +67,7 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { moduleBuilder.addLibrary("platform-impl", platformImplJar) } - void testExtensionsHighlighting() throws Throwable { + void testExtensionsHighlighting() { final String root = "idea_core" addPluginXml(root, """ com.intellij @@ -96,7 +96,7 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { myFixture.checkHighlighting(true, false, false) } - void testDependsHighlighting() throws Throwable { + void testDependsHighlighting() { final String root = "idea_core" addPluginXml(root, """ com.intellij @@ -119,7 +119,7 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { assertSameElements(myFixture.getLookupElementStrings(), "optional.xml", "optional2.xml") } - void testDependsCompletion() throws Throwable { + void testDependsCompletion() { addPluginXml("platform", """ com.intellij @@ -143,13 +143,13 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { myFixture.configureFromExistingVirtualFile(myFixture.copyFileToProject(getTestName(false) + ".xml", "META-INF/plugin.xml")) } - void testExtensionQualifiedName() throws Throwable { + void testExtensionQualifiedName() { myFixture.addClass("package foo; public class MyRunnable implements java.lang.Runnable {}") configureByFile() myFixture.checkHighlighting(false, false, false) } - void testInnerClassCompletion() throws Throwable { + void testInnerClassCompletion() { myFixture.addClass("package foo; public class Foo { public static class Fubar {} }") myFixture.configureByFile(getTestName(false) + ".xml") myFixture.completeBasic() @@ -157,14 +157,14 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { myFixture.checkResultByFile(getTestName(false) + "_after.xml") } - void testInnerClassSmartCompletion() throws Throwable { + void testInnerClassSmartCompletion() { myFixture.addClass("package foo; public class Foo { public static class Fubar extends Foo {} }") myFixture.configureByFile(getTestName(false) + ".xml") myFixture.complete(CompletionType.SMART) myFixture.checkResultByFile(getTestName(false) + "_after.xml") } - void testResolveExtensionsFromDependentDescriptor() throws Throwable { + void testResolveExtensionsFromDependentDescriptor() { addPluginXml("xxx", """ com.intellij.xxx @@ -184,7 +184,7 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { ApplicationManager.application.runWriteAction { PsiTestUtil.addSourceContentToRoots(myModule, myTempDirFixture.getFile(root)) } } - void testNoWordCompletionInClassPlaces() throws Throwable { + void testNoWordCompletionInClassPlaces() { myFixture.addClass("package foo; public class FooFooFooFooFoo { }") myFixture.addClass("package foo; public interface ExtIntf { }") @@ -194,7 +194,7 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { myFixture.checkResultByFile(getTestName(false) + "_after.xml") } - void testNoClassCompletionOutsideJavaReferences() throws Throwable { + void testNoClassCompletionOutsideJavaReferences() { myFixture.addClass("package foo; public class FooFooFooFooFoo { }") myFixture.configureByFile(getTestName(false) + ".xml") @@ -287,7 +287,7 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { "MyIconAttributeEPBean.java") } - void testPluginWithModules() throws Throwable { + void testPluginWithModules() { myFixture.testHighlighting("pluginWithModules.xml") } @@ -322,7 +322,7 @@ class PluginXmlFunctionalTest extends JavaCodeInsightFixtureTestCase { myFixture.checkResultByFile("pluginWithBigNumberInUntilBuild_after.xml") } - void testPluginWithXInclude() throws Throwable { + void testPluginWithXInclude() { myFixture.testHighlighting("pluginWithXInclude.xml", "pluginWithXInclude-extensionPoints.xml") } diff --git a/plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java b/plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java index 43303b3b206b..9d4fe2b60ebe 100644 --- a/plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java +++ b/plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -26,6 +26,7 @@ import com.intellij.ui.components.JBList; import com.intellij.util.PathUtil; import java.util.Collections; +import java.util.Comparator; import java.util.List; @TestDataPath("$CONTENT_ROOT/testData/navigation/descriptionType") @@ -63,7 +64,7 @@ public class DescriptionTypeRelatedItemLineMarkerProviderTest extends JavaCodeIn List gutters = myFixture.findAllGutters("MyIntentionActionWithDescription.java"); assertSize(2, gutters); - Collections.sort(gutters, (g1, g2) -> g1.getTooltipText().compareTo(g2.getTooltipText())); + Collections.sort(gutters, Comparator.comparing(GutterMark::getTooltipText)); DevKitGutterTargetsChecker.checkGutterTargets(gutters.get(1), "Description", AllIcons.FileTypes.Html, "description.html"); DevKitGutterTargetsChecker.checkGutterTargets(gutters.get(0), "Before/After Templates", AllIcons.Actions.Diff, "after.java.template", "before.java.template"); diff --git a/plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java b/plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java index 1cabc84383ba..24ff26d99757 100644 --- a/plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java +++ b/plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -28,15 +28,15 @@ public class TestDataPathCompletionTest extends TestDataPathTestCase { doTest(); } - public void testReferencesAfterProjectRoot() throws Exception { + public void testReferencesAfterProjectRoot() { doTest(); } - public void testContentRoot() throws Exception { + public void testContentRoot() { doTest(); } - public void testReferencesAfterContentRoot() throws Exception { + public void testReferencesAfterContentRoot() { doTest(); } diff --git a/plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java b/plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java index 9709b641e087..65ad0cbfa14a 100644 --- a/plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java +++ b/plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -32,15 +32,15 @@ public class TestDataPathResolvingTest extends TestDataPathTestCase { doTest(PsiManager.getInstance(myFixture.getProject()).findDirectory(myFixture.getProject().getBaseDir())); } - public void testReferencesAfterProjectRoot() throws Exception { + public void testReferencesAfterProjectRoot() { doTest(PsiManager.getInstance(myFixture.getProject()).findDirectory(myProjectSubdir)); } - public void testContentRootReference() throws Exception { + public void testContentRootReference() { doTest(PsiManager.getInstance(myFixture.getProject()).findDirectory(myContentRoot)); } - public void testReferencesAfterContentRoot() throws Exception { + public void testReferencesAfterContentRoot() { doTest(PsiManager.getInstance(myFixture.getProject()).findDirectory(myContentRootSubdir)); }