diff --git a/RegExpSupport/test/org/intellij/lang/regexp/RegExpCompletionTest.java b/RegExpSupport/test/org/intellij/lang/regexp/RegExpCompletionTest.java index 51060fb1324e..037e9cc06f4b 100644 --- a/RegExpSupport/test/org/intellij/lang/regexp/RegExpCompletionTest.java +++ b/RegExpSupport/test/org/intellij/lang/regexp/RegExpCompletionTest.java @@ -48,7 +48,7 @@ public class RegExpCompletionTest extends CodeInsightFixtureTestCase { "KISSING FACE WITH SMILING EYES"), strings); } - public void testBackSlashVariants() throws Throwable { + public void testBackSlashVariants() { List nameList = new ArrayList<>(Arrays.asList("d", "D", "s", "S", "w", "W", "b", "B", "A", "G", "Z", "z", "Q", "E", "t", "n", "r", "f", "a", "e", "h", "H", "v", "V", "R", "X", "b{g}")); @@ -58,7 +58,7 @@ public class RegExpCompletionTest extends CodeInsightFixtureTestCase { myFixture.testCompletionVariants(getInputDataFileName(getTestName(true)), ArrayUtil.toStringArray(nameList)); } - public void testPropertyVariants() throws Throwable { + public void testPropertyVariants() { List nameList = new ArrayList<>(); for (String[] stringArray : DefaultRegExpPropertiesProvider.getInstance().getAllKnownProperties()) { nameList.add("{" + stringArray[0] + "}"); @@ -66,13 +66,13 @@ public class RegExpCompletionTest extends CodeInsightFixtureTestCase { myFixture.testCompletionVariants(getInputDataFileName(getTestName(true)), ArrayUtil.toStringArray(nameList)); } - public void testPropertyAlpha() throws Throwable { + public void testPropertyAlpha() { myFixture.configureByText(RegExpFileType.INSTANCE, "\\P{Alp}"); myFixture.completeBasic(); myFixture.checkResult("\\P{Alpha}"); } - public void doTest() throws Throwable { + public void doTest() { String inputDataFileName = getInputDataFileName(getTestName(true)); String expectedResultFileName = getExpectedResultFileName(getTestName(true)); myFixture.testCompletion(inputDataFileName, expectedResultFileName); diff --git a/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java b/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java index 90c382a3f115..0d3679a3d926 100644 --- a/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java +++ b/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java @@ -344,7 +344,7 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase { PlatformTestCase.myFilesToDelete.add(moduleFile); return new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { Module module = ModuleManager.getInstance(myProject) .newModule(FileUtil.toSystemIndependentName(moduleFile.getAbsolutePath()), getModuleType().getId()); module.getModuleFile(); diff --git a/java/compiler/impl/testSrc/com/intellij/compiler/artifacts/ArtifactCompilerTestCase.java b/java/compiler/impl/testSrc/com/intellij/compiler/artifacts/ArtifactCompilerTestCase.java index ad0318964a92..33088e7721fc 100644 --- a/java/compiler/impl/testSrc/com/intellij/compiler/artifacts/ArtifactCompilerTestCase.java +++ b/java/compiler/impl/testSrc/com/intellij/compiler/artifacts/ArtifactCompilerTestCase.java @@ -19,7 +19,6 @@ import com.intellij.util.io.TestFileSystemItem; import org.jetbrains.annotations.Nullable; import java.io.File; -import java.io.IOException; import static com.intellij.compiler.artifacts.ArtifactsTestCase.commitModel; @@ -71,7 +70,7 @@ public abstract class ArtifactCompilerTestCase extends BaseCompilerTestCase { return make(getArtifactManager().getArtifacts()); } - protected void changeFileInJar(String jarPath, String pathInJar) throws Exception { + protected void changeFileInJar(String jarPath, String pathInJar) { final VirtualFile jarFile = LocalFileSystem.getInstance().findFileByPath(jarPath); assertNotNull(jarFile); final VirtualFile jarRoot = JarFileSystem.getInstance().getJarRootForLocalFile(jarFile); @@ -96,7 +95,7 @@ public abstract class ArtifactCompilerTestCase extends BaseCompilerTestCase { assertFalse(new File(FileUtil.toSystemDependentName(outputPath)).exists()); } - public static void assertEmptyOutput(Artifact a1) throws IOException { + public static void assertEmptyOutput(Artifact a1) { assertOutput(a1, ArtifactCompilerTestCase.fs()); } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/SmartTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/SmartTypeCompletionTest.java index 5c718cf91086..733b387e9a27 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/SmartTypeCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/SmartTypeCompletionTest.java @@ -832,7 +832,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase { doItemTest(); } - public void testInsertOverride() throws Exception { + public void testInsertOverride() { JavaCodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject()).getCustomSettings(JavaCodeStyleSettings.class); styleSettings.INSERT_OVERRIDE_ANNOTATION = true; doItemTest(); diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/editorActions/JavaEditingTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/editorActions/JavaEditingTest.java index aec659f0685e..e8aaf64ac7fb 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/editorActions/JavaEditingTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/editorActions/JavaEditingTest.java @@ -19,7 +19,7 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest; import com.intellij.testFramework.TestFileType; public class JavaEditingTest extends AbstractEditorTest { - public void testSmartHomeInJavadoc() throws Exception { + public void testSmartHomeInJavadoc() { init("/**\n" + " * some text\n" + " */\n" + diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/editorActions/MoveElementLeftRightTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/editorActions/MoveElementLeftRightTest.java index f8e370ea7634..7ae41c618a7b 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/editorActions/MoveElementLeftRightTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/editorActions/MoveElementLeftRightTest.java @@ -133,7 +133,7 @@ public class MoveElementLeftRightTest extends AbstractMoveElementLeftRightTest { } @Override - protected void configureEditor(String contents) throws Exception { + protected void configureEditor(String contents) { init(contents, TestFileType.JAVA); } } diff --git a/java/java-tests/testSrc/com/intellij/java/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java b/java/java-tests/testSrc/com/intellij/java/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java index 456d93ef2d85..480259274def 100644 --- a/java/java-tests/testSrc/com/intellij/java/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java +++ b/java/java-tests/testSrc/com/intellij/java/openapi/editor/impl/FoldingProcessingOnDocumentModificationTest.java @@ -24,7 +24,6 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest; import com.intellij.psi.PsiDocumentManager; import com.intellij.testFramework.TestFileType; -import java.io.IOException; import java.util.Arrays; /** @@ -33,7 +32,7 @@ import java.util.Arrays; */ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorTest { - public void testUnexpectedClassLevelJavadocExpandingOnClassSignatureChange() throws IOException { + public void testUnexpectedClassLevelJavadocExpandingOnClassSignatureChange() { // Inspired by IDEA-61275 String text = @@ -60,7 +59,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT assertFalse(foldRegion.isExpanded()); } - public void testCollapseAllHappensBeforeFirstCodeFoldingPass() throws Exception { + public void testCollapseAllHappensBeforeFirstCodeFoldingPass() { init("class Foo {\n" + " void m() {\n" + " System.out.println();\n" + @@ -74,7 +73,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT assertEquals(1, myEditor.getFoldingModel().getAllFoldRegions().length); } - public void testSurvivingBrokenPsi() throws Exception { + public void testSurvivingBrokenPsi() { openJavaEditor("class Foo {\n" + " void m() {\n" + "\n" + @@ -98,7 +97,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT checkFoldingState("[FoldRegion +(25:33), placeholder='{}']"); } - public void testInvalidRegionIsRemovedOnExpanding() throws Exception { + public void testInvalidRegionIsRemovedOnExpanding() { openJavaEditor("class Foo {\n" + " void m() {\n" + "\n" + @@ -120,7 +119,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT checkFoldingState("[FoldRegion -(0:37), placeholder='/.../']"); } - public void testEditingNearRegionExpandsIt() throws Exception { + public void testEditingNearRegionExpandsIt() { openJavaEditor("class Foo {\n" + " void m() {\n" + "\n" + @@ -131,7 +130,7 @@ public class FoldingProcessingOnDocumentModificationTest extends AbstractEditorT checkFoldingState("[]"); } - private void openJavaEditor(String text) throws Exception { + private void openJavaEditor(String text) { init(text, TestFileType.JAVA); buildInitialFoldRegions(); runFoldingPass(true); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaAutoIndentLinesTest.java b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaAutoIndentLinesTest.java index 97b9cb629536..ba9b9cbba06c 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaAutoIndentLinesTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaAutoIndentLinesTest.java @@ -20,7 +20,7 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest; import com.intellij.testFramework.TestFileType; public class JavaAutoIndentLinesTest extends AbstractEditorTest { - public void testSelection() throws Exception { + public void testSelection() { init("class C {\n" + "int a = 1;\n" + "}", diff --git a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaFormatterTest.java b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaFormatterTest.java index 76396e024022..f39a161e1dea 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaFormatterTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavaFormatterTest.java @@ -41,20 +41,20 @@ import org.jetbrains.annotations.NonNls; @SuppressWarnings({"Deprecation"}) public class JavaFormatterTest extends AbstractJavaFormatterTest { - public void testForEach() throws Exception { + public void testForEach() { doTest("ForEach.java", "ForEach_after.java"); } - public void testDoubleCast() throws Exception { + public void testDoubleCast() { doTest("DoubleCast.java", "DoubleCast_after.java"); } - public void test1() throws Exception { + public void test1() { myTextRange = new TextRange(35, 46); doTest("1.java", "1_after.java"); } - public void testLabel1() throws Exception { + public void testLabel1() { CommonCodeStyleSettings settings = getSettings(); settings.LABELED_STATEMENT_WRAP = CommonCodeStyleSettings.WRAP_ALWAYS; @@ -64,12 +64,12 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTest("Label.java", "Label_after1.java"); } - public void testTryCatch() throws Exception { + public void testTryCatch() { myTextRange = new TextRange(38, 72); doTest("TryCatch.java", "TryCatch_after.java"); } - public void testNullMethodParameter() throws Exception { + public void testNullMethodParameter() { final CommonCodeStyleSettings settings = getSettings(); settings.CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_ALWAYS; settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true; @@ -122,28 +122,28 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { ); } - public void testNew() throws Exception { + public void testNew() { final CommonCodeStyleSettings settings = getSettings(); settings.getRootSettings().getIndentOptions(StdFileTypes.JAVA).CONTINUATION_INDENT_SIZE = 8; doTest("New.java", "New_after.java"); } - public void testJavaDoc() throws Exception { + public void testJavaDoc() { final CommonCodeStyleSettings settings = getSettings(); settings.BLANK_LINES_AROUND_FIELD = 1; doTest("JavaDoc.java", "JavaDoc_after.java"); } - public void testBreakInsideIf() throws Exception { + public void testBreakInsideIf() { doTest("BreakInsideIf.java", "BreakInsideIf_after.java"); } - public void testAssert() throws Exception { + public void testAssert() { LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.HIGHEST); doTest(); } - public void testCastInsideElse() throws Exception { + public void testCastInsideElse() { final CommonCodeStyleSettings settings = getSettings(); final CommonCodeStyleSettings.IndentOptions indentOptions = settings.getRootSettings().getIndentOptions(StdFileTypes.JAVA); indentOptions.CONTINUATION_INDENT_SIZE = 2; @@ -156,18 +156,18 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTest(); } - public void testAlignMultiLine() throws Exception { + public void testAlignMultiLine() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION = true; settings.ALIGN_MULTILINE_BINARY_OPERATION = true; doTest(); } - public void testInnerClassAsParameter() throws Exception { + public void testInnerClassAsParameter() { doTest(); } - public void testSynchronizedBlock() throws Exception { + public void testSynchronizedBlock() { final CommonCodeStyleSettings settings = getSettings(); settings.SPACE_BEFORE_SYNCHRONIZED_PARENTHESES = false; settings.SPACE_WITHIN_SYNCHRONIZED_PARENTHESES = false; @@ -175,25 +175,25 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTest(); } - public void testMethodCallInAssignment() throws Exception { + public void testMethodCallInAssignment() { final CommonCodeStyleSettings settings = getSettings(); settings.getRootSettings().getIndentOptions(StdFileTypes.JAVA).CONTINUATION_INDENT_SIZE = 8; doTest(); } - public void testAnonymousInnerClasses() throws Exception { + public void testAnonymousInnerClasses() { doTest(); } - public void testAnonymousInner2() throws Exception { + public void testAnonymousInner2() { doTest(); } - public void testWrapAssertion() throws Exception { + public void testWrapAssertion() { doTest(); } - public void testIfElse() throws Exception { + public void testIfElse() { final CommonCodeStyleSettings settings = getSettings(); settings.IF_BRACE_FORCE = CommonCodeStyleSettings.DO_NOT_FORCE; settings.FOR_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_IF_MULTILINE; @@ -220,7 +220,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTest(); } - public void testIfBraces() throws Exception { + public void testIfBraces() { final CommonCodeStyleSettings settings = getSettings(); settings.IF_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_ALWAYS; settings.BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE; @@ -228,7 +228,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTest(); } - public void testTernaryExpression() throws Exception { + public void testTernaryExpression() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_TERNARY_OPERATION = true; doTest(); @@ -238,29 +238,29 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testAlignAssignment() throws Exception { + public void testAlignAssignment() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_ASSIGNMENT = true; settings.ALIGN_MULTILINE_BINARY_OPERATION = true; doTest(); } - public void testAlignFor() throws Exception { + public void testAlignFor() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_BINARY_OPERATION = true; settings.ALIGN_MULTILINE_FOR = true; doTest(); } - public void testSwitch() throws Exception { + public void testSwitch() { doTest(); } - public void testContinue() throws Exception { + public void testContinue() { doTest(); } - public void testIf() throws Exception { + public void testIf() { final CommonCodeStyleSettings settings = getSettings(); settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; doTest(); @@ -272,13 +272,13 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void test2() throws Exception { + public void test2() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true; doTest(); } - public void testBlocks() throws Exception { + public void testBlocks() { final CommonCodeStyleSettings settings = getSettings(); settings.KEEP_LINE_BREAKS = false; doTest(); @@ -359,17 +359,17 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testWhile() throws Exception { + public void testWhile() { doTextTest("class A{\n" + "void a(){\n" + "do x++ while (b);\n" + "}\n}", "class A {\n" + " void a() {\n" + " do x++ while (b);\n" + " }\n" + "}"); } - public void testFor() throws Exception { + public void testFor() { doTextTest("class A{\n" + "void b(){\n" + "for (c) {\n" + "d();\n" + "}\n" + "}\n" + "}", "class A {\n" + " void b() {\n" + " for (c) {\n" + " d();\n" + " }\n" + " }\n" + "}"); } - public void testClassComment() throws Exception { + public void testClassComment() { String before = "/**\n" + "* @author smbd\n" + "* @param some param\n" + @@ -386,7 +386,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTextTest(before,after); } - public void testStringBinaryOperation() throws Exception { + public void testStringBinaryOperation() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_ASSIGNMENT = false; @@ -403,16 +403,16 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void test3() throws Exception { + public void test3() { doTest(); } - public void test4() throws Exception { + public void test4() { myLineRange = new TextRange(2, 8); doTest(); } - public void testBraces() throws Exception { + public void testBraces() { final CommonCodeStyleSettings settings = getSettings(); @NonNls final String text = @@ -489,18 +489,18 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testExtendsList() throws Exception { + public void testExtendsList() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_EXTENDS_LIST = true; doTextTest("class A extends B, \n" + "C {}", "class A extends B,\n" + " C {\n}"); } - public void testBlockWithoutBraces() throws Exception { + public void testBlockWithoutBraces() { doTextTest("class A {\n" + "void foo(){\n" + "if(a)\n" + "return;\n" + "}\n" + "}", "class A {\n" + " void foo() {\n" + " if (a)\n" + " return;\n" + " }\n" + "}"); } - public void testNestedCalls() throws Exception { + public void testNestedCalls() { doTextTest("class A {\n" + "void foo(){\n" + "foo(\nfoo(\nfoo()\n)\n);\n" + "}\n" + "}", "class A {\n" + " void foo() {\n" + " foo(\n" + @@ -513,12 +513,12 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testSpacesAroundMethod() throws Exception { + public void testSpacesAroundMethod() { doTextTest("class Foo {\n" + " abstract void a();\n" + " {\n" + " a();\n" + " }\n" + "}", "class Foo {\n" + " abstract void a();\n" + "\n" + " {\n" + " a();\n" + " }\n" + "}"); } - public void testSpaceInIf() throws Exception { + public void testSpaceInIf() { doTextTest("class foo {\n" + " {\n" + " if (a) {\n" + @@ -538,13 +538,13 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testIf2() throws Exception { + public void testIf2() { doTextTest( "public class Test {\n" + " public boolean equals(Object o) {\n" + " if(this == o)return true;\n" + " }\n" + "}", "public class Test {\n" + " public boolean equals(Object o) {\n" + " if (this == o) return true;\n" + " }\n" + "}"); } - public void testSpaceAroundField() throws Exception { + public void testSpaceAroundField() { final CommonCodeStyleSettings settings = getSettings(); settings.BLANK_LINES_AROUND_FIELD = 1; @@ -570,7 +570,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testArray() throws Exception { + public void testArray() { final CommonCodeStyleSettings settings = getSettings(); settings.SPACE_WITHIN_ARRAY_INITIALIZER_BRACES = true; settings.SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE = true; @@ -578,7 +578,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "class a {\n" + " void f() {\n" + " final int[] i = new int[] { 0 };\n" + " }\n" + "}"); } - public void testEmptyArray() throws Exception { + public void testEmptyArray() { final CommonCodeStyleSettings settings = getSettings(); settings.SPACE_WITHIN_ARRAY_INITIALIZER_BRACES = true; settings.SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE = true; @@ -587,7 +587,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "class a {\n" + " void f() {\n" + " final int[] i = new int[] {};\n" + " }\n" + "}"); } - public void testEmptyArrayIsntWrapped() throws Exception { + public void testEmptyArrayIsntWrapped() { final CommonCodeStyleSettings settings = getSettings(); settings.ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE = true; settings.ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE = true; @@ -596,12 +596,12 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "class a {\n" + " void f() {\n" + " final int[] i = new int[]{ };\n" + " }\n" + "}"); } - public void testTwoJavaDocs() throws Exception { + public void testTwoJavaDocs() { doTextTest("/**\n" + " * \n" + " */\n" + " class Test {\n" + " /**\n" + " */\n" + " public void foo();\n" + "}", "/**\n" + " *\n" + " */\n" + "class Test {\n" + " /**\n" + " */\n" + " public void foo();\n" + "}"); } - public void testJavaDocLinksWithParameterNames() throws Exception { + public void testJavaDocLinksWithParameterNames() { // See IDEADEV-8332 doTextTest("/**\n" + "* @return if ( x1 == x1 ) then return {@link #cmp(String y1,int y2)}\n" + @@ -616,11 +616,11 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}\n"); } - public void testIncompleteField() throws Exception { + public void testIncompleteField() { doTextTest("public class Test {\n" + " String s =;\n" + "}", "public class Test {\n" + " String s = ;\n" + "}"); } - public void testIf3() throws Exception { + public void testIf3() { getSettings().KEEP_CONTROL_STATEMENT_IN_ONE_LINE = false; doTextTest("public abstract class A {\n" + " abstract void f(boolean b);\n" + @@ -653,12 +653,12 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testDocComment() throws Exception { + public void testDocComment() { doTextTest("public class TestClass {\n" + "/**\n" + "* \n" + "*/\n" + " public void f1() {\n" + " }\n" + "}", "public class TestClass {\n" + " /**\n" + " *\n" + " */\n" + " public void f1() {\n" + " }\n" + "}"); } - public void testDocComment2() throws Exception { + public void testDocComment2() { getSettings().KEEP_SIMPLE_METHODS_IN_ONE_LINE = true; doTextTest("class Test {\n" + "/**\n" + @@ -678,11 +678,11 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testSpaceBeforeFieldName() throws Exception { + public void testSpaceBeforeFieldName() { doTextTest("class A{\n" + "public A myA ;\n" + "}", "class A {\n" + " public A myA;\n" + "}"); } - public void testClass() throws Exception { + public void testClass() { doTextTest(" class A {\n" + " Logger LOG;\n" + " class C {}\n" + @@ -704,7 +704,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testDoNotIndentCaseFromSwitch() throws Exception { + public void testDoNotIndentCaseFromSwitch() { final CommonCodeStyleSettings settings = getSettings(); settings.INDENT_CASE_FROM_SWITCH = false; doTextTest("class A {\n" + "void foo() {\n" + "switch(a){\n" + "case 1: \n" + "break;\n" + "}\n" + "}\n" + "}", "class A {\n" + @@ -717,26 +717,26 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testClass2() throws Exception { + public void testClass2() { final CommonCodeStyleSettings settings = getSettings(); settings.KEEP_FIRST_COLUMN_COMMENT = false; doTextTest("class A {\n" + "// comment before\n" + "protected Object a;// comment after\n" + "}", "class A {\n" + " // comment before\n" + " protected Object a;// comment after\n" + "}"); } - public void testSplitLiteral() throws Exception { + public void testSplitLiteral() { doTextTest("class A {\n" + "void foo() {\n" + " String s = \"abc\" +\n" + " \"def\";\n" + "}\n" + "}", "class A {\n" + " void foo() {\n" + " String s = \"abc\" +\n" + " \"def\";\n" + " }\n" + "}"); } - public void testParametersAlignment() throws Exception { + public void testParametersAlignment() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true; settings.RIGHT_MARGIN = 140; doTest(); } - public void testConditionalExpression() throws Exception { + public void testConditionalExpression() { final CommonCodeStyleSettings settings = getSettings(); settings.SPACE_BEFORE_QUEST = true; settings.SPACE_AFTER_QUEST = false; @@ -747,7 +747,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "class Foo {\n" + " void foo() {\n" + " return name != null ?1 :2;\n" + " }\n" + "}"); } - public void testMethodCallChain() throws Exception { + public void testMethodCallChain() { doTextTest("class Foo{\n" + " void foo(){\n" + " configuration = new Configuration() \n" + @@ -809,7 +809,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testComment1() throws Exception { + public void testComment1() { doTextTest( "class Foo {\n" + " public boolean mErrorFlage;\n" + @@ -832,7 +832,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testElseAfterComment() throws Exception { + public void testElseAfterComment() { doTextTest("public class Foo {\n" + " public int foo() {\n" + " if (a) {\n" + @@ -852,7 +852,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testLBraceAfterComment() throws Exception { + public void testLBraceAfterComment() { final CommonCodeStyleSettings settings = getSettings(); settings.KEEP_LINE_BREAKS = false; doTextTest("public class Foo {\n" + @@ -874,7 +874,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testSpaces() throws Exception { + public void testSpaces() { final CommonCodeStyleSettings settings = getSettings(); settings.SPACE_WITHIN_FOR_PARENTHESES = true; settings.SPACE_WITHIN_IF_PARENTHESES = true; @@ -885,7 +885,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTest(); } - public void testSpacesBeforeLBrace() throws Exception { + public void testSpacesBeforeLBrace() { final CommonCodeStyleSettings settings = getSettings(); settings.SPACE_BEFORE_CLASS_LBRACE = true; settings.SPACE_BEFORE_METHOD_LBRACE = true; @@ -920,7 +920,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTest("SpacesBeforeLBrace.java", "SpacesBeforeLBrace.java"); } - public void testCommentBeforeField() throws Exception { + public void testCommentBeforeField() { final CommonCodeStyleSettings settings = getSettings(); settings.KEEP_LINE_BREAKS = false; settings.KEEP_FIRST_COLUMN_COMMENT = false; @@ -930,7 +930,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTextTest("class Foo{\n" + " //Foo a\n" + " Foo a; \n" + "}", "class Foo {\n" + " //Foo a\n" + " Foo a;\n" + "}"); } - public void testLabel() throws Exception { + public void testLabel() { final CommonCodeStyleSettings settings = getSettings(); settings.getRootSettings().getIndentOptions(StdFileTypes.JAVA).LABEL_INDENT_ABSOLUTE = true; settings.SPECIAL_ELSE_IF_TREATMENT = true; @@ -953,7 +953,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testElseOnNewLine() throws Exception { + public void testElseOnNewLine() { doTextTest("class Foo{\n" + "void foo() {\n" + "if (a)\n" + "return;\n" + "else\n" + "return;\n" + "}\n" + "}", "class Foo {\n" + " void foo() {\n" + " if (a)\n" + @@ -964,11 +964,11 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testTwoClasses() throws Exception { + public void testTwoClasses() { doTextTest("class A {}\n" + "class B {}", "class A {\n" + "}\n" + "\n" + "class B {\n" + "}"); } - public void testBraceOnNewLineIfWrapped() throws Exception { + public void testBraceOnNewLineIfWrapped() { getSettings().BINARY_OPERATION_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_IF_WRAPPED; getSettings().RIGHT_MARGIN = 35; @@ -995,7 +995,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testFirstArgumentWrapping() throws Exception { + public void testFirstArgumentWrapping() { getSettings().RIGHT_MARGIN = 20; getSettings().CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; doTextTest("class Foo {\n" + " void foo() {\n" + " fooFooFooFoo(1);" + " }\n" + "}", @@ -1015,13 +1015,13 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testSpacesInsideWhile() throws Exception { + public void testSpacesInsideWhile() { getSettings().SPACE_WITHIN_WHILE_PARENTHESES = true; doTextTest("class Foo{\n" + " void foo() {\n" + " while(x != y) {\n" + " }\n" + " }\n" + "}", "class Foo {\n" + " void foo() {\n" + " while ( x != y ) {\n" + " }\n" + " }\n" + "}"); } - public void testAssertStatementWrapping() throws Exception { + public void testAssertStatementWrapping() { getSettings().ASSERT_STATEMENT_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().BINARY_OPERATION_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP; getSettings().RIGHT_MARGIN = 40; @@ -1066,7 +1066,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } } - public void testAssertStatementWrapping2() throws Exception { + public void testAssertStatementWrapping2() { getSettings().BINARY_OPERATION_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP; getSettings().ASSERT_STATEMENT_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().RIGHT_MARGIN = 37; @@ -1109,7 +1109,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void test() throws Exception { + public void test() { getSettings().getRootSettings().getIndentOptions(StdFileTypes.JAVA).INDENT_SIZE = 2; getSettings().getRootSettings().getIndentOptions(StdFileTypes.JAVA).CONTINUATION_INDENT_SIZE = 2; getSettings().RIGHT_MARGIN = 37; @@ -1147,14 +1147,14 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } } - public void testLBrace() throws Exception { + public void testLBrace() { getSettings().METHOD_BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE; getSettings().RIGHT_MARGIN = 14; doTextTest("class Foo {\n" + " void foo() {\n" + " \n" + " }\n" + "}", "class Foo {\n" + " void foo() {\n" + "\n" + " }\n" + "}"); } - public void testJavaDocLeadingAsterisksAreDisabled() throws Exception { + public void testJavaDocLeadingAsterisksAreDisabled() { getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = false; doTextTest("class Foo {\n" + " /**\n" + @@ -1173,7 +1173,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testBinaryExpression() throws Exception { + public void testBinaryExpression() { getSettings().ALIGN_MULTILINE_BINARY_OPERATION = true; doTextTest("class Foo {\n" + " void foo() {\n" + @@ -1192,7 +1192,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testCaseBraces() throws Exception { + public void testCaseBraces() { doTextTest("class Foo{\n" + " void foo() {\n" + " switch (a) {\n" + @@ -1210,7 +1210,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testFormatCodeFragment() throws Exception { + public void testFormatCodeFragment() { final JavaCodeFragmentFactory factory = JavaCodeFragmentFactory.getInstance(getProject()); final PsiCodeFragment fragment = factory.createCodeBlockCodeFragment("a=1;int b=2;", null, true); final PsiElement[] result = new PsiElement[1]; @@ -1227,7 +1227,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { assertEquals("a = 1;\n" + "int b = 2;", result[0].getText()); } - public void testNewLineAfterJavaDocs() throws Exception { + public void testNewLineAfterJavaDocs() { String before = "/** @noinspection InstanceVariableNamingConvention*/class Foo{\n" + "/** @noinspection InstanceVariableNamingConvention*/int myFoo;\n" + "/** @noinspection InstanceVariableNamingConvention*/ void foo(){}}"; @@ -1251,7 +1251,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTextTest(before, after); } - public void testArrayInitializerWrapping() throws Exception { + public void testArrayInitializerWrapping() { getSettings().ARRAY_INITIALIZER_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION = false; getSettings().RIGHT_MARGIN = 37; @@ -1293,7 +1293,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testJavaDocIndentation() throws Exception { + public void testJavaDocIndentation() { getSettings().getRootSettings().getIndentOptions(StdFileTypes.JAVA).INDENT_SIZE = 2; getSettings().getRootSettings().getIndentOptions(StdFileTypes.JAVA).CONTINUATION_INDENT_SIZE = 2; getSettings().getRootSettings().getIndentOptions(StdFileTypes.JAVA).TAB_SIZE = 4; @@ -1325,7 +1325,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testRemoveLineBreak() throws Exception { + public void testRemoveLineBreak() { getSettings().KEEP_LINE_BREAKS = true; getSettings().CLASS_BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE; getSettings().METHOD_BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE; @@ -1340,7 +1340,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testBlankLines() throws Exception { + public void testBlankLines() { getSettings().KEEP_BLANK_LINES_IN_DECLARATIONS = 0; getSettings().KEEP_BLANK_LINES_IN_CODE = 0; getSettings().KEEP_BLANK_LINES_BEFORE_RBRACE = 0; @@ -1426,7 +1426,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testStaticBlockBraces() throws Exception { + public void testStaticBlockBraces() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE; doTextTest("class Foo {\n" + " static {\n" + " //comment\n" + " i = foo();\n" + " }\n" + "}", "class Foo {\n" + " static {\n" + " //comment\n" + " i = foo();\n" + " }\n" + "}"); @@ -1457,7 +1457,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testBraces2() throws Exception { + public void testBraces2() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_IF_WRAPPED; doTextTest("class Foo {\n" + " void foo() {\n" + @@ -1536,7 +1536,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testSynchronized() throws Exception { + public void testSynchronized() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE; doTextTest("class Foo {\n" + " void foo() {\n" + "synchronized (this) {foo();\n" + "}\n" + " }\n" + "}", "class Foo {\n" + @@ -1580,19 +1580,19 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testNextLineShiftedForBlockStatement() throws Exception { + public void testNextLineShiftedForBlockStatement() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_SHIFTED; doTextTest("class Foo {\n" + " void foo() {\n" + " if (a)\n" + " foo();\n" + " }\n" + "}", "class Foo {\n" + " void foo() {\n" + " if (a)\n" + " foo();\n" + " }\n" + "}"); } - public void testFieldWithJavadocAndAnnotation() throws Exception { + public void testFieldWithJavadocAndAnnotation() { doTextTest("class Foo {\n" + " /**\n" + " * java doc\n" + " */\n" + " @NoInspection\n" + " String field;\n" + "}", "class Foo {\n" + " /**\n" + " * java doc\n" + " */\n" + " @NoInspection\n" + " String field;\n" + "}"); } - public void testLongCallChainAfterElse() throws Exception { + public void testLongCallChainAfterElse() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; getSettings().KEEP_CONTROL_STATEMENT_IN_ONE_LINE = true; getSettings().KEEP_SIMPLE_METHODS_IN_ONE_LINE = true; @@ -1616,7 +1616,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testSpacesIncode() throws Exception { + public void testSpacesIncode() { final JavaPsiFacade facade = getJavaFacade(); final LanguageLevel level = LanguageLevelProjectExtension.getInstance(facade.getProject()).getLanguageLevel(); @@ -1671,7 +1671,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } ///IDEA-7761 - public void testKeepBlankLineInCodeBeforeComment() throws Exception { + public void testKeepBlankLineInCodeBeforeComment() { getSettings().KEEP_BLANK_LINES_IN_CODE = 1; getSettings().KEEP_BLANK_LINES_IN_DECLARATIONS = 0; getSettings().KEEP_FIRST_COLUMN_COMMENT = false; @@ -1735,7 +1735,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testSpaceBeforeTryBrace() throws Exception { + public void testSpaceBeforeTryBrace() { getSettings().SPACE_BEFORE_TRY_LBRACE = false; getSettings().SPACE_BEFORE_FINALLY_LBRACE = true; doTextTest("class Foo{\n" + " void foo() {\n" + " try {\n" + " } finally {\n" + " }\n" + " }\n" + "}", @@ -1749,7 +1749,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testFormatComments() throws Exception { + public void testFormatComments() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; doTextTest("public class Test {\n" + "\n" + " /**\n" + " * The s property.\n" + " */\n" + " private String s;\n" + "}", "public class Test {\n" + "\n" + " /**\n" + " * The s property.\n" + " */\n" + " private String s;\n" + "}"); @@ -1822,12 +1822,12 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "class Foo {\n" + " @MyAnnotation\n" + " Foo() {\n" + " }\n" + "}"); } - public void testLongAnnotationsAreNotWrapped() throws Exception { + public void testLongAnnotationsAreNotWrapped() { getSettings().ARRAY_INITIALIZER_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; doTest(); } - public void testWrapExtendsList() throws Exception { + public void testWrapExtendsList() { getSettings().RIGHT_MARGIN = 50; getSettings().EXTENDS_LIST_WRAP = CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM; getSettings().EXTENDS_KEYWORD_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; @@ -1838,7 +1838,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { " ParameterDataEventListener {\n}"); } - public void testWrapLongExpression() throws Exception { + public void testWrapLongExpression() { getSettings().RIGHT_MARGIN = 80; getSettings().BINARY_OPERATION_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().ALIGN_MULTILINE_BINARY_OPERATION = true; @@ -1856,7 +1856,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testDoNotWrapCallChainIfParametersWrapped() throws Exception { + public void testDoNotWrapCallChainIfParametersWrapped() { getSettings().RIGHT_MARGIN = 87; getSettings().CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().METHOD_CALL_CHAIN_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; @@ -1874,7 +1874,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { ); } - public void testAlignTernaryOperation() throws Exception { + public void testAlignTernaryOperation() { getSettings().ALIGN_MULTILINE_TERNARY_OPERATION = true; doMethodTest("String s = x == 0 ? \"hello\" :\n" + " x == 5 ? \"something else\" :\n" + @@ -1890,7 +1890,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "int someVariable = a ?\n" + " x :\n" + " y;"); } - public void testRightMargin_2() throws Exception { + public void testRightMargin_2() { getSettings().RIGHT_MARGIN = 65; getSettings().ASSIGNMENT_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().PLACE_ASSIGNMENT_SIGN_ON_NEXT_LINE = true; @@ -1903,7 +1903,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { " = variableValue;"); } - public void testRightMargin_3() throws Exception { + public void testRightMargin_3() { getSettings().RIGHT_MARGIN = 65; getSettings().ASSIGNMENT_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().PLACE_ASSIGNMENT_SIGN_ON_NEXT_LINE = false; @@ -1959,7 +1959,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testWrapParamsOnEveryItem() throws Exception { + public void testWrapParamsOnEveryItem() { CodeStyleSettings codeStyleSettings = CodeStyleSettingsManager.getSettings(getProject()); int oldMargin = codeStyleSettings.getCommonSettings(JavaLanguage.INSTANCE).RIGHT_MARGIN; @@ -1999,7 +1999,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testCommentAfterDeclaration() throws Exception { + public void testCommentAfterDeclaration() { CodeStyleSettings codeStyleSettings = CodeStyleSettingsManager.getSettings(getProject()); CommonCodeStyleSettings javaSettings = codeStyleSettings.getCommonSettings(JavaLanguage.INSTANCE); @@ -2026,12 +2026,12 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { // Tickets-implied tests // ------------------------------------------------ - public void testSCR915() throws Exception { + public void testSCR915() { getSettings().SPACE_AROUND_ADDITIVE_OPERATORS = false; doTest("SCR915.java", "SCR915_after.java"); } - public void testSCR429() throws Exception { + public void testSCR429() { final CommonCodeStyleSettings settings = getSettings(); settings.KEEP_BLANK_LINES_IN_CODE = 2; settings.KEEP_BLANK_LINES_BEFORE_RBRACE = 2; @@ -2039,14 +2039,14 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { doTest(); } - public void testSCR548() throws Exception { + public void testSCR548() { final CommonCodeStyleSettings settings = getSettings(); settings.getRootSettings().getIndentOptions(StdFileTypes.JAVA).INDENT_SIZE = 4; settings.getRootSettings().getIndentOptions(StdFileTypes.JAVA).CONTINUATION_INDENT_SIZE = 2; doTest(); } - public void testIDEA_16151() throws Exception { + public void testIDEA_16151() { doClassTest("@ValidateNestedProperties({\n" + "@Validate(field=\"name\", required=true, maxlength=Trip.NAME),\n" + "@Validate(field=\"name\", required=true, maxlength=Trip.NAME)\n" + @@ -2061,7 +2061,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { } - public void testIDEA_14324() throws Exception { + public void testIDEA_14324() { getSettings().ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION = true; doClassTest( @@ -2090,7 +2090,7 @@ public class JavaFormatterTest extends AbstractJavaFormatterTest { ); } -public void testSCR260() throws Exception { +public void testSCR260() { final CommonCodeStyleSettings settings = getSettings(); settings.IF_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_ALWAYS; settings.BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE; @@ -2098,14 +2098,14 @@ public void testSCR260() throws Exception { doTest(); } - public void testSCR114() throws Exception { + public void testSCR114() { final CommonCodeStyleSettings settings = getSettings(); settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; settings.CATCH_ON_NEW_LINE = true; doTest(); } - public void testSCR259() throws Exception { + public void testSCR259() { myTextRange = new TextRange(36, 60); final CommonCodeStyleSettings settings = getSettings(); settings.IF_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_ALWAYS; @@ -2113,19 +2113,19 @@ public void testSCR260() throws Exception { doTest(); } - public void testSCR279() throws Exception { + public void testSCR279() { final CommonCodeStyleSettings settings = getSettings(); settings.ALIGN_MULTILINE_BINARY_OPERATION = true; doTest(); } - public void testSCR395() throws Exception { + public void testSCR395() { final CommonCodeStyleSettings settings = getSettings(); settings.METHOD_BRACE_STYLE = CommonCodeStyleSettings.END_OF_LINE; doTest(); } - public void testSCR11799() throws Exception { + public void testSCR11799() { final CommonCodeStyleSettings settings = getSettings(); settings.getRootSettings().getIndentOptions(StdFileTypes.JAVA).CONTINUATION_INDENT_SIZE = 4; settings.CLASS_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; @@ -2133,13 +2133,13 @@ public void testSCR260() throws Exception { doTest(); } - public void testSCR501() throws Exception { + public void testSCR501() { final CommonCodeStyleSettings settings = getSettings(); settings.KEEP_FIRST_COLUMN_COMMENT = true; doTest(); } - public void testSCR879() throws Exception { + public void testSCR879() { final CommonCodeStyleSettings settings = getSettings(); settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; doTest(); @@ -2147,7 +2147,7 @@ public void testSCR260() throws Exception { - public void testSCR547() throws Exception { + public void testSCR547() { doTextTest("class Foo { \n" + " Object[] objs = { \n" + " new Object() { \n" + @@ -2167,7 +2167,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR479() throws Exception { + public void testSCR479() { final CommonCodeStyleSettings settings = getSettings(); settings.RIGHT_MARGIN = 80; settings.TERNARY_OPERATION_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; @@ -2184,7 +2184,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR190() throws Exception { + public void testSCR190() { final CommonCodeStyleSettings settings = getSettings(); settings.KEEP_LINE_BREAKS = false; doTextTest("public class EntityObject \n" + @@ -2213,7 +2213,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR1535() throws Exception { + public void testSCR1535() { final CommonCodeStyleSettings settings = getSettings(); settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; settings.CLASS_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; @@ -2236,7 +2236,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR970() throws Exception { + public void testSCR970() { final CommonCodeStyleSettings settings = getSettings(); settings.THROWS_KEYWORD_WRAP = CommonCodeStyleSettings.WRAP_ALWAYS; settings.THROWS_LIST_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; @@ -2244,7 +2244,7 @@ public void testSCR260() throws Exception { doTest(); } - public void testSCR1486() throws Exception { + public void testSCR1486() { doTextTest("public class Test {\n" + " private BigDecimal\n" + "}", "public class Test {\n" + " private BigDecimal\n" + "}"); doTextTest("public class Test {\n" + " @NotNull private BigDecimal\n" + "}", @@ -2252,7 +2252,7 @@ public void testSCR260() throws Exception { } - public void test1607() throws Exception { + public void test1607() { getSettings().RIGHT_MARGIN = 30; getSettings().METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; getSettings().KEEP_SIMPLE_METHODS_IN_ONE_LINE = true; @@ -2262,7 +2262,7 @@ public void testSCR260() throws Exception { "class TEst {\n" + " void foo(A a, B b)\n" + " { /* compiled code */ }\n" + "}"); } - public void testSCR1615() throws Exception { + public void testSCR1615() { getSettings().CLASS_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_SHIFTED; getSettings().METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_SHIFTED; getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_SHIFTED; @@ -2288,12 +2288,12 @@ public void testSCR260() throws Exception { " }"); } - public void testSCR1047() throws Exception { + public void testSCR1047() { doTextTest("class Foo{\n" + " void foo(){\n" + " String field1, field2;\n" + " }\n" + "}", "class Foo {\n" + " void foo() {\n" + " String field1, field2;\n" + " }\n" + "}"); } - public void testSCR524() throws Exception { + public void testSCR524() { getSettings().METHOD_BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_SHIFTED; getSettings().KEEP_SIMPLE_METHODS_IN_ONE_LINE = true; getSettings().KEEP_SIMPLE_BLOCKS_IN_ONE_LINE = false; @@ -2326,7 +2326,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR3062() throws Exception { + public void testSCR3062() { getSettings().KEEP_LINE_BREAKS = false; getSettings().METHOD_CALL_CHAIN_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; getSettings().CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; @@ -2370,22 +2370,22 @@ public void testSCR260() throws Exception { } - public void testSCR1658() throws Exception { + public void testSCR1658() { doTextTest("/** \n" + " * @author\tMike\n" + " */\n" + "public class Foo {\n" + "}", "/**\n" + " * @author Mike\n" + " */\n" + "public class Foo {\n" + "}"); } - public void testSCR1699() throws Exception { + public void testSCR1699() { doTextTest("class Test {\n" + " Test(String t1 , String t2) {\n" + " }\n" + "}", "class Test {\n" + " Test(String t1, String t2) {\n" + " }\n" + "}"); } - public void testSCR1700() throws Exception { + public void testSCR1700() { doTextTest("class Test {\n" + " Test(String t1 , String t2) {\n" + " }\n" + "}", "class Test {\n" + " Test(String t1, String t2) {\n" + " }\n" + "}"); } - public void testSCR1701() throws Exception { + public void testSCR1701() { getSettings().SPACE_WITHIN_METHOD_CALL_PARENTHESES = true; getSettings().SPACE_WITHIN_METHOD_PARENTHESES = false; getSettings().CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP; @@ -2395,7 +2395,7 @@ public void testSCR260() throws Exception { "class Foo {\n" + " void foo() {\n" + " foo( a, b );\n" + " }\n" + "}"); } - public void testSCR1703() throws Exception { + public void testSCR1703() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE; doTextTest("class Foo{\n" + " void foo() {\n" + @@ -2413,7 +2413,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR1804() throws Exception { + public void testSCR1804() { getSettings().ALIGN_MULTILINE_ASSIGNMENT = true; doTextTest( "class Foo {\n" + " void foo() {\n" + " int i;\n" + " i = \n" + " 1 + 2;\n" + " }\n" + "}", @@ -2424,7 +2424,7 @@ public void testSCR260() throws Exception { } - public void testSCR1795() throws Exception { + public void testSCR1795() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_IF_WRAPPED; doTextTest("public class Test {\n" + " public static void main(String[] args) {\n" + @@ -2441,7 +2441,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR1936() throws Exception { + public void testSCR1936() { getSettings().BLANK_LINES_AFTER_CLASS_HEADER = 4; doTextTest("/**\n" + " * Foo - test class\n" + " */\n" + "class Foo{\n" + "}", "/**\n" + " * Foo - test class\n" + " */\n" + "class Foo {\n" + "\n" + "\n" + "\n" + "\n" + "}"); @@ -2451,7 +2451,7 @@ public void testSCR260() throws Exception { } - public void test1980() throws Exception { + public void test1980() { getSettings().RIGHT_MARGIN = 144; getSettings().TERNARY_OPERATION_WRAP = CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM; getSettings().METHOD_CALL_CHAIN_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED; @@ -2470,7 +2470,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR2089() throws Exception { + public void testSCR2089() { doTextTest("class Test { \n" + " void test(int i) { \n" + " switch (i) { \n" + @@ -2504,7 +2504,7 @@ public void testSCR260() throws Exception { "}"); } - public void testSCR2132() throws Exception { + public void testSCR2132() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_IF_WRAPPED; getSettings().ELSE_ON_NEW_LINE = true; @@ -2531,7 +2531,7 @@ public void testSCR260() throws Exception { "}"); } - public void testIDEADEV1047() throws Exception { + public void testIDEADEV1047() { doTextTest("class Foo{\n" + "String field1\n" + ",\n" + "field2\n" + ";" + "}", "class Foo {\n" + " String field1,\n" + " field2;\n" + "}"); @@ -2540,7 +2540,7 @@ public void testSCR260() throws Exception { } - public void testIDEADEV1047_2() throws Exception { + public void testIDEADEV1047_2() { doTextTest( "class Foo{\n" + "String field1\n" + @@ -2555,7 +2555,7 @@ public void testSCR260() throws Exception { ); } - public void testSCR2241() throws Exception { + public void testSCR2241() { getSettings().BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE_SHIFTED; getSettings().SPECIAL_ELSE_IF_TREATMENT = true; getSettings().ELSE_ON_NEW_LINE = true; @@ -2764,7 +2764,7 @@ public void testSCR260() throws Exception { } - public void testSCR3115() throws Exception { + public void testSCR3115() { final CommonCodeStyleSettings.IndentOptions indentOptions = getSettings().getRootSettings().getIndentOptions(StdFileTypes.JAVA); indentOptions.USE_TAB_CHARACTER = true; indentOptions.SMART_TABS = true; @@ -2788,7 +2788,7 @@ public void testSCR260() throws Exception { "}"); } - public void testIDEADEV_6239() throws Exception { + public void testIDEADEV_6239() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; doTextTest("public class Test {\n" + "\n" + @@ -3007,7 +3007,7 @@ public void testSCR260() throws Exception { "public interface TestInterface {\n" + " @Deprecated\n" + " void parametrizedAnnotated(T data);\n" + "}"); } - public void testIDEA_54406() throws Exception { + public void testIDEA_54406() { doTextTest("public class Test1 {\n" + "void func() {\n" + "new Thread(new Runnable() {\n" + @@ -3062,13 +3062,13 @@ public void testSCR260() throws Exception { - public void testFormatterOnOffTags() throws Exception { + public void testFormatterOnOffTags() { getSettings().getRootSettings().FORMATTER_TAGS_ENABLED = true; getSettings().IF_BRACE_FORCE = CommonCodeStyleSettings.FORCE_BRACES_ALWAYS; doTest(); } - public void testFormatterOnOffTagsWithRegexp() throws Exception { + public void testFormatterOnOffTagsWithRegexp() { CodeStyleSettings settings = getSettings().getRootSettings(); settings.FORMATTER_TAGS_ENABLED = true; settings.FORMATTER_TAGS_ACCEPT_REGEXP = true; diff --git a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavadocFormatterTest.java b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavadocFormatterTest.java index 9cd71b5f3ace..b0e70ea1dafd 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavadocFormatterTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavadocFormatterTest.java @@ -28,7 +28,7 @@ import com.intellij.psi.codeStyle.CommonCodeStyleSettings; */ public class JavadocFormatterTest extends AbstractJavaFormatterTest { - public void testRightMargin() throws Exception { + public void testRightMargin() { getSettings().WRAP_LONG_LINES = true; getSettings().RIGHT_MARGIN = 35; doTextTest( @@ -65,7 +65,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { } - public void testDoNotWrapLink() throws Exception { + public void testDoNotWrapLink() { getSettings().WRAP_LONG_LINES = true; getSettings().RIGHT_MARGIN = 70; doTextTest( @@ -104,7 +104,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { } - public void testPackageJavadoc() throws Exception { + public void testPackageJavadoc() { doTextTest( "/**\n" + " * super auper\n" + @@ -172,7 +172,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { ); } - public void testEA49739() throws Exception { + public void testEA49739() { getSettings().WRAP_LONG_LINES = true; getSettings().RIGHT_MARGIN = 35; getSettings().WRAP_COMMENTS = true; @@ -195,7 +195,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testOneLineCommentWrappedByRightMarginIntoMultiLine() throws Exception { + public void testOneLineCommentWrappedByRightMarginIntoMultiLine() { getSettings().getRootSettings().WRAP_COMMENTS = true; getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = true; @@ -235,7 +235,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { ); } - public void testSCR11296() throws Exception { + public void testSCR11296() { final CommonCodeStyleSettings settings = getSettings(); settings.RIGHT_MARGIN = 50; settings.getRootSettings().WRAP_COMMENTS = true; @@ -245,7 +245,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doTest(); } - public void testSCR2632() throws Exception { + public void testSCR2632() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getSettings().getRootSettings().WRAP_COMMENTS = true; getSettings().RIGHT_MARGIN = 20; @@ -327,7 +327,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { ); } - public void testParameterDescriptionNotOnNewLine() throws Exception { + public void testParameterDescriptionNotOnNewLine() { // IDEA-107383 getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getJavaSettings().JD_ALIGN_PARAM_COMMENTS = true; @@ -351,7 +351,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { "}"); } - public void testWrappedParameterDescription() throws Exception { + public void testWrappedParameterDescription() { // Inspired by IDEA-13072 getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getSettings().getRootSettings().WRAP_COMMENTS = true; @@ -421,7 +421,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doTextTest(before, after); } - public void testDoNotWrapMultiLineCommentIntoOneLine() throws Exception { + public void testDoNotWrapMultiLineCommentIntoOneLine() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = true; String test = "/**\n" + @@ -433,7 +433,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doClassTest(test, test); } - public void testLeaveOneLineComment() throws Exception { + public void testLeaveOneLineComment() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = true; String test = "/** foo */\n" + @@ -443,7 +443,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doClassTest(test, test); } - public void testWrapOneLineComment() throws Exception { + public void testWrapOneLineComment() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = false; String test = "/** foo */\n" + @@ -459,7 +459,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doClassTest(test, after); } - public void testWrapStrangeComment() throws Exception { + public void testWrapStrangeComment() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = false; String test = "/** foo" + @@ -476,7 +476,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doClassTest(test, after); } - public void testWrapStrangeCommentIfNotWrapOneLines() throws Exception { + public void testWrapStrangeCommentIfNotWrapOneLines() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getJavaSettings().JD_DO_NOT_WRAP_ONE_LINE_COMMENTS = true; String test = "/** foo\n" + @@ -494,7 +494,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { } - public void testReturnTagAlignment() throws Exception { + public void testReturnTagAlignment() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getSettings().RIGHT_MARGIN = 80; getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true; @@ -522,7 +522,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { } - public void testReturnTagAlignmentWithPreTagOnFirstLine() throws Exception { + public void testReturnTagAlignmentWithPreTagOnFirstLine() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getSettings().RIGHT_MARGIN = 80; getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true; @@ -574,7 +574,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { ); } - public void testSeeTagAlignment() throws Exception { + public void testSeeTagAlignment() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getSettings().RIGHT_MARGIN = 80; getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true; @@ -601,7 +601,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doClassTest(before, after); } - public void testDummySinceTagAlignment() throws Exception { + public void testDummySinceTagAlignment() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getSettings().RIGHT_MARGIN = 80; getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true; @@ -628,7 +628,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doClassTest(before, after); } - public void testDummyDeprecatedTagAlignment() throws Exception { + public void testDummyDeprecatedTagAlignment() { getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; getSettings().RIGHT_MARGIN = 80; getJavaSettings().JD_LEADING_ASTERISKS_ARE_ENABLED = true; @@ -818,7 +818,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doTextTest(before, after); } - public void testDoNotWrapLongLineCommentWithSpaceInStart() throws Exception { + public void testDoNotWrapLongLineCommentWithSpaceInStart() { getSettings().KEEP_FIRST_COLUMN_COMMENT = true; getSettings().WRAP_LONG_LINES = true; getSettings().RIGHT_MARGIN = 200; @@ -832,7 +832,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { } - public void testNotGenerateSelfClosingPTagIfLanguageLevelJava8() throws Exception { + public void testNotGenerateSelfClosingPTagIfLanguageLevelJava8() { getJavaSettings().JD_P_AT_EMPTY_LINES = true; getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; String before = "/**\n" + @@ -852,7 +852,7 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest { doClassTest(before, after); } - public void testPTagIfLanguageLevelNotJava8() throws Exception { + public void testPTagIfLanguageLevelNotJava8() { getJavaSettings().JD_P_AT_EMPTY_LINES = true; getJavaSettings().ENABLE_JAVADOC_FORMATTING = true; LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_7); diff --git a/java/java-tests/testSrc/com/intellij/java/refactoring/InplaceIntroduceVariableTest.java b/java/java-tests/testSrc/com/intellij/java/refactoring/InplaceIntroduceVariableTest.java index 272af0323d0b..e8dced7dc2a6 100644 --- a/java/java-tests/testSrc/com/intellij/java/refactoring/InplaceIntroduceVariableTest.java +++ b/java/java-tests/testSrc/com/intellij/java/refactoring/InplaceIntroduceVariableTest.java @@ -62,7 +62,7 @@ public class InplaceIntroduceVariableTest extends AbstractJavaInplaceIntroduceTe }); } - public void testConflictingInnerClassName() throws Exception { + public void testConflictingInnerClassName() { final JavaCodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject()).getCustomSettings(JavaCodeStyleSettings.class); final boolean oldOption = settings.INSERT_INNER_CLASS_IMPORTS; try { diff --git a/java/java-tests/testSrc/com/intellij/java/refactoring/MakeClassStaticTest.java b/java/java-tests/testSrc/com/intellij/java/refactoring/MakeClassStaticTest.java index 9c0a5052a106..50bc744d2cb2 100644 --- a/java/java-tests/testSrc/com/intellij/java/refactoring/MakeClassStaticTest.java +++ b/java/java-tests/testSrc/com/intellij/java/refactoring/MakeClassStaticTest.java @@ -63,7 +63,7 @@ public class MakeClassStaticTest extends LightRefactoringTestCase { perform(); } - public void testFieldWithMyPrefix() throws Exception { + public void testFieldWithMyPrefix() { final JavaCodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject()).getCustomSettings(JavaCodeStyleSettings.class); String oldPrefix = settings.FIELD_NAME_PREFIX; settings.FIELD_NAME_PREFIX = "my"; diff --git a/java/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java b/java/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java index 88b67ebaf3d7..53b747823ef0 100644 --- a/java/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java +++ b/java/typeMigration/test/com/intellij/codeInsight/ConvertToAtomicIntentionTest.java @@ -37,7 +37,7 @@ public class ConvertToAtomicIntentionTest extends LightQuickFixParameterizedTest super.tearDown(); } - public void test() throws Exception { + public void test() { doAllTests(); } } \ No newline at end of file diff --git a/java/typeMigration/test/com/intellij/codeInsight/ConvertToLongAdderIntentionTest.java b/java/typeMigration/test/com/intellij/codeInsight/ConvertToLongAdderIntentionTest.java index 5b4d36009497..9c7f3519575e 100644 --- a/java/typeMigration/test/com/intellij/codeInsight/ConvertToLongAdderIntentionTest.java +++ b/java/typeMigration/test/com/intellij/codeInsight/ConvertToLongAdderIntentionTest.java @@ -39,7 +39,7 @@ public class ConvertToLongAdderIntentionTest extends LightQuickFixParameterizedT return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData"; } - public void test() throws Exception { + public void test() { doAllTests(); } } diff --git a/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntention6Test.java b/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntention6Test.java index 6b65b2c745dc..09dfb947b05d 100644 --- a/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntention6Test.java +++ b/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntention6Test.java @@ -32,7 +32,7 @@ public class ConvertToThreadLocalIntention6Test extends LightQuickFixParameteriz return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData"; } - public void test() throws Exception { + public void test() { doAllTests(); } diff --git a/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java b/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java index 6a358bbbb2d1..a89dcca3ba3d 100644 --- a/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java +++ b/java/typeMigration/test/com/intellij/codeInsight/ConvertToThreadLocalIntentionTest.java @@ -19,7 +19,7 @@ public class ConvertToThreadLocalIntentionTest extends LightQuickFixParameterize return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData"; } - public void test() throws Exception { + public void test() { doAllTests(); } } \ No newline at end of file diff --git a/java/typeMigration/test/com/intellij/codeInsight/inspections/GuavaInspectionTest.java b/java/typeMigration/test/com/intellij/codeInsight/inspections/GuavaInspectionTest.java index f83021ba9d4f..2b646ff8aa75 100644 --- a/java/typeMigration/test/com/intellij/codeInsight/inspections/GuavaInspectionTest.java +++ b/java/typeMigration/test/com/intellij/codeInsight/inspections/GuavaInspectionTest.java @@ -54,7 +54,7 @@ public class GuavaInspectionTest extends JavaCodeInsightFixtureTestCase { } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { moduleBuilder.setLanguageLevel(LanguageLevel.JDK_1_8); moduleBuilder.addLibraryJars("guava", getTestDataPath() + "/", "guava-stubs.jar"); moduleBuilder.addLibraryJars("jsr305", PathManager.getHomePathFor(Assert.class) + "/lib/", "jsr305.jar"); diff --git a/java/typeMigration/test/com/intellij/codeInsight/inspections/MigrateAssertToMatcherAssertTest.java b/java/typeMigration/test/com/intellij/codeInsight/inspections/MigrateAssertToMatcherAssertTest.java index 9d405e9ae6bb..12c8000dd3ac 100644 --- a/java/typeMigration/test/com/intellij/codeInsight/inspections/MigrateAssertToMatcherAssertTest.java +++ b/java/typeMigration/test/com/intellij/codeInsight/inspections/MigrateAssertToMatcherAssertTest.java @@ -35,7 +35,7 @@ public class MigrateAssertToMatcherAssertTest extends JavaCodeInsightFixtureTest } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { moduleBuilder.addLibraryJars("test-env", PathManager.getHomePathFor(Assert.class) + "/lib", "junit-4.12.jar", "hamcrest-core-1.3.jar"); } diff --git a/java/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java b/java/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java index c01576fd5dab..fefd04423b84 100644 --- a/java/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java +++ b/java/typeMigration/test/com/intellij/refactoring/ChangeTypeSignatureTest.java @@ -34,7 +34,7 @@ public class ChangeTypeSignatureTest extends LightCodeInsightTestCase { return PlatformTestUtil.getCommunityPath() + "/java/typeMigration/testData"; } - private void doTest(boolean success, String migrationTypeText) throws Exception { + private void doTest(boolean success, String migrationTypeText) { String dataPath = "/refactoring/changeTypeSignature/"; configureByFile(dataPath + getTestName(false) + ".java"); final PsiFile file = getFile(); @@ -68,91 +68,91 @@ public class ChangeTypeSignatureTest extends LightCodeInsightTestCase { } } - private void doTest(boolean success) throws Exception { + private void doTest(boolean success) { doTest(success, CommonClassNames.JAVA_LANG_OBJECT); } - public void testListTypeArguments() throws Exception { + public void testListTypeArguments() { doTest(true); } - public void testFieldUsage() throws Exception { + public void testFieldUsage() { doTest(true); } - public void testFieldUsage1() throws Exception { + public void testFieldUsage1() { doTest(true); } - public void testReturnType() throws Exception { + public void testReturnType() { doTest(true); } - public void testReturnType1() throws Exception { + public void testReturnType1() { doTest(true); } - public void testReturnType2() throws Exception { + public void testReturnType2() { doTest(true); } - public void testPassedParameter() throws Exception { + public void testPassedParameter() { doTest(true); } - public void testPassedParameter1() throws Exception { + public void testPassedParameter1() { doTest(true, "java.lang.Integer"); } - public void testPassedParameter2() throws Exception { + public void testPassedParameter2() { doTest(true); } - public void testUsedInSuper() throws Exception { + public void testUsedInSuper() { doTest(true); } - public void testCompositeReturnType() throws Exception { + public void testCompositeReturnType() { doTest(true); } - public void testTypeHierarchy() throws Exception { + public void testTypeHierarchy() { doTest(true); } - public void testTypeHierarchy1() throws Exception { + public void testTypeHierarchy1() { doTest(true); } - public void testTypeHierarchy2() throws Exception { + public void testTypeHierarchy2() { doTest(true); } - public void testTypeHierarchyFieldUsage() throws Exception { + public void testTypeHierarchyFieldUsage() { doTest(true); } - public void testTypeHierarchyFieldUsageConflict() throws Exception { + public void testTypeHierarchyFieldUsageConflict() { doTest(true); } - public void testParameterMigration() throws Exception { + public void testParameterMigration() { doTest(true); } - public void testParameterMigration1() throws Exception { + public void testParameterMigration1() { doTest(true, "java.lang.Integer"); } - public void testParameterMigration2() throws Exception { + public void testParameterMigration2() { doTest(true, "java.lang.Integer"); } - public void testFieldTypeMigration() throws Exception { + public void testFieldTypeMigration() { doTest(true, "java.lang.String"); } - public void testMethodReturnTypeMigration() throws Exception { + public void testMethodReturnTypeMigration() { doTest(true, "java.lang.Integer"); } } \ No newline at end of file diff --git a/java/typeMigration/test/com/intellij/refactoring/MigrateTypeSignatureTest.java b/java/typeMigration/test/com/intellij/refactoring/MigrateTypeSignatureTest.java index c2e442fac6b7..81b8099e5557 100644 --- a/java/typeMigration/test/com/intellij/refactoring/MigrateTypeSignatureTest.java +++ b/java/typeMigration/test/com/intellij/refactoring/MigrateTypeSignatureTest.java @@ -12,494 +12,494 @@ public class MigrateTypeSignatureTest extends TypeMigrationTestBase { return "/refactoring/migrateTypeSignature/"; } - public void testExprAccess2Lvalue() throws Exception { + public void testExprAccess2Lvalue() { doTestFieldType("myForAccess", "Expr", myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null)); } - public void testExprAccess2Rvalue() throws Exception { + public void testExprAccess2Rvalue() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("ClassGrandChild", null)); } - public void testExprAccessParent2Lvalue() throws Exception { + public void testExprAccessParent2Lvalue() { doTestFieldType("myForSuperAccess", "Ession", myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null)); } - public void testExprAccessParent2Rvalue() throws Exception { + public void testExprAccessParent2Rvalue() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("ClassGrandChild", null)); } - public void testExprArrayAccessNegative() throws Exception { + public void testExprArrayAccessNegative() { doTestFirstParamType("meth", "Expr", PsiType.DOUBLE); } - public void testExprArrayAccessPositive() throws Exception { + public void testExprArrayAccessPositive() { doTestFirstParamType("meth", "Expr", PsiType.CHAR); } - public void testExprCalcBooleanBoolean() throws Exception { + public void testExprCalcBooleanBoolean() { doTestFirstParamType("meth", "Expr", PsiType.INT); } - public void testExprCalcBooleanNumeric() throws Exception { + public void testExprCalcBooleanNumeric() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_LANG_OBJECT, null)); } - public void testExprCalcBooleanReference() throws Exception { + public void testExprCalcBooleanReference() { doTestFirstParamType("meth", "Expr", PsiType.DOUBLE); } - public void testExprCalcNumeric2Boolean() throws Exception { + public void testExprCalcNumeric2Boolean() { doTestFirstParamType("meth", "Expr", PsiType.BOOLEAN); } - public void testExprCalcNumeric2Floating() throws Exception { + public void testExprCalcNumeric2Floating() { doTestFirstParamType("meth", "Expr", PsiType.FLOAT); } - public void testExprCalcNumeric2Int() throws Exception { + public void testExprCalcNumeric2Int() { doTestFirstParamType("meth", "Expr", PsiType.LONG); } - public void testExprCalcNumeric2String() throws Exception { + public void testExprCalcNumeric2String() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null)); } - public void testExprCast2LvalueNeg() throws Exception { + public void testExprCast2LvalueNeg() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null)); } - public void testExprCast2LvaluePos() throws Exception { + public void testExprCast2LvaluePos() { doTestFirstParamType("meth", "Expr", PsiType.INT); } - public void testExprConcatNumeric2Reference() throws Exception { + public void testExprConcatNumeric2Reference() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_LANG_OBJECT, null)); } - public void testExprConcatNumeric2String() throws Exception { + public void testExprConcatNumeric2String() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null)); } - public void testExprConcatString2Numeric() throws Exception { + public void testExprConcatString2Numeric() { doTestFirstParamType("meth", "Expr", PsiType.INT); } - public void testExprConcatString2Reference() throws Exception { + public void testExprConcatString2Reference() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_LANG_OBJECT, null)); } - public void testExprInstanceofNeg() throws Exception { + public void testExprInstanceofNeg() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_UTIL_LIST, null)); } - public void testExprInstanceofPos() throws Exception { + public void testExprInstanceofPos() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.util.AbstractMap", null)); } - public void testExprLiteralBoolean() throws Exception { + public void testExprLiteralBoolean() { doTestFieldType("myField", "Expr", PsiType.BOOLEAN); } - public void testExprLiteralByte() throws Exception { + public void testExprLiteralByte() { doTestFieldType("myField", "Expr", PsiType.BYTE); } - public void testExprLiteralChar() throws Exception { + public void testExprLiteralChar() { doTestFieldType("myField", "Expr", PsiType.CHAR); } - public void testExprLiteralClassExtends() throws Exception { + public void testExprLiteralClassExtends() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class", null)); } - public void testExprLiteralClassPrimitive() throws Exception { + public void testExprLiteralClassPrimitive() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class", null)); } - public void testExprLiteralClassPrimitiveArray() throws Exception { + public void testExprLiteralClassPrimitiveArray() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class", null)); } - public void testExprLiteralClassRaw() throws Exception { + public void testExprLiteralClassRaw() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class", null)); } - public void testExprLiteralClassReference() throws Exception { + public void testExprLiteralClassReference() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class", null)); } - public void testExprLiteralClassReferenceArray() throws Exception { + public void testExprLiteralClassReferenceArray() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class", null)); } - public void testExprLiteralClassSuper() throws Exception { + public void testExprLiteralClassSuper() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Class", null)); } - public void testExprLiteralDouble() throws Exception { + public void testExprLiteralDouble() { doTestFieldType("myField", "Expr", PsiType.DOUBLE); } - public void testExprLiteralFloat() throws Exception { + public void testExprLiteralFloat() { doTestFieldType("myField", "Expr", PsiType.FLOAT); } - public void testExprLiteralInt() throws Exception { + public void testExprLiteralInt() { doTestFieldType("myField", "Expr", PsiType.INT); } - public void testExprLiteralLong() throws Exception { + public void testExprLiteralLong() { doTestFieldType("myField", "Expr", PsiType.LONG); } - public void testExprLiteralShort() throws Exception { + public void testExprLiteralShort() { doTestFieldType("myField", "Expr", PsiType.SHORT); } - public void testExprLiteralString() throws Exception { + public void testExprLiteralString() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null)); } - public void testExprNewArrayArray2Lvalue() throws Exception { + public void testExprNewArrayArray2Lvalue() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("FaceParent", null).createArrayType()); } - public void testExprNewArrayArray2Rvalue() throws Exception { + public void testExprNewArrayArray2Rvalue() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null).createArrayType().createArrayType().createArrayType()); } - public void testExprNewArrayGen2Rvalue() throws Exception { + public void testExprNewArrayGen2Rvalue() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null).createArrayType()); } - public void testExprNewArrayPrimitive2Lvalue() throws Exception { + public void testExprNewArrayPrimitive2Lvalue() { doTestFirstParamType("meth", "Expr", PsiType.INT); } - public void testExprNewArrayPrimitive2Rvalue() throws Exception { + public void testExprNewArrayPrimitive2Rvalue() { doTestFieldType("myField", "Expr", PsiType.INT.createArrayType().createArrayType()); } - public void testExprNewArrayReftype2Lvalue() throws Exception { + public void testExprNewArrayReftype2Lvalue() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("FaceParent", null)); } - public void testExprNewArrayReftype2Rvalue() throws Exception { + public void testExprNewArrayReftype2Rvalue() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null).createArrayType().createArrayType()); } - public void testExprNewGen() throws Exception { + public void testExprNewGen() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testExprNewGenExtends() throws Exception { + public void testExprNewGenExtends() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testExprNewGenSuper() throws Exception { + public void testExprNewGenSuper() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testExprNewReference() throws Exception { + public void testExprNewReference() { doTestFieldType("myField", "Expr", myJavaFacade.getElementFactory().createTypeFromText("Expr.Subject", null)); } - public void testExprReturn2Lvalue() throws Exception { + public void testExprReturn2Lvalue() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null)); } - public void testExprReturn2Rvalue() throws Exception { + public void testExprReturn2Rvalue() { doTestMethodType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null)); } - public void testExprTernary() throws Exception { + public void testExprTernary() { doTestFirstParamType("meth", "Expr", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null)); } - public void testOverridingDown() throws Exception { + public void testOverridingDown() { doTestMethodType("getInt", "Parent", PsiType.BYTE); } - public void testOverridingUp() throws Exception { + public void testOverridingUp() { doTestMethodType("getInt", "Child", PsiType.BYTE); } - public void testSpecJavadoc() throws Exception { + public void testSpecJavadoc() { JavaCodeStyleSettings settings = getCurrentCodeStyleSettings().getCustomSettings(JavaCodeStyleSettings.class); settings.CLASS_NAMES_IN_JAVADOC = JavaCodeStyleSettings.FULLY_QUALIFY_NAMES_ALWAYS; doTestFirstParamType("meth", "Spec", myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_UTIL_SET, null)); } - public void testSpecNotUsed() throws Exception { + public void testSpecNotUsed() { doTestFieldType("myField", "Spec", PsiType.BOOLEAN); } - public void testTypeArrayReftype2Lvalue() throws Exception { + public void testTypeArrayReftype2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("Subject", null).createArrayType()); } - public void testTypeArrayReftype2Rvalue() throws Exception { + public void testTypeArrayReftype2Rvalue() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText("Subject", null).createArrayType().createArrayType()); } - public void testTypeArrayRoots2Lvalue() throws Exception { + public void testTypeArrayRoots2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("Holder", null).createArrayType()); } - public void testTypeArrayVararg2Lvalue() throws Exception { + public void testTypeArrayVararg2Lvalue() { doTestFirstParamType("meth", "Type", new PsiEllipsisType(myJavaFacade.getElementFactory().createTypeFromText("Subject", null))); } - public void testTypeArrayVararg2RvalueNeg() throws Exception { + public void testTypeArrayVararg2RvalueNeg() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText("Descendant", null).createArrayType()); } - public void testTypeArrayVararg2RvaluePos() throws Exception { + public void testTypeArrayVararg2RvaluePos() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText("Subject", null).createArrayType()); } - public void testTypeAutoboxBoolean2Lvalue() throws Exception { + public void testTypeAutoboxBoolean2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Boolean", null)); } - public void testTypeAutoboxBoolean2Rvalue() throws Exception { + public void testTypeAutoboxBoolean2Rvalue() { doTestFieldType("myField", "Type", PsiType.BOOLEAN); } - public void testTypeAutoboxByte2Lvalue() throws Exception { + public void testTypeAutoboxByte2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Byte", null)); } - public void testTypeAutoboxByte2Rvalue() throws Exception { + public void testTypeAutoboxByte2Rvalue() { doTestFieldType("myField", "Type", PsiType.BYTE); } - public void testTypeAutoboxChar2Lvalue() throws Exception { + public void testTypeAutoboxChar2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Character", null)); } - public void testTypeAutoboxChar2Rvalue() throws Exception { + public void testTypeAutoboxChar2Rvalue() { doTestFieldType("myField", "Type", PsiType.CHAR); } - public void testTypeAutoboxDouble2Lvalue() throws Exception { + public void testTypeAutoboxDouble2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Double", null)); } - public void testTypeAutoboxDouble2Rvalue() throws Exception { + public void testTypeAutoboxDouble2Rvalue() { doTestFieldType("myField", "Type", PsiType.DOUBLE); } - public void testTypeAutoboxFloat2Lvalue() throws Exception { + public void testTypeAutoboxFloat2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Float", null)); } - public void testTypeAutoboxFloat2Rvalue() throws Exception { + public void testTypeAutoboxFloat2Rvalue() { doTestFieldType("myField", "Type", PsiType.FLOAT); } - public void testTypeAutoboxInt2Lvalue() throws Exception { + public void testTypeAutoboxInt2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Integer", null)); } - public void testTypeAutoboxInt2Rvalue() throws Exception { + public void testTypeAutoboxInt2Rvalue() { doTestFieldType("myField", "Type", PsiType.INT); } - public void testTypeAutoboxLong2Lvalue() throws Exception { + public void testTypeAutoboxLong2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Long", null)); } - public void testTypeAutoboxLong2Rvalue() throws Exception { + public void testTypeAutoboxLong2Rvalue() { doTestFieldType("myField", "Type", PsiType.LONG); } - public void testTypeAutoboxShort2Lvalue() throws Exception { + public void testTypeAutoboxShort2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Short", null)); } - public void testTypeAutoboxShort2Rvalue() throws Exception { + public void testTypeAutoboxShort2Rvalue() { doTestFieldType("myField", "Type", PsiType.SHORT); } - public void testTypeGenAncestor2Lvalue() throws Exception { + public void testTypeGenAncestor2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testTypeGenAncestorWildcard2Lvalue() throws Exception { + public void testTypeGenAncestorWildcard2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testTypeGenDescendant2Rvalue() throws Exception { + public void testTypeGenDescendant2Rvalue() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testTypeGenDescendantWildcard2Rvalue() throws Exception { + public void testTypeGenDescendantWildcard2Rvalue() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testTypeGenRaw2Lvalue() throws Exception { + public void testTypeGenRaw2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_UTIL_SET, null)); } - public void testTypeGenRaw2Rvalue() throws Exception { + public void testTypeGenRaw2Rvalue() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_UTIL_SET, null)); } - public void testTypePrimsubBoolean2Lvalue() throws Exception { + public void testTypePrimsubBoolean2Lvalue() { doTestFirstParamType("meth", "Type", PsiType.BOOLEAN); } - public void testTypePrimsubBoolean2Rvalue() throws Exception { + public void testTypePrimsubBoolean2Rvalue() { doTestFieldType("myField", "Type", PsiType.BOOLEAN); } - public void testTypePrimsubByte2Rvalue() throws Exception { + public void testTypePrimsubByte2Rvalue() { doTestFieldType("myField", "Type", PsiType.BYTE); } - public void testTypePrimsubChar2Lvalue() throws Exception { + public void testTypePrimsubChar2Lvalue() { doTestFirstParamType("meth", "Type", PsiType.CHAR); } - public void testTypePrimsubChar2Rvalue() throws Exception { + public void testTypePrimsubChar2Rvalue() { doTestFieldType("myField", "Type", PsiType.CHAR); } - public void testTypePrimsubDouble2Lvalue() throws Exception { + public void testTypePrimsubDouble2Lvalue() { doTestFirstParamType("meth", "Type", PsiType.DOUBLE); } - public void testTypePrimsubFloat2Lvalue() throws Exception { + public void testTypePrimsubFloat2Lvalue() { doTestFirstParamType("meth", "Type", PsiType.FLOAT); } - public void testTypePrimsubFloat2Rvalue() throws Exception { + public void testTypePrimsubFloat2Rvalue() { doTestFieldType("myField", "Type", PsiType.FLOAT); } - public void testTypePrimsubInt2Lvalue() throws Exception { + public void testTypePrimsubInt2Lvalue() { doTestFirstParamType("meth", "Type", PsiType.INT); } - public void testTypePrimsubInt2Rvalue() throws Exception { + public void testTypePrimsubInt2Rvalue() { doTestFieldType("myField", "Type", PsiType.INT); } - public void testTypePrimsubLong2Lvalue() throws Exception { + public void testTypePrimsubLong2Lvalue() { doTestFirstParamType("meth", "Type", PsiType.LONG); } - public void testTypePrimsubLong2Rvalue() throws Exception { + public void testTypePrimsubLong2Rvalue() { doTestFieldType("myField", "Type", PsiType.LONG); } - public void testTypePrimsubShort2Lvalue() throws Exception { + public void testTypePrimsubShort2Lvalue() { doTestFirstParamType("meth", "Type", PsiType.SHORT); } - public void testTypePrimsubShort2Rvalue() throws Exception { + public void testTypePrimsubShort2Rvalue() { doTestFieldType("myField", "Type", PsiType.SHORT); } - public void testTypeRefClassChild2Rvalue() throws Exception { + public void testTypeRefClassChild2Rvalue() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText("ClassChild", null)); } - public void testTypeRefClassParent2Lvalue() throws Exception { + public void testTypeRefClassParent2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null)); } - public void testTypeRefClassParent2Rvalue() throws Exception { + public void testTypeRefClassParent2Rvalue() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText("ClassParent", null)); } - public void testTypeRefFaceChild2Lvalue() throws Exception { + public void testTypeRefFaceChild2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("FaceChild", null)); } - public void testTypeRefFaceChild2Rvalue() throws Exception { + public void testTypeRefFaceChild2Rvalue() { doTestFieldType("myField", "Type", myJavaFacade.getElementFactory().createTypeFromText("FaceChild", null)); } - public void testTypeRefFaceParent2Lvalue() throws Exception { + public void testTypeRefFaceParent2Lvalue() { doTestFirstParamType("meth", "Type", myJavaFacade.getElementFactory().createTypeFromText("FaceParent", null)); } @@ -518,7 +518,7 @@ public class MigrateTypeSignatureTest extends TypeMigrationTestBase { final PsiType toType) { final RulesProvider provider = new RulesProvider() { @Override - public PsiType migrationType(PsiElement context) throws Exception { + public PsiType migrationType(PsiElement context) { return toType; } diff --git a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByAtomicRuleTest.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByAtomicRuleTest.java index 9e781175898f..78bb35e1fe92 100644 --- a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByAtomicRuleTest.java +++ b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByAtomicRuleTest.java @@ -3,8 +3,8 @@ package com.intellij.refactoring; import com.intellij.psi.PsiType; import org.jetbrains.annotations.NotNull; -import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.concurrent.atomic.AtomicIntegerArray; +import java.util.concurrent.atomic.AtomicReferenceArray; public class TypeMigrationByAtomicRuleTest extends TypeMigrationTestBase{ @NotNull @@ -13,86 +13,86 @@ public class TypeMigrationByAtomicRuleTest extends TypeMigrationTestBase{ return "/refactoring/typeMigrationByAtomic/"; } - private void doTestDirectMigration() throws Exception { + private void doTestDirectMigration() { doTestFieldType("i", myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicInteger", null)); } - public void testDirectIncrementDecrement() throws Exception { + public void testDirectIncrementDecrement() { doTestDirectMigration(); } - public void testDirectAssignments() throws Exception { + public void testDirectAssignments() { doTestDirectMigration(); } - public void testDirectConditions() throws Exception { + public void testDirectConditions() { doTestFieldType("b", myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicBoolean", null)); } - public void testDirectConditionalExpression() throws Exception { + public void testDirectConditionalExpression() { doTestFieldType("s", myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicReference", null)); } - public void testDirectByte() throws Exception { + public void testDirectByte() { doTestFieldType("b", myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicReference", null)); } - public void testDirectString() throws Exception { + public void testDirectString() { doTestFieldType("s", myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicReference", null)); } - public void testDirectForeach() throws Exception { + public void testDirectForeach() { doTestFieldType("lst", myJavaFacade.getElementFactory().createTypeFromText("java.util.concurrent.atomic.AtomicReference>", null)); } - public void testDirectStringArray() throws Exception { + public void testDirectStringArray() { doTestFieldType("s", myJavaFacade.getElementFactory().createTypeFromText(AtomicReferenceArray.class.getName() + "", null)); } - public void testDirectIntArray() throws Exception { + public void testDirectIntArray() { doTestFieldType("a", myJavaFacade.getElementFactory().createTypeFromText(AtomicIntegerArray.class.getName(), null)); } - private void doTestReverseMigration() throws Exception { + private void doTestReverseMigration() { doTestFieldType("i", PsiType.INT); } - public void testReverseIncrementDecrement() throws Exception { + public void testReverseIncrementDecrement() { doTestReverseMigration(); } - public void testReverseAssignments() throws Exception { + public void testReverseAssignments() { doTestReverseMigration(); } - public void testReverseConditions() throws Exception { + public void testReverseConditions() { doTestFieldType("b", PsiType.BOOLEAN); } - public void testReverseByte() throws Exception { + public void testReverseByte() { doTestFieldType("b", PsiType.BYTE); } - public void testReverseString() throws Exception { + public void testReverseString() { doTestFieldType("s", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null)); } - public void testReverseStringArray() throws Exception { + public void testReverseStringArray() { doTestFieldType("s", myJavaFacade.getElementFactory().createTypeFromText("java.lang.String", null).createArrayType()); } - public void testReverseIntArray() throws Exception { + public void testReverseIntArray() { doTestFieldType("a", PsiType.INT.createArrayType()); } diff --git a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java index 7f14f67a7409..397984a8c0b8 100644 --- a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java +++ b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationByThreadLocalRuleTest.java @@ -12,19 +12,19 @@ public class TypeMigrationByThreadLocalRuleTest extends TypeMigrationTestBase{ } - public void testDirectInt() throws Exception { + public void testDirectInt() { doTestFieldType("i", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal", null)); } - public void testDirectByte() throws Exception { + public void testDirectByte() { doTestFieldType("i", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal", null)); } - public void testDirectString() throws Exception { + public void testDirectString() { doTestFieldType("myS", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal", null)); } - public void testLanguageLevel() throws Exception { + public void testLanguageLevel() { final LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(getProject()); final LanguageLevel languageLevel = extension.getLanguageLevel(); try { diff --git a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTest.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTest.java index a7c62f254d75..8cb7a08dd099 100644 --- a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTest.java +++ b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTest.java @@ -877,7 +877,7 @@ public class TypeMigrationTest extends TypeMigrationTestBase { private void doTestReturnType(final String methodName, final String migrationType) { start(new RulesProvider() { @Override - public PsiType migrationType(PsiElement context) throws Exception { + public PsiType migrationType(PsiElement context) { return myFactory.createTypeFromText(migrationType, context); } diff --git a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java index 9571f6fac611..4a252efc809f 100644 --- a/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java +++ b/java/typeMigration/test/com/intellij/refactoring/TypeMigrationTestBase.java @@ -59,7 +59,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase { final PsiType toType) { final RulesProvider provider = new RulesProvider() { @Override - public PsiType migrationType(PsiElement context) throws Exception { + public PsiType migrationType(PsiElement context) { return toType; } @@ -90,7 +90,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase { protected void doTestFieldsType(@NotNull String className, @NotNull final PsiType migrationType, final String... fieldNames) { final RulesProvider provider = new RulesProvider() { @Override - public PsiType migrationType(PsiElement context) throws Exception { + public PsiType migrationType(PsiElement context) { return migrationType; } @@ -116,7 +116,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase { final PsiType migrationType) { final RulesProvider provider = new RulesProvider() { @Override - public PsiType migrationType(PsiElement context) throws Exception { + public PsiType migrationType(PsiElement context) { return migrationType; } @@ -136,7 +136,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase { protected void doTestFirstParamType(@NonNls final String methodName, String className, final PsiType migrationType) { final RulesProvider provider = new RulesProvider() { @Override - public PsiType migrationType(PsiElement context) throws Exception { + public PsiType migrationType(PsiElement context) { return migrationType; } @@ -215,7 +215,7 @@ public abstract class TypeMigrationTestBase extends MultiFileTestCase { } interface RulesProvider { - PsiType migrationType(PsiElement context) throws Exception; + PsiType migrationType(PsiElement context); default PsiElement victim(PsiClass aClass) { fail("You need to override one of victim(PsiClass) or victims(PsiClass) methods"); diff --git a/java/typeMigration/test/com/intellij/refactoring/WildcardTypeMigrationTest.java b/java/typeMigration/test/com/intellij/refactoring/WildcardTypeMigrationTest.java index f3b0a588f524..3b6f73dfb9bf 100644 --- a/java/typeMigration/test/com/intellij/refactoring/WildcardTypeMigrationTest.java +++ b/java/typeMigration/test/com/intellij/refactoring/WildcardTypeMigrationTest.java @@ -10,134 +10,134 @@ public class WildcardTypeMigrationTest extends TypeMigrationTestBase{ return "/refactoring/wildcard/"; } - public void testProducerExtends() throws Exception { + public void testProducerExtends() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testProducerSuper() throws Exception { + public void testProducerSuper() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testProducerUnbounded() throws Exception { + public void testProducerUnbounded() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testProducerCollectionChanged() throws Exception { + public void testProducerCollectionChanged() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testProducerExtendsCollectionChanged() throws Exception { + public void testProducerExtendsCollectionChanged() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.Set", null)); } - public void testProducerStopAtWildcard() throws Exception { + public void testProducerStopAtWildcard() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.List", null)); } - public void testProducerFailToStopAtWildcard() throws Exception { + public void testProducerFailToStopAtWildcard() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.List", null)); } - public void testProducerExtendsFailToStopAtWildcard() throws Exception { + public void testProducerExtendsFailToStopAtWildcard() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.List", null)); } - public void testConsumerExtends() throws Exception { + public void testConsumerExtends() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testConsumerSuper() throws Exception { + public void testConsumerSuper() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testConsumerUnbounded() throws Exception { + public void testConsumerUnbounded() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } // array -> list - public void testAssignmentExtends() throws Exception { + public void testAssignmentExtends() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testAssignmentSuper() throws Exception { + public void testAssignmentSuper() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testAssignmentUnbounded() throws Exception { + public void testAssignmentUnbounded() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testGetExtends() throws Exception { + public void testGetExtends() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testGetSuper() throws Exception { + public void testGetSuper() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testGetUnbounded() throws Exception { + public void testGetUnbounded() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } - public void testLengthSize() throws Exception { + public void testLengthSize() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.util.ArrayList", null)); } //list -> array - public void testGetAssignmentExtendsToType() throws Exception { + public void testGetAssignmentExtendsToType() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Number", null).createArrayType()); } - public void testGetAssignmentExtendsToSuperType() throws Exception { + public void testGetAssignmentExtendsToSuperType() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText(CommonClassNames.JAVA_LANG_OBJECT, null).createArrayType()); } - public void testGetAssignmentExtendsToChildType() throws Exception { + public void testGetAssignmentExtendsToChildType() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.lang.Integer", null).createArrayType()); } // -> threadlocal with wildcard - public void testThreadLocalProducerExtends() throws Exception { + public void testThreadLocalProducerExtends() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal>", null)); } //List is not assignable to List though it is possible to pass string where ? super String was - public void _testThreadLocalProducerSuper() throws Exception { + public void _testThreadLocalProducerSuper() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal>", null)); } - public void testThreadLocalConsumerSuper() throws Exception { + public void testThreadLocalConsumerSuper() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal", null)); } - public void testThreadLocalConsumerExtends() throws Exception { + public void testThreadLocalConsumerExtends() { doTestFirstParamType("method", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal", null)); } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/AnnotationTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/AnnotationTest.java index d80044107f0f..6b7da9985e93 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/AnnotationTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/AnnotationTest.java @@ -20,63 +20,63 @@ package org.jetbrains.ether; * Date: 26.07.11 */ public class AnnotationTest extends IncrementalTestCase { - public AnnotationTest() throws Exception { + public AnnotationTest() { super("annotations"); } - public void testAddAnnotationTarget() throws Exception { + public void testAddAnnotationTarget() { doTest(); } - public void testAddAnnotationTypeMemberWithDefaultValue() throws Exception { + public void testAddAnnotationTypeMemberWithDefaultValue() { doTest(); } - public void testAddAnnotationTypeMemberWithDefaultValue2() throws Exception { + public void testAddAnnotationTypeMemberWithDefaultValue2() { doTest(); } - public void testAddAnnotationTypeMemberWithoutDefaultValue() throws Exception { + public void testAddAnnotationTypeMemberWithoutDefaultValue() { doTest(); } - public void testAddDefaultToAnnotationMember() throws Exception { + public void testAddDefaultToAnnotationMember() { doTest(); } - public void testChangeAnnotationRetentionPolicy() throws Exception { + public void testChangeAnnotationRetentionPolicy() { doTest(); } - public void testChangeAnnotationRetentionPolicy1() throws Exception { + public void testChangeAnnotationRetentionPolicy1() { doTest(); } - public void testChangeAnnotationRetentionPolicy2() throws Exception { + public void testChangeAnnotationRetentionPolicy2() { doTest(); } - public void testChangeAnnotationRetentionPolicy3() throws Exception { + public void testChangeAnnotationRetentionPolicy3() { doTest(); } - public void testChangeAnnotationRetentionPolicy4() throws Exception { + public void testChangeAnnotationRetentionPolicy4() { doTest(); } - public void testChangeAnnotationTypeMemberType() throws Exception { + public void testChangeAnnotationTypeMemberType() { doTest(); } - public void testChangeAnnotationTypeMemberTypeArray() throws Exception { + public void testChangeAnnotationTypeMemberTypeArray() { doTest(); } - public void testChangeAnnotationTypeMemberTypeEnumArray() throws Exception { + public void testChangeAnnotationTypeMemberTypeEnumArray() { doTest(); } - public void testClassAsArgument() throws Exception { + public void testClassAsArgument() { doTest(); } @@ -93,31 +93,31 @@ public class AnnotationTest extends IncrementalTestCase { doTest(); } */ - public void testRemoveAnnotationTarget() throws Exception { + public void testRemoveAnnotationTarget() { doTest(); } - public void testRemoveAnnotationTypeMember() throws Exception { + public void testRemoveAnnotationTypeMember() { doTest(); } - public void testRemoveAnnotationTypeMember1() throws Exception { + public void testRemoveAnnotationTypeMember1() { doTest(); } - public void testRemoveDefaultFromAnnotationMember() throws Exception { + public void testRemoveDefaultFromAnnotationMember() { doTest(); } - public void testConservativeNonIncremental() throws Exception { + public void testConservativeNonIncremental() { doTest(); } - public void testConservativeNonIncremental1() throws Exception { + public void testConservativeNonIncremental1() { doTest(); } - public void testAnnotationsTracker() throws Exception { + public void testAnnotationsTracker() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/ClassModifierTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/ClassModifierTest.java index a7d7f2a85354..b894e64ab4bb 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/ClassModifierTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/ClassModifierTest.java @@ -20,35 +20,35 @@ package org.jetbrains.ether; * Date: 09.08.11 */ public class ClassModifierTest extends IncrementalTestCase { - public ClassModifierTest() throws Exception { + public ClassModifierTest() { super("classModifiers"); } - public void testAddStatic() throws Exception { + public void testAddStatic() { doTest(); } - public void testRemoveStatic() throws Exception { + public void testRemoveStatic() { doTest(); } - public void testDecAccess() throws Exception { + public void testDecAccess() { doTest(); } - public void testSetAbstract() throws Exception { + public void testSetAbstract() { doTest(); } - public void testDropAbstract() throws Exception { + public void testDropAbstract() { doTest(); } - public void testSetFinal() throws Exception { + public void testSetFinal() { doTest(); } - public void testSetFinal1() throws Exception { + public void testSetFinal1() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/ClassPropertyTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/ClassPropertyTest.java index 5a66395e4cf6..c5c12d488736 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/ClassPropertyTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/ClassPropertyTest.java @@ -20,47 +20,47 @@ package org.jetbrains.ether; * Date: 09.08.11 */ public class ClassPropertyTest extends IncrementalTestCase { - public ClassPropertyTest() throws Exception { + public ClassPropertyTest() { super("classProperties"); } - public void testAddExtends() throws Exception { + public void testAddExtends() { doTest(); } - public void testAddImplements() throws Exception { + public void testAddImplements() { doTest(); } - public void testChangeExtends() throws Exception { + public void testChangeExtends() { doTest(); } - public void testRemoveExtends() throws Exception { + public void testRemoveExtends() { doTest(); } - public void testRemoveExtendsAffectsFieldAccess() throws Exception { + public void testRemoveExtendsAffectsFieldAccess() { doTest(); } - public void testRemoveExtendsAffectsMethodAccess() throws Exception { + public void testRemoveExtendsAffectsMethodAccess() { doTest(); } - public void testRemoveImplements() throws Exception { + public void testRemoveImplements() { doTest(); } - public void testRemoveImplements2() throws Exception { + public void testRemoveImplements2() { doTest(); } - public void testRemoveImplements3() throws Exception { + public void testRemoveImplements3() { doTest(); } - public void testChangeExtends2() throws Exception { + public void testChangeExtends2() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/ClassRenameTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/ClassRenameTest.java index 1dde265f8b63..987d342b7d3e 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/ClassRenameTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/ClassRenameTest.java @@ -20,7 +20,7 @@ package org.jetbrains.ether; * Date: 09.08.11 */ public class ClassRenameTest extends IncrementalTestCase { - public ClassRenameTest() throws Exception { + public ClassRenameTest() { super("changeName"); } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/CommonTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/CommonTest.java index 21561264f493..03e7f383558d 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/CommonTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/CommonTest.java @@ -25,122 +25,122 @@ import org.jetbrains.jps.model.module.JpsModule; * Date: 22.09.11 */ public class CommonTest extends IncrementalTestCase { - public CommonTest() throws Exception { + public CommonTest() { super("common"); } - public void testAnonymous() throws Exception { + public void testAnonymous() { doTest(); } - public void testChangeDefinitionToClass() throws Exception { + public void testChangeDefinitionToClass() { doTest(); } - public void testChangeDefinitionToClass2() throws Exception { + public void testChangeDefinitionToClass2() { doTest(); } - public void testDeleteClass() throws Exception { + public void testDeleteClass() { doTest(); } - public void testDeleteClass1() throws Exception { + public void testDeleteClass1() { doTest(); } - public void testDeleteClass2() throws Exception { + public void testDeleteClass2() { doTest(); } - public void testDeleteClassAfterCompileErrors() throws Exception { + public void testDeleteClassAfterCompileErrors() { setupInitialProject(); doTestBuild(2); } - public void testDontMarkDependentsAfterCompileErrors() throws Exception { + public void testDontMarkDependentsAfterCompileErrors() { setupInitialProject(); doTestBuild(2); } - public void testDeleteClassPackageDoesntMatchRoot() throws Exception { + public void testDeleteClassPackageDoesntMatchRoot() { doTest(); } - public void testInner() throws Exception { + public void testInner() { doTest(); } - public void testNoResourceDelete() throws Exception { + public void testNoResourceDelete() { doTest(); } - public void testNoSecondFileCompile() throws Exception { + public void testNoSecondFileCompile() { doTest(); } - public void testNoSecondFileCompile1() throws Exception { + public void testNoSecondFileCompile1() { doTest(); } - public void testDependencyUpdate() throws Exception { + public void testDependencyUpdate() { doTest(); } - public void testClass2Interface1() throws Exception { + public void testClass2Interface1() { doTest(); } - public void testClass2Interface2() throws Exception { + public void testClass2Interface2() { doTest(); } - public void testClass2Interface3() throws Exception { + public void testClass2Interface3() { doTest(); } - public void testDeleteClass3() throws Exception { + public void testDeleteClass3() { doTest(); } - public void testDeleteClass4() throws Exception { + public void testDeleteClass4() { doTest(); } - public void testDeleteInnerClass() throws Exception { + public void testDeleteInnerClass() { doTest(); } - public void testDeleteInnerClass1() throws Exception { + public void testDeleteInnerClass1() { doTest(); } - public void testAddClass() throws Exception { + public void testAddClass() { doTest(); } - public void testAddDuplicateClass() throws Exception { + public void testAddDuplicateClass() { doTest(); } - public void testAddClassHidingImportedClass() throws Exception { + public void testAddClassHidingImportedClass() { doTest(); } - public void testAddClassHidingImportedClass2() throws Exception { + public void testAddClassHidingImportedClass2() { doTest(); } - public void testMoveClassToDependentModule() throws Exception { + public void testMoveClassToDependentModule() { JpsModule moduleA = addModule("moduleA", "moduleA/src"); JpsModule moduleB = addModule("moduleB", "moduleB/src"); JpsModuleRootModificationUtil.addDependency(moduleB, moduleA); doTestBuild(1).assertSuccessful(); } - public void testMoveClassToDependentModuleWithSameOutput() throws Exception { + public void testMoveClassToDependentModuleWithSameOutput() { final JpsSdk sdk = getOrCreateJdk(); final String commonOutput = getAbsolutePath("out"); JpsModule moduleA = addModule("moduleA", new String[]{getAbsolutePath("moduleA/src")}, commonOutput, commonOutput, sdk); @@ -149,32 +149,32 @@ public class CommonTest extends IncrementalTestCase { doTestBuild(1).assertSuccessful(); } - public void testMoveClassFromJavaFileToDependentModule() throws Exception { + public void testMoveClassFromJavaFileToDependentModule() { JpsModule moduleA = addModule("moduleA", "moduleA/src"); JpsModule moduleB = addModule("moduleB", "moduleB/src"); JpsModuleRootModificationUtil.addDependency(moduleB, moduleA); doTestBuild(1).assertSuccessful(); } - public void testCompileDependenciesOnMovedClassesInFirstRound() throws Exception { + public void testCompileDependenciesOnMovedClassesInFirstRound() { doTest().assertSuccessful(); } - public void testIntegrateOnSuperclassRemovedAndRestored() throws Exception { + public void testIntegrateOnSuperclassRemovedAndRestored() { setupInitialProject(); doTestBuild(2); } - public void testMoveToplevelClassToAnotherFile() throws Exception { + public void testMoveToplevelClassToAnotherFile() { doTest(); } - public void testMoveClassToAnotherRoot() throws Exception { + public void testMoveClassToAnotherRoot() { doTest(); } - public void testIntegrateOnNonIncrementalMake() throws Exception { + public void testIntegrateOnNonIncrementalMake() { doTest(); } } \ No newline at end of file diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/FieldModifierTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/FieldModifierTest.java index ba288a648f55..811aa358464c 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/FieldModifierTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/FieldModifierTest.java @@ -20,35 +20,35 @@ package org.jetbrains.ether; * Date: 23.09.11 */ public class FieldModifierTest extends IncrementalTestCase { - public FieldModifierTest() throws Exception { + public FieldModifierTest() { super("fieldModifiers"); } - public void testSetFinal() throws Exception { + public void testSetFinal() { doTest(); } - public void testSetPrivate() throws Exception { + public void testSetPrivate() { doTest(); } - public void testSetPrivateToConstantField() throws Exception { + public void testSetPrivateToConstantField() { doTest(); } - public void testSetProtected() throws Exception { + public void testSetProtected() { doTest(); } - public void testSetStatic() throws Exception { + public void testSetStatic() { doTest(); } - public void testUnsetStatic() throws Exception { + public void testUnsetStatic() { doTest(); } - public void testUnsetStaticFinal() throws Exception { + public void testUnsetStaticFinal() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/FieldPropertyTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/FieldPropertyTest.java index 1f8a4c38861a..ee5123c93384 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/FieldPropertyTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/FieldPropertyTest.java @@ -23,23 +23,23 @@ import org.jetbrains.jps.model.module.JpsModule; * Date: 23.09.11 */ public class FieldPropertyTest extends IncrementalTestCase { - public FieldPropertyTest() throws Exception { + public FieldPropertyTest() { super("fieldProperties"); } - public void testConstantChain() throws Exception { + public void testConstantChain() { doTest(); } - public void testConstantChain1() throws Exception { + public void testConstantChain1() { doTest(); } - public void testConstantChain2() throws Exception { + public void testConstantChain2() { doTest(); } - public void testConstantChainMultiModule() throws Exception { + public void testConstantChainMultiModule() { JpsModule moduleA = addModule("moduleA", "moduleA/src"); JpsModule moduleB = addModule("moduleB", "moduleB/src"); JpsModule moduleC = addModule("moduleC", "moduleC/src"); @@ -48,78 +48,78 @@ public class FieldPropertyTest extends IncrementalTestCase { doTestBuild(1).assertSuccessful(); } - public void testConstantRemove() throws Exception { + public void testConstantRemove() { doTest(); } - public void testConstantRemove1() throws Exception { + public void testConstantRemove1() { doTest(); } - public void testDoubleConstantChange() throws Exception { + public void testDoubleConstantChange() { doTest(); } - public void testFloatConstantChange() throws Exception { + public void testFloatConstantChange() { doTest(); } - public void testInnerConstantChange() throws Exception { + public void testInnerConstantChange() { doTest(); } - public void testIntConstantChange() throws Exception { + public void testIntConstantChange() { doTest(); } - public void testIntNonStaticConstantChange() throws Exception { + public void testIntNonStaticConstantChange() { doTest(); } - public void testLongConstantChange() throws Exception { + public void testLongConstantChange() { doTest(); } - public void testNonCompileTimeConstant() throws Exception { + public void testNonCompileTimeConstant() { doTest(); } - public void testStringConstantChange() throws Exception { + public void testStringConstantChange() { doTest(); } - public void testStringConstantLessAccessible() throws Exception { + public void testStringConstantLessAccessible() { doTest(); } - public void testTypeChange() throws Exception { + public void testTypeChange() { doTest(); } - public void testTypeChange1() throws Exception { + public void testTypeChange1() { doTest(); } - public void testTypeChange2() throws Exception { + public void testTypeChange2() { doTest(); } - public void testNonIncremental1() throws Exception { + public void testNonIncremental1() { doTest(); } - public void testNonIncremental2() throws Exception { + public void testNonIncremental2() { doTest(); } //public void testNonIncremental3() throws Exception { // doTest(); // } - public void testNonIncremental4() throws Exception { + public void testNonIncremental4() { doTest(); } - public void testMutualConstants() throws Exception { + public void testMutualConstants() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/GenericTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/GenericTest.java index e20d6c0bdce3..92be753cd2c2 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/GenericTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/GenericTest.java @@ -20,63 +20,63 @@ package org.jetbrains.ether; * Date: 26.09.11 */ public class GenericTest extends IncrementalTestCase { - public GenericTest() throws Exception { + public GenericTest() { super("generics"); } - public void testAddMethodToBase() throws Exception { + public void testAddMethodToBase() { doTest(); } - public void testAddParameterizedMethodToBase() throws Exception { + public void testAddParameterizedMethodToBase() { doTest(); } - public void testChangeBound() throws Exception { + public void testChangeBound() { doTest(); } - public void testChangeBound1() throws Exception { + public void testChangeBound1() { doTest(); } - public void testChangeBoundClass1() throws Exception { + public void testChangeBoundClass1() { doTest(); } - public void testChangeBoundedClass() throws Exception { + public void testChangeBoundedClass() { doTest(); } - public void testChangeBoundInterface1() throws Exception { + public void testChangeBoundInterface1() { doTest(); } - public void testChangeExtends() throws Exception { + public void testChangeExtends() { doTest(); } - public void testChangeExtends1() throws Exception { + public void testChangeExtends1() { doTest(); } - public void testChangeExtends2() throws Exception { + public void testChangeExtends2() { doTest(); } - public void testChangeImplements() throws Exception { + public void testChangeImplements() { doTest(); } - public void testChangeInterfaceTypeParameter() throws Exception { + public void testChangeInterfaceTypeParameter() { doTest(); } - public void testChangeToCovariantMethodInBase() throws Exception { + public void testChangeToCovariantMethodInBase() { doTest(); } - public void testChangeToCovariantMethodInBase2() throws Exception { + public void testChangeToCovariantMethodInBase2() { doTest(); } @@ -85,72 +85,72 @@ public class GenericTest extends IncrementalTestCase { doTest(); } */ - public void testChangeVarargSignature() throws Exception { + public void testChangeVarargSignature() { doTest(); } - public void testChangeVarargSignature1() throws Exception { + public void testChangeVarargSignature1() { doTest(); } - public void testCovariance() throws Exception { + public void testCovariance() { doTest(); } - public void testCovariance1() throws Exception { + public void testCovariance1() { doTest(); } - public void testCovariance2() throws Exception { + public void testCovariance2() { doTest(); } - public void testCovarianceNoChanges() throws Exception { + public void testCovarianceNoChanges() { doTest(); } - public void testDegenerify() throws Exception { + public void testDegenerify() { doTest(); } - public void testDegenerify1() throws Exception { + public void testDegenerify1() { doTest(); } - public void testFieldTypeChange() throws Exception { + public void testFieldTypeChange() { doTest(); } - public void testOverrideAnnotatedAnonymous() throws Exception { + public void testOverrideAnnotatedAnonymous() { doTest(); } /* Not working yet */ - public void testOverrideAnnotatedAnonymousNotRecompile() throws Exception { + public void testOverrideAnnotatedAnonymousNotRecompile() { doTest(); } - public void testOverrideAnnotatedInner() throws Exception { + public void testOverrideAnnotatedInner() { doTest(); } - public void testParamTypes() throws Exception { + public void testParamTypes() { doTest(); } - public void testReturnType() throws Exception { + public void testReturnType() { doTest(); } - public void testArgumentContainment() throws Exception { + public void testArgumentContainment() { doTest(); } - public void testArgumentContainment2() throws Exception { + public void testArgumentContainment2() { doTest(); } - public void testArgumentContainment3() throws Exception { + public void testArgumentContainment3() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/ImportTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/ImportTest.java index 9777919fa38f..dec62512ed4a 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/ImportTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/ImportTest.java @@ -23,7 +23,7 @@ package org.jetbrains.ether; * To change this template use File | Settings | File Templates. */ public class ImportTest { //extends IncrementalTestCase { - public ImportTest() throws Exception { + public ImportTest() { //super("imports"); } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/IncrementalTestCase.java b/jps/jps-builders/testSrc/org/jetbrains/ether/IncrementalTestCase.java index 3ead48c84226..cf14e7bbca15 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/IncrementalTestCase.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/IncrementalTestCase.java @@ -72,7 +72,7 @@ public abstract class IncrementalTestCase extends JpsBuildTestCase { } @Override - protected File doGetProjectDir() throws IOException { + protected File doGetProjectDir() { return workDir; } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/MarkDirtyTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/MarkDirtyTest.java index a880e2e8baff..267dd169fb48 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/MarkDirtyTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/MarkDirtyTest.java @@ -25,7 +25,7 @@ import org.jetbrains.jps.model.module.JpsModule; * Date: 04.10.11 */ public class MarkDirtyTest extends IncrementalTestCase { - public MarkDirtyTest() throws Exception { + public MarkDirtyTest() { super("markDirty"); } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/MethodModifierTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/MethodModifierTest.java index 77136f8a8c31..1fce43338868 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/MethodModifierTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/MethodModifierTest.java @@ -20,44 +20,44 @@ package org.jetbrains.ether; * Date: 04.10.11 */ public class MethodModifierTest extends IncrementalTestCase { - public MethodModifierTest() throws Exception { + public MethodModifierTest() { super("methodModifiers"); } - public void testDecConstructorAccess() throws Exception { + public void testDecConstructorAccess() { doTest(); } - public void testIncAccess() throws Exception { + public void testIncAccess() { doTest(); } - public void testSetAbstract() throws Exception { + public void testSetAbstract() { doTest(); } - public void testSetFinal() throws Exception { + public void testSetFinal() { doTest(); } - public void testSetPrivate() throws Exception { + public void testSetPrivate() { doTest(); } - public void testSetProtected() throws Exception { + public void testSetProtected() { doTest(); } - public void testUnsetFinal() throws Exception { + public void testUnsetFinal() { doTest(); } - public void testUnsetStatic() throws Exception { + public void testUnsetStatic() { doTest(); } - public void testSetStatic() throws Exception { + public void testSetStatic() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/MethodPropertyTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/MethodPropertyTest.java index c890dc497b33..c52a1f679119 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/MethodPropertyTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/MethodPropertyTest.java @@ -22,19 +22,19 @@ import com.intellij.openapi.util.SystemInfo; * Date: 05.10.11 */ public class MethodPropertyTest extends IncrementalTestCase { - public MethodPropertyTest() throws Exception { + public MethodPropertyTest() { super("methodProperties"); } - public void testAddThrows() throws Exception { + public void testAddThrows() { doTest(); } - public void testChangeReturnType() throws Exception { + public void testChangeReturnType() { doTest(); } - public void testChangeMethodRefReturnType() throws Exception { + public void testChangeMethodRefReturnType() { if (SystemInfo.isJavaVersionAtLeast("1.8")) { doTest(); } @@ -43,7 +43,7 @@ public class MethodPropertyTest extends IncrementalTestCase { } } - public void testChangeLambdaTargetReturnType() throws Exception { + public void testChangeLambdaTargetReturnType() { if (SystemInfo.isJavaVersionAtLeast("1.8")) { doTest(); } @@ -52,7 +52,7 @@ public class MethodPropertyTest extends IncrementalTestCase { } } - public void testChangeSAMMethodSignature() throws Exception { + public void testChangeSAMMethodSignature() { if (SystemInfo.isJavaVersionAtLeast("1.8")) { doTest(); } @@ -61,7 +61,7 @@ public class MethodPropertyTest extends IncrementalTestCase { } } - public void testChangeLambdaSAMMethodSignature() throws Exception { + public void testChangeLambdaSAMMethodSignature() { if (SystemInfo.isJavaVersionAtLeast("1.8")) { doTest(); } @@ -70,15 +70,15 @@ public class MethodPropertyTest extends IncrementalTestCase { } } - public void testChangeReturnType1() throws Exception { + public void testChangeReturnType1() { doTest(); } - public void testChangeSignature() throws Exception { + public void testChangeSignature() { doTest(); } - public void testChangeSignature1() throws Exception { + public void testChangeSignature1() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/ether/PackageInfoTest.java b/jps/jps-builders/testSrc/org/jetbrains/ether/PackageInfoTest.java index 8c72207cfc12..3d1c42050def 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/ether/PackageInfoTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/ether/PackageInfoTest.java @@ -20,19 +20,19 @@ package org.jetbrains.ether; * Date: 04.10.11 */ public class PackageInfoTest extends IncrementalTestCase { - public PackageInfoTest() throws Exception { + public PackageInfoTest() { super("packageInfo"); } - public void testPackageInfoNoRecompile() throws Exception { + public void testPackageInfoNoRecompile() { doTest(); } - public void testPackageInfoNoRecompile2() throws Exception { + public void testPackageInfoNoRecompile2() { doTest(); } - public void testPackageInfoRecompileOnConstantChange() throws Exception { + public void testPackageInfoRecompileOnConstantChange() { doTest(); } } diff --git a/jps/jps-builders/testSrc/org/jetbrains/jps/incremental/artifacts/ArtifactBuilderTest.java b/jps/jps-builders/testSrc/org/jetbrains/jps/incremental/artifacts/ArtifactBuilderTest.java index 1bac80112e27..71444e853556 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/jps/incremental/artifacts/ArtifactBuilderTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/jps/incremental/artifacts/ArtifactBuilderTest.java @@ -359,7 +359,7 @@ public class ArtifactBuilderTest extends ArtifactBuilderTestCase { assertOutput(artifact, fs().file("A.class")); } - public void testClearOutputOnRebuild() throws IOException { + public void testClearOutputOnRebuild() { String file = createFile("d/a.txt"); JpsArtifact a = addArtifact(root().parentDirCopy(file)); buildAll(); @@ -371,7 +371,7 @@ public class ArtifactBuilderTest extends ArtifactBuilderTestCase { assertOutput(a, fs().file("a.txt").file("b.txt")); } - public void testDeleteOnlyOutputFileOnRebuildForArchiveArtifact() throws IOException { + public void testDeleteOnlyOutputFileOnRebuildForArchiveArtifact() { String file = createFile("a.txt"); JpsArtifact a = addArtifact(archive("a.jar").fileCopy(file)); buildAll(); diff --git a/jps/jps-builders/testSrc/org/jetbrains/jps/incremental/artifacts/IncrementalArtifactBuildingTest.java b/jps/jps-builders/testSrc/org/jetbrains/jps/incremental/artifacts/IncrementalArtifactBuildingTest.java index cefb3344d9d1..53b5c4bbecfb 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/jps/incremental/artifacts/IncrementalArtifactBuildingTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/jps/incremental/artifacts/IncrementalArtifactBuildingTest.java @@ -120,7 +120,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase { buildAllAndAssertUpToDate(); } - public void testNonExistentFileRoot() throws IOException { + public void testNonExistentFileRoot() { String file = getAbsolutePath("a.txt"); JpsArtifact a = addArtifact(root().fileCopy(file)); buildArtifacts(a); @@ -138,7 +138,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase { buildAllAndAssertUpToDate(); } - public void testNonExistentDirectoryRoot() throws IOException { + public void testNonExistentDirectoryRoot() { String dir = getAbsolutePath("d"); JpsArtifact a = addArtifact(root().dirCopy(dir)); buildArtifacts(a); @@ -267,7 +267,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase { assertDeletedAndCopied("out/artifacts/a/x.jar", "a/a.txt"); } - public void testRenameFile() throws Exception { + public void testRenameFile() { final String file = createFile("a/a.txt"); final JpsArtifact a = addArtifact(root().parentDirCopy(file)); buildAll(); @@ -279,7 +279,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase { } //IDEADEV-25840 - public void testUpdateFileIfCaseOfLetterInNameChanged() throws Exception { + public void testUpdateFileIfCaseOfLetterInNameChanged() { final String file = createFile("a/a.txt"); final JpsArtifact a = addArtifact("a", root().parentDirCopy(file)); buildAll(); @@ -291,7 +291,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase { } //IDEADEV-41556 - public void testDeleteFilesFromSelectedArtifactsOnly() throws Exception { + public void testDeleteFilesFromSelectedArtifactsOnly() { final String file = createFile("a/a.txt"); final JpsArtifact a1 = addArtifact("a1", root().parentDirCopy(file)); final JpsArtifact a2 = addArtifact("a2", root().parentDirCopy(file)); @@ -311,7 +311,7 @@ public class IncrementalArtifactBuildingTest extends ArtifactBuilderTestCase { } //IDEA-51910 - public void testTwoArtifactsWithSameOutput() throws Exception { + public void testTwoArtifactsWithSameOutput() { final String res1 = PathUtil.getParentPath(createFile("res1/a.txt", "1")); final String res2 = PathUtil.getParentPath(createFile("res2/a.txt", "2")); final JpsArtifact a1 = addArtifact("a1", root().dirCopy(res1)); diff --git a/jps/jps-builders/testSrc/org/jetbrains/jps/indices/ModuleExcludeIndexTest.java b/jps/jps-builders/testSrc/org/jetbrains/jps/indices/ModuleExcludeIndexTest.java index be4919647e16..35c95cd2639e 100644 --- a/jps/jps-builders/testSrc/org/jetbrains/jps/indices/ModuleExcludeIndexTest.java +++ b/jps/jps-builders/testSrc/org/jetbrains/jps/indices/ModuleExcludeIndexTest.java @@ -25,7 +25,6 @@ import org.jetbrains.jps.model.module.JpsModule; import org.jetbrains.jps.util.JpsPathUtil; import java.io.File; -import java.io.IOException; import java.util.Collection; /** @@ -40,7 +39,7 @@ public class ModuleExcludeIndexTest extends JpsJavaModelTestCase { myRoot = FileUtil.createTempDirectory("excludes", null); } - public void testProjectOutput() throws IOException { + public void testProjectOutput() { File out = new File(myRoot, "out"); getJavaService().getOrCreateProjectExtension(myProject).setOutputUrl(JpsPathUtil.pathToUrl(out.getAbsolutePath())); JpsModule module1 = addModule(); diff --git a/jps/model-impl/testSrc/org/jetbrains/jps/model/JpsDependenciesEnumeratorTest.java b/jps/model-impl/testSrc/org/jetbrains/jps/model/JpsDependenciesEnumeratorTest.java index 571a0e96b25c..e9036fb38a13 100644 --- a/jps/model-impl/testSrc/org/jetbrains/jps/model/JpsDependenciesEnumeratorTest.java +++ b/jps/model-impl/testSrc/org/jetbrains/jps/model/JpsDependenciesEnumeratorTest.java @@ -58,7 +58,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { return jdk; } - public void testLibrary() throws Exception { + public void testLibrary() { JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary()); assertClassRoots(dependencies(myModule), getRtJarJdk17(), getJDomJar()); @@ -109,7 +109,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { return library; } - public void testModuleSources() throws Exception { + public void testModuleSources() { final String srcRoot = addSourceRoot(myModule, false); final String testRoot = addSourceRoot(myModule, true); final String output = setModuleOutput(myModule, false); @@ -124,7 +124,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { assertEnumeratorRoots(dependencies(myModule).withoutSdk().productionOnly().classes().withoutSelfModuleOutput()); } - public void testLibraryScope() throws Exception { + public void testLibraryScope() { JpsLibraryDependency dependency = myModule.getDependenciesList().addLibraryDependency(createJDomLibrary()); getJavaService().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.RUNTIME); JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary(), JpsJavaDependencyScope.RUNTIME, false); @@ -134,7 +134,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { assertClassRoots(dependencies(myModule).withoutSdk().compileOnly()); } - public void testModuleDependency() throws Exception { + public void testModuleDependency() { final JpsModule dep = addModule("dep"); final String depSrcRoot = addSourceRoot(dep, false); final String depTestRoot = addSourceRoot(dep, true); @@ -171,7 +171,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { assertEnumeratorRoots(dependencies(myModule).productionOnly().withoutModuleSourceEntries().withoutSdk().withoutDepModules().classes()); } - public void testModuleJpsJavaDependencyScope() throws Exception { + public void testModuleJpsJavaDependencyScope() { final JpsModule dep = addModule("dep"); JpsModuleRootModificationUtil.addDependency(dep, createJDomLibrary(), JpsJavaDependencyScope.COMPILE, true); JpsModuleRootModificationUtil.addDependency(myModule, dep, JpsJavaDependencyScope.TEST, true); @@ -185,7 +185,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { assertClassRoots(dependencies(myProject).withoutSdk().productionOnly(), getJDomJar()); } - public void testNotExportedLibrary() throws Exception { + public void testNotExportedLibrary() { final JpsModule dep = addModule("dep"); JpsModuleRootModificationUtil.addDependency(dep, createJDomLibrary(), JpsJavaDependencyScope.COMPILE, false); JpsModuleRootModificationUtil.addDependency(myModule, createAsmLibrary(), JpsJavaDependencyScope.COMPILE, false); @@ -209,7 +209,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { assertEnumeratorRoots(dependencies(myModule).annotations(), moduleUrl, libraryUrl); } - public void testJdkIsNotExported() throws Exception { + public void testJdkIsNotExported() { assertClassRoots(dependencies(myModule).exportedOnly()); } @@ -222,7 +222,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { assertClassRoots(dependencies(dep).recursively(), getRtJarJdk18()); } - public void testProject() throws Exception { + public void testProject() { JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary()); final String srcRoot = addSourceRoot(myModule, false); @@ -234,7 +234,7 @@ public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase { assertSourceRoots(dependencies(myProject).withoutSdk(), srcRoot, testRoot, getJDomSources()); } - public void testModules() throws Exception { + public void testModules() { JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary()); final String srcRoot = addSourceRoot(myModule, false); diff --git a/json/tests/test/com/intellij/json/JsonCompletionTest.java b/json/tests/test/com/intellij/json/JsonCompletionTest.java index e80d81ee7082..661fe34f5435 100644 --- a/json/tests/test/com/intellij/json/JsonCompletionTest.java +++ b/json/tests/test/com/intellij/json/JsonCompletionTest.java @@ -21,31 +21,31 @@ public class JsonCompletionTest extends JsonTestCase { myFixture.checkResultByFile("completion/" + getTestName(false) + "_after.json" ); } - public void testInsideArrayElement1() throws Exception { + public void testInsideArrayElement1() { doTest(ALL_KEYWORDS); } - public void testInsideArrayElement2() throws Exception { + public void testInsideArrayElement2() { doTest(ALL_KEYWORDS); } - public void testInsidePropertyKey1() throws Exception { + public void testInsidePropertyKey1() { doTest(NOTHING); } - public void testInsidePropertyKey2() throws Exception { + public void testInsidePropertyKey2() { doTest(NOTHING); } - public void testInsideStringLiteral1() throws Exception { + public void testInsideStringLiteral1() { doTest(NOTHING); } - public void testInsideStringLiteral2() throws Exception { + public void testInsideStringLiteral2() { doTest(NOTHING); } - public void testInsidePropertyValue() throws Exception { + public void testInsidePropertyValue() { doTest(ALL_KEYWORDS); } diff --git a/json/tests/test/com/intellij/json/JsonHighlightingTest.java b/json/tests/test/com/intellij/json/JsonHighlightingTest.java index 23c58f041cdd..7c5746a63f56 100644 --- a/json/tests/test/com/intellij/json/JsonHighlightingTest.java +++ b/json/tests/test/com/intellij/json/JsonHighlightingTest.java @@ -55,17 +55,17 @@ public class JsonHighlightingTest extends JsonTestCase { // Moved from JavaScript - public void testJSON_with_comment() throws Exception { + public void testJSON_with_comment() { enableStandardComplianceInspection(false, true); doTestHighlighting(false, true, true); } - public void testJSON() throws Exception { + public void testJSON() { enableStandardComplianceInspection(true, true); doTestHighlighting(false, true, true); } - public void testSemanticHighlighting() throws Exception { + public void testSemanticHighlighting() { // WEB-11239 doTest(); } diff --git a/json/tests/test/com/intellij/json/JsonLexerTest.java b/json/tests/test/com/intellij/json/JsonLexerTest.java index 959abb575e4b..b531af435fe6 100644 --- a/json/tests/test/com/intellij/json/JsonLexerTest.java +++ b/json/tests/test/com/intellij/json/JsonLexerTest.java @@ -17,7 +17,7 @@ public class JsonLexerTest extends LexerTestCase { return null; } - public void testEscapeSlash() throws Exception { + public void testEscapeSlash() { // WEB-2803 doTest("[\"\\/\",-1,\"\\n\", 1]", "[ ('[')\n" + diff --git a/json/tests/test/com/intellij/json/JsonParsingTest.java b/json/tests/test/com/intellij/json/JsonParsingTest.java index 918000f2d3bf..14f44e2d6a0d 100644 --- a/json/tests/test/com/intellij/json/JsonParsingTest.java +++ b/json/tests/test/com/intellij/json/JsonParsingTest.java @@ -22,7 +22,7 @@ public class JsonParsingTest extends ParsingTestCase { doTest(true); } - public void testKeywords() throws Exception { + public void testKeywords() { doTest(); } diff --git a/json/tests/test/com/intellij/json/JsonPsiUtilTest.java b/json/tests/test/com/intellij/json/JsonPsiUtilTest.java index b28d77bede30..0d68f4e37c24 100644 --- a/json/tests/test/com/intellij/json/JsonPsiUtilTest.java +++ b/json/tests/test/com/intellij/json/JsonPsiUtilTest.java @@ -59,7 +59,7 @@ public class JsonPsiUtilTest extends JsonTestCase { myFixture.checkResult(after); } - public void testGetOtherSiblingPropertyNames() throws Exception { + public void testGetOtherSiblingPropertyNames() { myFixture.configureByText(JsonFileType.INSTANCE, "{\"first\" : 1, \"second\" : 2}"); PsiElement atCaret = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); JsonProperty property = PsiTreeUtil.getParentOfType(atCaret, JsonProperty.class); diff --git a/json/tests/test/com/intellij/json/JsonSmartEnterTest.java b/json/tests/test/com/intellij/json/JsonSmartEnterTest.java index fd6d35b6b78b..5546008848eb 100644 --- a/json/tests/test/com/intellij/json/JsonSmartEnterTest.java +++ b/json/tests/test/com/intellij/json/JsonSmartEnterTest.java @@ -18,7 +18,7 @@ public class JsonSmartEnterTest extends JsonTestCase { final List processors = SmartEnterProcessors.INSTANCE.forKey(JsonLanguage.INSTANCE); new WriteCommandAction(myFixture.getProject()) { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { final Editor editor = myFixture.getEditor(); for (SmartEnterProcessor processor : processors) { processor.process(myFixture.getProject(), editor, myFixture.getFile()); diff --git a/json/tests/test/com/jetbrains/jsonSchema/JsonBySchemaDocumentationBaseTest.java b/json/tests/test/com/jetbrains/jsonSchema/JsonBySchemaDocumentationBaseTest.java index 1cd2dea2fa74..26ddf05cec51 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/JsonBySchemaDocumentationBaseTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/JsonBySchemaDocumentationBaseTest.java @@ -48,7 +48,7 @@ public abstract class JsonBySchemaDocumentationBaseTest extends JsonSchemaHeavyA } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/" + getTestName(true) + "." + extension, "/" + getTestName(true) + "Schema.json"); } diff --git a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaCrossReferencesTest.java b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaCrossReferencesTest.java index 993e48f09a7b..570b02e3a643 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaCrossReferencesTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaCrossReferencesTest.java @@ -61,7 +61,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/completion.json", "/baseSchema.json", "/inheritedSchema.json"); } @@ -112,7 +112,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/baseCompletion.json", "/basePropertiesSchema.json"); } @@ -147,7 +147,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/completion.json", "/baseSchema.json", "/inheritedSchema.json"); } @@ -208,7 +208,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/referencingSchema.json", "/localRefSchema.json"); } @@ -250,7 +250,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/referencingGlobalSchema.json"); } @@ -281,7 +281,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/testFileForBaseProperties.json", "/basePropertiesSchema.json"); } @@ -320,7 +320,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/refToDefinitionInFileSchema.json", "/definitionsSchema.json"); } @@ -351,7 +351,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/refToOtherFileSchema.json", "/definitionsSchema.json"); } @@ -378,7 +378,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/package.json", "/packageJsonSchema.json"); } @@ -408,7 +408,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/testNestedDefinitionsNavigation.json", "/nestedDefinitionsSchema.json"); } @@ -438,7 +438,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/testNestedAllOfOneOfDefinitions.json", "/nestedAllOfOneOfDefinitionsSchema.json"); } @@ -468,7 +468,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, prefix + "testNavigation.json", prefix + "baseSchema.json", prefix + "referentSchema.json"); } @@ -498,7 +498,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, prefix + "testCompletion.json", prefix + "baseSchema.json", prefix + "referentSchema.json"); } @@ -522,7 +522,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, prefix + "testHighlighting.json", prefix + "baseSchema.json", prefix + "referentSchema.json"); } @@ -544,7 +544,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "withReferenceToDefinitionSchema.json"); } @@ -578,7 +578,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "completionInsideSchemaDefinition.json"); } @@ -603,7 +603,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "navigateFromSchemaDefinitionToMainSchema.json"); } @@ -622,7 +622,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { }); } - public void testNavigateToRefInsideMainSchema() throws Exception { + public void testNavigateToRefInsideMainSchema() { final JsonSchemaService service = JsonSchemaService.Impl.get(myProject); final List providers = new JsonSchemaProjectSelfProviderFactory().getProviders(myProject); Assert.assertEquals(1, providers.size()); @@ -667,7 +667,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "withIncorrectReferenceSchema.json"); } @@ -710,7 +710,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "insideCycledSchemaNavigationSchema.json"); } @@ -732,7 +732,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "testNavigationIntoCycled.json", "cycledSchema.json"); } @@ -754,7 +754,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "navigationWithCompositeDefinitionsObjectSchema.json"); } @@ -780,7 +780,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "navigationIntoWithCompositeDefinitionsObjectSchema.json", "navigationWithCompositeDefinitionsObjectSchema.json"); } @@ -803,7 +803,7 @@ public class JsonSchemaCrossReferencesTest extends JsonSchemaHeavyAbstractTest { } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "completionWithRootRef.json", "cycledWithRootRefSchema.json"); complete(); } diff --git a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaPatternComparatorTest.java b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaPatternComparatorTest.java index 48537b38e9c7..66a07e83638f 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaPatternComparatorTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaPatternComparatorTest.java @@ -24,7 +24,7 @@ import org.junit.Assert; * @author Irina.Chernushina on 2/17/2016. */ public class JsonSchemaPatternComparatorTest extends LightPlatformCodeInsightFixtureTestCase { - public void testPatterns() throws Exception { + public void testPatterns() { final JsonSchemaPatternComparator comparator = new JsonSchemaPatternComparator(getProject()); Assert.assertEquals(ThreeState.YES, comparator.isSimilar(p("test"), p("test"))); Assert.assertEquals(ThreeState.YES, comparator.isSimilar(p("test"), p("tes*"))); @@ -37,7 +37,7 @@ public class JsonSchemaPatternComparatorTest extends LightPlatformCodeInsightFix Assert.assertEquals(ThreeState.UNSURE, comparator.isSimilar(p("two*words"), p("circus"))); } - public void test2Files() throws Exception { + public void test2Files() { final JsonSchemaPatternComparator comparator = new JsonSchemaPatternComparator(getProject()); Assert.assertEquals(ThreeState.YES, comparator.isSimilar(f("test"), f("test"))); Assert.assertEquals(ThreeState.YES, comparator.isSimilar(f("./test"), f("test"))); @@ -46,7 +46,7 @@ public class JsonSchemaPatternComparatorTest extends LightPlatformCodeInsightFix Assert.assertEquals(ThreeState.YES, comparator.isSimilar(f("one/../one/two"), f("one/two"))); } - public void test2Dirs() throws Exception { + public void test2Dirs() { final JsonSchemaPatternComparator comparator = new JsonSchemaPatternComparator(getProject()); Assert.assertEquals(ThreeState.YES, comparator.isSimilar(d("test"), d("test"))); Assert.assertEquals(ThreeState.YES, comparator.isSimilar(d("./test"), d("test"))); @@ -57,7 +57,7 @@ public class JsonSchemaPatternComparatorTest extends LightPlatformCodeInsightFix Assert.assertEquals(ThreeState.YES, comparator.isSimilar(d("test/child"), d("test"))); } - public void testDirAndFile() throws Exception { + public void testDirAndFile() { final JsonSchemaPatternComparator comparator = new JsonSchemaPatternComparator(getProject()); Assert.assertEquals(ThreeState.NO, comparator.isSimilar(d("test"), f("test"))); Assert.assertEquals(ThreeState.YES, comparator.isSimilar(d("test"), f("test/lower"))); diff --git a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaSelfHighligthingTest.java b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaSelfHighligthingTest.java index b7f9c0fb4afb..5e49551b6cd9 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaSelfHighligthingTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaSelfHighligthingTest.java @@ -44,7 +44,7 @@ public class JsonSchemaSelfHighligthingTest extends JsonSchemaHeavyAbstractTest } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/patternSchema.json"); } diff --git a/json/tests/test/com/jetbrains/jsonSchema/impl/JsonBySchemaHeavyCompletionTest.java b/json/tests/test/com/jetbrains/jsonSchema/impl/JsonBySchemaHeavyCompletionTest.java index be2374f2b7b8..7a8c338ec237 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/impl/JsonBySchemaHeavyCompletionTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/impl/JsonBySchemaHeavyCompletionTest.java @@ -169,7 +169,7 @@ public class JsonBySchemaHeavyCompletionTest extends JsonSchemaHeavyAbstractTest } @Override - public void configureFiles() throws Exception { + public void configureFiles() { configureByFiles(null, "/" + folder + "/" + testFile + ".json", "/" + folder + "/Schema.json"); } diff --git a/json/tests/test/com/jetbrains/jsonSchema/impl/JsonSchemaReadTest.java b/json/tests/test/com/jetbrains/jsonSchema/impl/JsonSchemaReadTest.java index b291783490db..f70b9fb7f02e 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/impl/JsonSchemaReadTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/impl/JsonSchemaReadTest.java @@ -55,7 +55,7 @@ public class JsonSchemaReadTest extends CompletionTestCase { Assert.assertEquals("#/definitions/positiveIntegerDefault0", minLength.getRef()); } - public void testMainSchemaHighlighting() throws Exception { + public void testMainSchemaHighlighting() { final JsonSchemaService service = JsonSchemaService.Impl.get(myProject); final List providers = new JsonSchemaProjectSelfProviderFactory().getProviders(myProject); Assert.assertEquals(1, providers.size()); diff --git a/platform/configuration-store-impl/testSrc/xml/XmlSerializerWithDefaultJDOMExternalizerCompatibilityTest.java b/platform/configuration-store-impl/testSrc/xml/XmlSerializerWithDefaultJDOMExternalizerCompatibilityTest.java index 04ab5de4a758..95f3d9d5d71d 100644 --- a/platform/configuration-store-impl/testSrc/xml/XmlSerializerWithDefaultJDOMExternalizerCompatibilityTest.java +++ b/platform/configuration-store-impl/testSrc/xml/XmlSerializerWithDefaultJDOMExternalizerCompatibilityTest.java @@ -11,20 +11,20 @@ import static com.intellij.testFramework.assertions.Assertions.assertThat; @SuppressWarnings({"deprecation"}) public class XmlSerializerWithDefaultJDOMExternalizerCompatibilityTest extends TestCase { - public void testCompatibility() throws Exception { + public void testCompatibility() { assertCompatibleSerialization(new MyBean()); } - private static void assertCompatibleSerialization(final Object data) throws Exception { + private static void assertCompatibleSerialization(final Object data) { assertThat(serializeWithJDom(data)).isEqualTo(serializeWithXmlSerializer(data)); } - private static String serializeWithXmlSerializer(final Object data) throws Exception { + private static String serializeWithXmlSerializer(final Object data) { Element element = serialize(data); return StringUtil.trimStart(JDOMUtil.writeElement(element), "").trim(); } - private static String serializeWithJDom(final Object data) throws Exception { + private static String serializeWithJDom(final Object data) { final Element jDomRoot = new Element("MyBean"); if (data instanceof com.intellij.openapi.util.JDOMExternalizable) { diff --git a/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionPointImplTest.java b/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionPointImplTest.java index c31b142fbe4c..9a6733d70824 100644 --- a/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionPointImplTest.java +++ b/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionPointImplTest.java @@ -37,7 +37,7 @@ public class ExtensionPointImplTest { private static final TestLogProvider ourTestLog = new TestLogProvider(); @After - public void tearDown() throws Exception { + public void tearDown() { ourTestLog.errors(); } diff --git a/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionsAreaTest.java b/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionsAreaTest.java index a415f6f740b7..47d5dd1cfba1 100644 --- a/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionsAreaTest.java +++ b/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionsAreaTest.java @@ -29,7 +29,7 @@ import static org.junit.Assert.assertEquals; */ public class ExtensionsAreaTest { @Test - public void testGetComponentAdapterDoesntDuplicateAdapters() throws Exception { + public void testGetComponentAdapterDoesntDuplicateAdapters() { MutablePicoContainer picoContainer = new ExtensionsAreaImpl("foo", null, new DefaultPicoContainer(), new Extensions.SimpleLogProvider()).getPicoContainer(); picoContainer.registerComponentImplementation("runnable", ExtensionsAreaTest.class); diff --git a/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionsComplexTest.java b/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionsComplexTest.java index 4c622cf188b7..a9e7a973c34e 100644 --- a/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionsComplexTest.java +++ b/platform/extensions/testSrc/com/intellij/openapi/extensions/impl/ExtensionsComplexTest.java @@ -39,14 +39,14 @@ public class ExtensionsComplexTest { private List myAreasToDispose; @Before - public void setUp() throws Exception { + public void setUp() { myAreasToDispose = new ArrayList<>(); Extensions.registerAreaClass("area", null); Extensions.registerAreaClass("child_area", "area"); } @After - public void tearDown() throws Exception { + public void tearDown() { for (MyAreaInstance instance : myAreasToDispose) { Extensions.disposeArea(instance); } @@ -59,7 +59,7 @@ public class ExtensionsComplexTest { } @Test - public void testPluginInit() throws Exception { + public void testPluginInit() { initExtensionPoints( PLUGIN_NAME, "\n" + " \n" + diff --git a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/service/notification/MessageCounterTest.java b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/service/notification/MessageCounterTest.java index 3b9b73035b2f..a8b3d17b4506 100644 --- a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/service/notification/MessageCounterTest.java +++ b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/service/notification/MessageCounterTest.java @@ -31,7 +31,7 @@ public class MessageCounterTest { private static final ProjectSystemId OTHER_BUILD_SYSTEM = new ProjectSystemId("SomeOtherBuildSystem"); @Test - public void testIncrement() throws Exception { + public void testIncrement() { MessageCounter counter = new MessageCounter(); counter.increment(GROUP1, NotificationSource.PROJECT_SYNC, NotificationCategory.ERROR, OTHER_BUILD_SYSTEM); assertEquals(counter.toString(), 1, counter.getCount(GROUP1, NotificationSource.PROJECT_SYNC, NotificationCategory.ERROR, OTHER_BUILD_SYSTEM)); diff --git a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemTestCase.java b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemTestCase.java index 8a08eeadeecc..d0626fb240b3 100644 --- a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemTestCase.java +++ b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemTestCase.java @@ -120,7 +120,7 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase { CompilerTestUtil.enableExternalCompiler(); } - protected void collectAllowedRoots(List roots) throws IOException { + protected void collectAllowedRoots(List roots) { } public static Collection collectRootsInside(String root) { @@ -253,7 +253,7 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase { } @Override - protected void invokeTestRunnable(@NotNull Runnable runnable) throws Exception { + protected void invokeTestRunnable(@NotNull Runnable runnable) { runnable.run(); } @@ -288,11 +288,11 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase { return FileUtil.toSystemIndependentName(root.getPath() + "/" + relPath); } - protected Module createModule(String name) throws IOException { + protected Module createModule(String name) { return createModule(name, StdModuleTypes.JAVA); } - protected Module createModule(final String name, final ModuleType type) throws IOException { + protected Module createModule(final String name, final ModuleType type) { return new WriteCommandAction(myProject) { @Override protected void run(@NotNull Result moduleResult) throws Throwable { @@ -304,11 +304,11 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase { }.execute().getResultObject(); } - protected VirtualFile createProjectConfig(@NonNls String config) throws IOException { + protected VirtualFile createProjectConfig(@NonNls String config) { return myProjectConfig = createConfigFile(myProjectRoot, config); } - protected VirtualFile createConfigFile(final VirtualFile dir, String config) throws IOException { + protected VirtualFile createConfigFile(final VirtualFile dir, String config) { final String configFileName = getExternalSystemConfigFileName(); VirtualFile f = dir.findChild(configFileName); if (f == null) { @@ -502,7 +502,7 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase { fs.assertFileEqual(file); } - private static void setFileContent(final VirtualFile file, final String content, final boolean advanceStamps) throws IOException { + private static void setFileContent(final VirtualFile file, final String content, final boolean advanceStamps) { new WriteAction() { @Override protected void run(@NotNull Result result) throws Throwable { diff --git a/platform/lang-api/testSources/com/intellij/psi/codeStyle/arrangement/ArrangementSettingsSerializationTest.java b/platform/lang-api/testSources/com/intellij/psi/codeStyle/arrangement/ArrangementSettingsSerializationTest.java index c2aaeaa3f263..a2db6721f6e4 100644 --- a/platform/lang-api/testSources/com/intellij/psi/codeStyle/arrangement/ArrangementSettingsSerializationTest.java +++ b/platform/lang-api/testSources/com/intellij/psi/codeStyle/arrangement/ArrangementSettingsSerializationTest.java @@ -176,7 +176,7 @@ public class ArrangementSettingsSerializationTest { } @Test - public void testEmptyGroupings() throws Exception { + public void testEmptyGroupings() { final StdArrangementSettings settings = new StdArrangementSettings(); final ArrangementAtomMatchCondition condition = new ArrangementAtomMatchCondition(FIELD); settings.addRule(new StdArrangementMatchRule(new StdArrangementEntryMatcher(condition), BY_NAME)); @@ -192,7 +192,7 @@ public class ArrangementSettingsSerializationTest { } @Test - public void testEmptyRules() throws Exception { + public void testEmptyRules() { final StdArrangementSettings settings = new StdArrangementSettings(); settings.addGrouping(new ArrangementGroupingRule(OVERRIDDEN_METHODS, BY_NAME)); diff --git a/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerUncommittedDocumentTest.java b/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerUncommittedDocumentTest.java index 6a0e7f7ac127..14c9829ea798 100644 --- a/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerUncommittedDocumentTest.java +++ b/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerUncommittedDocumentTest.java @@ -17,10 +17,8 @@ package com.intellij.codeInsight.editorActions; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; -import java.io.IOException; - public class IndentingBackspaceHandlerUncommittedDocumentTest extends LightPlatformCodeInsightTestCase { - public void testSequentialBackspaceInvocation() throws IOException { + public void testSequentialBackspaceInvocation() { configureFromFileText(getTestName(false) + ".java", "class Foo {\n" + "\n" + @@ -32,7 +30,7 @@ public class IndentingBackspaceHandlerUncommittedDocumentTest extends LightPlatf "}"); } - public void testMulticaretSequentialBackspaceInvocation() throws IOException { + public void testMulticaretSequentialBackspaceInvocation() { configureFromFileText(getTestName(false) + ".java", "class Foo {\n" + " void m1() {\n" + diff --git a/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerVirtualSpaceTest.java b/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerVirtualSpaceTest.java index 78cf05abe4cb..5499a4c2d5d6 100644 --- a/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerVirtualSpaceTest.java +++ b/platform/lang-impl/testSources/com/intellij/codeInsight/editorActions/IndentingBackspaceHandlerVirtualSpaceTest.java @@ -18,10 +18,8 @@ package com.intellij.codeInsight.editorActions; import com.intellij.openapi.editor.LogicalPosition; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; -import java.io.IOException; - public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCodeInsightTestCase { - public void testAfterLargeIndent() throws IOException { + public void testAfterLargeIndent() { doTest("class Foo {\n" + " \n" + "}", @@ -32,7 +30,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode new LogicalPosition(1, 4)); } - public void testAfterProperIndent() throws IOException { + public void testAfterProperIndent() { doTest("class Foo {\n" + " \n" + "}", @@ -43,7 +41,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode new LogicalPosition(1, 4)); } - public void testAfterSmallIndent() throws IOException { + public void testAfterSmallIndent() { doTest("class Foo {\n" + " \n" + "}", @@ -54,7 +52,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode new LogicalPosition(1, 4)); } - public void testAfterEmptyIndent() throws IOException { + public void testAfterEmptyIndent() { doTest("class Foo {\n" + "\n" + "}", @@ -65,7 +63,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode new LogicalPosition(1, 4)); } - public void testAtIndent() throws IOException { + public void testAtIndent() { doTest("class Foo {\n" + " \n" + "}", @@ -75,7 +73,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode new LogicalPosition(0, 11)); } - public void testAtIndentOnEmptyLine() throws IOException { + public void testAtIndentOnEmptyLine() { doTest("class Foo {\n" + "\n" + "}", @@ -85,7 +83,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode new LogicalPosition(0, 11)); } - public void testBeforeIndent() throws IOException { + public void testBeforeIndent() { doTest("class Foo {\n" + " \n" + "}", @@ -95,7 +93,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode new LogicalPosition(0, 11)); } - public void testDeleteLine() throws IOException { + public void testDeleteLine() { doTest("class Foo {\n" + "\n" + "\n" + @@ -107,7 +105,7 @@ public class IndentingBackspaceHandlerVirtualSpaceTest extends LightPlatformCode new LogicalPosition(1, 4)); } - private void doTest(String textBefore, LogicalPosition caretBefore, String textAfter, LogicalPosition caretAfter) throws IOException { + private void doTest(String textBefore, LogicalPosition caretBefore, String textAfter, LogicalPosition caretAfter) { configureFromFileText(getTestName(false) + ".java", textBefore); myEditor.getSettings().setVirtualSpace(true); myEditor.getCaretModel().moveToLogicalPosition(caretBefore); diff --git a/platform/lang-impl/testSources/com/intellij/execution/impl/ExecutionManagerTest.java b/platform/lang-impl/testSources/com/intellij/execution/impl/ExecutionManagerTest.java index 821824a94a49..183747293d4a 100644 --- a/platform/lang-impl/testSources/com/intellij/execution/impl/ExecutionManagerTest.java +++ b/platform/lang-impl/testSources/com/intellij/execution/impl/ExecutionManagerTest.java @@ -52,7 +52,7 @@ public class ExecutionManagerTest extends LightPlatformTestCase { } } - public void testRerunSingleton() throws Exception { + public void testRerunSingleton() { Project project = getProject(); ExecutionManagerImpl executionManager = ExecutionManagerImpl.getInstance(project); diff --git a/platform/lang-impl/testSources/com/intellij/execution/impl/FakeRunConfiguration.java b/platform/lang-impl/testSources/com/intellij/execution/impl/FakeRunConfiguration.java index b77a3b4f9455..db4201c2b771 100644 --- a/platform/lang-impl/testSources/com/intellij/execution/impl/FakeRunConfiguration.java +++ b/platform/lang-impl/testSources/com/intellij/execution/impl/FakeRunConfiguration.java @@ -16,7 +16,6 @@ package com.intellij.execution.impl; import com.intellij.execution.DefaultExecutionResult; -import com.intellij.execution.ExecutionException; import com.intellij.execution.ExecutionResult; import com.intellij.execution.Executor; import com.intellij.execution.configurations.LocatableConfigurationBase; @@ -54,14 +53,14 @@ public class FakeRunConfiguration extends LocatableConfigurationBase { @Nullable @Override - public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) throws ExecutionException { + public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) { return new FakeRunProfileState(); } public class FakeRunProfileState implements RunProfileState { @Nullable @Override - public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException { + public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) { return new DefaultExecutionResult(null, new FakeProcessHandler(mySurviveSoftKill)); } } diff --git a/platform/lang-impl/testSources/com/intellij/ide/GeneratedSourceFileChangeTrackerTest.java b/platform/lang-impl/testSources/com/intellij/ide/GeneratedSourceFileChangeTrackerTest.java index 3c759d054888..54045678621c 100644 --- a/platform/lang-impl/testSources/com/intellij/ide/GeneratedSourceFileChangeTrackerTest.java +++ b/platform/lang-impl/testSources/com/intellij/ide/GeneratedSourceFileChangeTrackerTest.java @@ -24,8 +24,6 @@ import com.intellij.psi.PsiFile; import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase; import org.jetbrains.annotations.NotNull; -import java.io.IOException; - /** * @author nik */ @@ -61,7 +59,7 @@ public class GeneratedSourceFileChangeTrackerTest extends CodeInsightFixtureTest assertTrue(isEditedGeneratedFile(file)); } - public void testChangeGeneratedExternally() throws IOException { + public void testChangeGeneratedExternally() { PsiFile file = myFixture.configureByText("Gen.txt", ""); myFixture.saveText(file.getVirtualFile(), "abc"); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); diff --git a/platform/lang-impl/testSources/com/intellij/openapi/wm/impl/ProjectToolWindowTest.java b/platform/lang-impl/testSources/com/intellij/openapi/wm/impl/ProjectToolWindowTest.java index 6c42a9918ea1..943798e73df2 100644 --- a/platform/lang-impl/testSources/com/intellij/openapi/wm/impl/ProjectToolWindowTest.java +++ b/platform/lang-impl/testSources/com/intellij/openapi/wm/impl/ProjectToolWindowTest.java @@ -27,7 +27,7 @@ import com.intellij.openapi.wm.ToolWindowId; */ public class ProjectToolWindowTest extends ToolWindowManagerTestCase { - public void testProjectViewActivate() throws Exception { + public void testProjectViewActivate() { ToolWindowEP[] extensions = Extensions.getExtensions(ToolWindowEP.EP_NAME); for (ToolWindowEP extension : extensions) { diff --git a/platform/platform-tests/testSrc/com/intellij/application/BadPluginTest.java b/platform/platform-tests/testSrc/com/intellij/application/BadPluginTest.java index 979d10925cbf..ec571b37e7e4 100644 --- a/platform/platform-tests/testSrc/com/intellij/application/BadPluginTest.java +++ b/platform/platform-tests/testSrc/com/intellij/application/BadPluginTest.java @@ -35,7 +35,7 @@ import java.util.List; public class BadPluginTest extends PlatformTestCase { private static final String COM_YOUR_COMPANY_UNIQUE_PLUGIN_ID = "com.your.company.unique.plugin.id"; - public void testBadPlugin() throws Exception { + public void testBadPlugin() { IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(COM_YOUR_COMPANY_UNIQUE_PLUGIN_ID)); if (plugin == null) return; List disabledPlugins = new ArrayList<>(); diff --git a/platform/platform-tests/testSrc/com/intellij/application/options/ReplacePathToMacroMapTest.java b/platform/platform-tests/testSrc/com/intellij/application/options/ReplacePathToMacroMapTest.java index b597a6f1fc56..0937e3b21eb1 100644 --- a/platform/platform-tests/testSrc/com/intellij/application/options/ReplacePathToMacroMapTest.java +++ b/platform/platform-tests/testSrc/com/intellij/application/options/ReplacePathToMacroMapTest.java @@ -18,12 +18,12 @@ public class ReplacePathToMacroMapTest { } @Test - public void testSubstitute_NoSubstitute() throws Exception { + public void testSubstitute_NoSubstitute() { assertEquals("/foo/bar", substitute("/foo/bar")); } @Test - public void testSubstitute_CompleteMatch() throws Exception { + public void testSubstitute_CompleteMatch() { assertEquals("$MODULE_DIR$", substitute("/tmp/foo")); assertEquals("jar:$MODULE_DIR$", substitute("jar:/tmp/foo")); assertEquals("jar:/$MODULE_DIR$", substitute("jar://tmp/foo")); @@ -34,7 +34,7 @@ public class ReplacePathToMacroMapTest { } @Test - public void testSubstitute_PrefixMatch() throws Exception { + public void testSubstitute_PrefixMatch() { assertEquals("$MODULE_DIR$/bar", substitute("/tmp/foo/bar")); assertEquals("jar:$MODULE_DIR$/bar", substitute("jar:/tmp/foo/bar")); assertEquals("jar:/$MODULE_DIR$/bar", substitute("jar://tmp/foo/bar")); @@ -45,7 +45,7 @@ public class ReplacePathToMacroMapTest { } @Test - public void testSubstitute_JarPrefixMatch() throws Exception { + public void testSubstitute_JarPrefixMatch() { assertEquals("$MODULE_DIR$!/bar", substitute("/tmp/foo!/bar")); assertEquals("jar:$MODULE_DIR$!/bar", substitute("jar:/tmp/foo!/bar")); assertEquals("jar:/$MODULE_DIR$!/bar", substitute("jar://tmp/foo!/bar")); @@ -56,7 +56,7 @@ public class ReplacePathToMacroMapTest { } @Test - public void testSubstitute_WindowsRootSubstitution() throws Exception { + public void testSubstitute_WindowsRootSubstitution() { myMap.put("C:/", "../$MODULE_DIR$/"); assertEquals("../$MODULE_DIR$/", substitute("C:/")); @@ -64,22 +64,22 @@ public class ReplacePathToMacroMapTest { } @Test - public void testSubstitute_NoSubstituteInTheMiddleOccurs() throws Exception { + public void testSubstitute_NoSubstituteInTheMiddleOccurs() { assertEquals("/bar/tmp/foo/bar", substitute("/bar/tmp/foo/bar")); } @Test - public void testSubstitute_NoDoubleSubstitution() throws Exception { + public void testSubstitute_NoDoubleSubstitution() { assertEquals("$MODULE_DIR$/bar/tmp/foo", substitute("/tmp/foo/bar/tmp/foo")); } @Test - public void testSubstitute_NoPartialSubstituteIsPerformed() throws Exception { + public void testSubstitute_NoPartialSubstituteIsPerformed() { assertEquals("/tmp/foobar", substitute("/tmp/foobar")); } @Test - public void testSubstitute_ProperSubstitutionPriorityApplied() throws Exception { + public void testSubstitute_ProperSubstitutionPriorityApplied() { myMap.put("/root/project/module", "$MODULE_DIR$"); myMap.put("/root/project", "../$MODULE_DIR$"); myMap.put("/root", "$APPLICATION_HOME_DIR$"); diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/BlockSelectionEditingTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/BlockSelectionEditingTest.java index dbb57063e752..7862ab563a3e 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/BlockSelectionEditingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/BlockSelectionEditingTest.java @@ -21,11 +21,9 @@ import com.intellij.openapi.editor.SelectionModel; import com.intellij.openapi.editor.impl.AbstractEditorTest; import com.intellij.testFramework.TestFileType; -import java.io.IOException; - public class BlockSelectionEditingTest extends AbstractEditorTest { - public void testBlockRemovalAndCollapsedFoldRegionsBefore() throws IOException { + public void testBlockRemovalAndCollapsedFoldRegionsBefore() { // Inspired by IDEA-69371 String initialText = "fold line #1\n" + @@ -59,7 +57,7 @@ public class BlockSelectionEditingTest extends AbstractEditorTest { assertEquals(foldEndOffset, foldRegion.getEndOffset()); } - public void testBlockSelectionAndCollapsedFolding() throws IOException { + public void testBlockSelectionAndCollapsedFolding() { String text = "class Test {\n" + " private class Inner1 {\n" + diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/CommentInCustomFileTypesTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/CommentInCustomFileTypesTest.java index 4602ad456d45..5a6ffea0fcc7 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/CommentInCustomFileTypesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/CommentInCustomFileTypesTest.java @@ -28,7 +28,7 @@ public class CommentInCustomFileTypesTest extends LightPlatformCodeInsightTestCa return PlatformTestUtil.getPlatformTestDataPath(); } - public void testBlockComment() throws Exception { + public void testBlockComment() { configureByFile("/codeInsight/commentInCustomFileType/block1.cs"); performBlockCommentAction(); checkResultByFile("/codeInsight/commentInCustomFileType/block1_after.cs"); @@ -38,7 +38,7 @@ public class CommentInCustomFileTypesTest extends LightPlatformCodeInsightTestCa checkResultByFile("/codeInsight/commentInCustomFileType/block1_after2.cs"); } - public void testLineComment() throws Exception { + public void testLineComment() { configureByFile("/codeInsight/commentInCustomFileType/line1.cs"); performLineCommentAction(); checkResultByFile("/codeInsight/commentInCustomFileType/line1_after.cs"); diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java index a4b2d126c02e..916a25835e9e 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java @@ -27,7 +27,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.picocontainer.MutablePicoContainer; -import java.io.IOException; import java.util.Set; import static com.intellij.psi.search.GlobalSearchScopesCore.directoryScope; @@ -74,7 +73,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase { container.registerComponentInstance(componentKey, manager); } - public void testReformatWithoutMask() throws IOException { + public void testReformatWithoutMask() { TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory); PsiFile java1 = fileTree.addTestFile("Test.java", "empty content"); @@ -88,7 +87,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase { assertWasFormatted(java1, java2, java3, php, js); } - public void testFormatByOnlyOneMask() throws IOException { + public void testFormatByOnlyOneMask() { TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory); PsiFile java1 = fileTree.addTestFile("Test.java", "empty content"); @@ -108,7 +107,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase { } - public void testFormatByMultiMask() throws IOException { + public void testFormatByMultiMask() { TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory); PsiFile java1 = fileTree.addTestFile("Test.java", "empty content"); @@ -145,7 +144,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase { assertWasNotFormatted(js1, js2, js3, php1, php2, java1, java2, java3, py1, py2, py3); } - public void testDirectoryScope() throws IOException { + public void testDirectoryScope() { TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory); PsiFile java1 = fileTree.addTestFile("Test1.java", "empty content"); PsiFile php1 = fileTree.addTestFile("Pair1.php", "empty content"); @@ -181,7 +180,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase { assertWasNotFormatted(java2, php2, js2); } - public void testDirectoryScopeWithMask() throws IOException { + public void testDirectoryScopeWithMask() { TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory); PsiFile java1 = fileTree.addTestFile("Test1.java", "empty content"); PsiFile php1 = fileTree.addTestFile("Pair1.php", "empty content"); @@ -211,7 +210,7 @@ public class ReformatFilesWithFiltersTest extends LightPlatformTestCase { assertWasNotFormatted(java2, php2, js1, js2, js3); } - public void testIDEA126830() throws IOException { + public void testIDEA126830() { TestFileStructure fileTree = new TestFileStructure(getModule(), myWorkingDirectory); fileTree.createDirectoryAndMakeItCurrent("src"); diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java index 81b3691b6eaa..283f7f2f5243 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java @@ -17,7 +17,8 @@ package com.intellij.codeInsight.actions; import com.intellij.lang.LanguageFormatting; import com.intellij.lang.LanguageImportStatements; -import com.intellij.openapi.actionSystem.*; +import com.intellij.openapi.actionSystem.CommonDataKeys; +import com.intellij.openapi.actionSystem.LangDataKeys; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.impl.ComponentManagerImpl; @@ -245,7 +246,7 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase { assertFormattedLines(NO_CHANGED_LINES, u1, u2); } - public void testNoChangesNoFormatting() throws IOException { + public void testNoChangesNoFormatting() { ChangedFilesStructure fs = new ChangedFilesStructure(myWorkingDirectory); PsiFile u1 = fs.createFile("Test1.java", COMMITTED, COMMITTED); @@ -257,7 +258,7 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase { } - public void testReformatOnlyChanged() throws IOException { + public void testReformatOnlyChanged() { ChangedFilesStructure fs = new ChangedFilesStructure(myWorkingDirectory); PsiFile untouched1 = fs.createFile("Test1.java", COMMITTED, COMMITTED); @@ -294,7 +295,7 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase { assertFormattedLines(NO_CHANGED_LINES, modified11, modified12); } - public void testOptimizeImportsInModule() throws IOException { + public void testOptimizeImportsInModule() { ChangedFilesStructure fs = new ChangedFilesStructure(myWorkingDirectory); String initialFile = "initial file"; @@ -348,7 +349,7 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase { container.registerComponentInstance(key, factory); } - private void doTest(@NotNull String committed, @NotNull String modified, @NotNull ChangedLines... lines) throws IOException { + private void doTest(@NotNull String committed, @NotNull String modified, @NotNull ChangedLines... lines) { ChangedFilesStructure fs = new ChangedFilesStructure(myWorkingDirectory); PsiFile file = fs.createFile("Test.java", committed, modified); reformatDirectory(myWorkingDirectory); @@ -391,15 +392,14 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase { myFileStructure = new TestFileStructure(getModule(), directory); } - public void createDirectoryAndMakeItCurrent() throws IOException { + public void createDirectoryAndMakeItCurrent() { myFileStructure.createDirectoryAndMakeItCurrent("inner"); } @NotNull public PsiFile createFile(@NotNull String fileName, @NotNull String committedContent, - @NotNull String actualContent) throws IOException - { + @NotNull String actualContent) { PsiFile file = myFileStructure.addTestFile(fileName, actualContent); if (committedContent != actualContent) { registerCommittedRevision(committedContent, file); diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/TestFileStructure.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/TestFileStructure.java index df44ad105543..d27f602853e3 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/TestFileStructure.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/TestFileStructure.java @@ -51,7 +51,7 @@ public class TestFileStructure { } @NotNull - public PsiFile addTestFile(@NotNull String name, @NotNull String content) throws IOException { + public PsiFile addTestFile(@NotNull String name, @NotNull String content) { PsiFile createdFile = createFile(myModule, myCurrentLevelDirectory.getVirtualFile(), name, content); getCurrentDirectoryFiles().add(createdFile); return createdFile; @@ -68,7 +68,7 @@ public class TestFileStructure { } @NotNull - public PsiDirectory createDirectoryAndMakeItCurrent(String name) throws IOException { + public PsiDirectory createDirectoryAndMakeItCurrent(String name) { myLevel++; myFilesForLevel.add(new ArrayList<>()); myCurrentLevelDirectory = createDirectory(myProject, myCurrentLevelDirectory.getVirtualFile(), name); @@ -98,7 +98,7 @@ public class TestFileStructure { }.execute().getResultObject(); } - public static PsiDirectory createDirectory(@NotNull Project project, @NotNull final VirtualFile parent, @NotNull final String name) throws IOException { + public static PsiDirectory createDirectory(@NotNull Project project, @NotNull final VirtualFile parent, @NotNull final String name) { final VirtualFile[] dir = new VirtualFile[1]; ApplicationManager.getApplication().runWriteAction(() -> { try { diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/editorActions/AbstractMoveElementLeftRightTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/editorActions/AbstractMoveElementLeftRightTest.java index 7b9871186bc4..447d9a9b996e 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/editorActions/AbstractMoveElementLeftRightTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/editorActions/AbstractMoveElementLeftRightTest.java @@ -45,11 +45,11 @@ public abstract class AbstractMoveElementLeftRightTest extends AbstractEditorTes doTestSingle(!moveLeft, current, before); } - private void doTestSingle(boolean moveLeft, String before, String after) throws Exception { + private void doTestSingle(boolean moveLeft, String before, String after) { configureEditor(before); executeAction(moveLeft ? IdeActions.MOVE_ELEMENT_LEFT : IdeActions.MOVE_ELEMENT_RIGHT); checkResultByText(after); } - protected abstract void configureEditor(String contents) throws Exception; + protected abstract void configureEditor(String contents); } diff --git a/platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java b/platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java index 20688c8054a8..5adc3504fa5a 100644 --- a/platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java @@ -125,7 +125,7 @@ public class JobUtilTest extends PlatformTestCase { } } - public void testJobUtilRecursiveStress() throws Exception { + public void testJobUtilRecursiveStress() { final List list = Collections.nCopies(100, null); for (int i=0; i<10; i++) { COUNT.set(0); @@ -187,7 +187,7 @@ public class JobUtilTest extends PlatformTestCase { } private static class MyException extends RuntimeException {} - public void testExceptionalCompletion() throws Throwable { + public void testExceptionalCompletion() { COUNT.set(0); try { final List objects = Collections.nCopies(100000000, null); @@ -204,7 +204,7 @@ public class JobUtilTest extends PlatformTestCase { // caught OK } } - public void testNotNormalCompletion() throws Throwable { + public void testNotNormalCompletion() { COUNT.set(0); final List objects = Collections.nCopies(100000000, null); boolean success = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(objects, null, true, o -> { @@ -217,7 +217,7 @@ public class JobUtilTest extends PlatformTestCase { assertFalse(success); } - public void testJobUtilCompletesEvenIfCannotGrabReadAction() throws Throwable { + public void testJobUtilCompletesEvenIfCannotGrabReadAction() { COUNT.set(0); final List objects = Collections.nCopies(1000000, null); ApplicationManager.getApplication().runWriteAction(() -> { @@ -230,7 +230,7 @@ public class JobUtilTest extends PlatformTestCase { }); } - public void testJobUtilRecursiveCancel() throws Exception { + public void testJobUtilRecursiveCancel() { final List list = Collections.nCopies(100, ""); final List ilist = Collections.nCopies(100, 0); for (int i=0; i<10; i++) { @@ -325,7 +325,7 @@ public class JobUtilTest extends PlatformTestCase { } } - public void testAfterCancelInTheMiddleOfTheExecutionTaskIsDoneReturnsFalseUntilFinished() throws ExecutionException, InterruptedException { + public void testAfterCancelInTheMiddleOfTheExecutionTaskIsDoneReturnsFalseUntilFinished() { Random random = new Random(); for (int i=0; i<100; i++) { final AtomicBoolean finished = new AtomicBoolean(); diff --git a/platform/platform-tests/testSrc/com/intellij/execution/filters/CompositeFilterTest.java b/platform/platform-tests/testSrc/com/intellij/execution/filters/CompositeFilterTest.java index 895d55cbe08e..f6efb338f7d2 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/filters/CompositeFilterTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/filters/CompositeFilterTest.java @@ -28,13 +28,13 @@ public class CompositeFilterTest { protected CompositeFilter myCompositeFilter; @Before - public void setUp() throws Exception { + public void setUp() { myCompositeFilter = new CompositeFilter(new MockDumbService(null)); myCompositeFilter.setForceUseAllFilters(false); } @Test - public void testApplyNextFilter() throws Exception { + public void testApplyNextFilter() { Assert.assertNull(applyFilter()); myCompositeFilter.addFilter(returnNullFilter()); @@ -62,7 +62,7 @@ public class CompositeFilterTest { } @Test - public void testApplyBadFilter() throws Exception { + public void testApplyBadFilter() { myCompositeFilter.addFilter(throwSOEFilter()); try { Assert.assertNull(applyFilter()); diff --git a/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java index b873b951b103..2d4c5ee23316 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/impl/ConsoleViewImplTest.java @@ -75,7 +75,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { } } - public void testTypeText() throws Exception { + public void testTypeText() { ConsoleViewImpl console = myConsole; console.print("Initial", ConsoleViewContentType.NORMAL_OUTPUT); console.flushDeferredText(); @@ -104,7 +104,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { assertEquals("Test", console.getText()); } - public void testConsolePrintsSomethingAfterClearPrintScroll() throws Exception { + public void testConsolePrintsSomethingAfterClearPrintScroll() { ConsoleViewImpl console = myConsole; Alarm alarm = new Alarm(getTestRootDisposable()); for (int i=0; i<1000/*000*/; i++) { @@ -149,7 +149,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { } } - public void testTypeInEmptyConsole() throws Exception { + public void testTypeInEmptyConsole() { ConsoleViewImpl console = myConsole; console.clear(); EditorActionManager actionManager = EditorActionManager.getInstance(); @@ -159,7 +159,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { assertEquals(1, console.getContentSize()); } - public void testTypingAfterMultipleCR() throws Exception { + public void testTypingAfterMultipleCR() { final EditorActionManager actionManager = EditorActionManager.getInstance(); final TypedAction typedAction = actionManager.getTypedAction(); final TestDataProvider dataContext = new TestDataProvider(getProject()); @@ -176,7 +176,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { assertEquals("System output\n12", editor.getDocument().getText()); } - public void testCRLF() throws Exception { + public void testCRLF() { ConsoleViewImpl console = myConsole; console.clear(); console.print("Hello\r", ConsoleViewContentType.NORMAL_OUTPUT); @@ -185,20 +185,20 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { assertEquals("Hello\nWorld", console.getText()); } - public void testCRTypeCR() throws Exception { + public void testCRTypeCR() { myConsole.print("\rHi\rMr\rSmith", ConsoleViewContentType.NORMAL_OUTPUT); myConsole.flushDeferredText(); assertEquals("Smith", myConsole.getText()); } - public void testCRTypeTearCR() throws Exception { + public void testCRTypeTearCR() { myConsole.print("Hi", ConsoleViewContentType.NORMAL_OUTPUT); myConsole.print("\rMr\rSmith", ConsoleViewContentType.NORMAL_OUTPUT); myConsole.flushDeferredText(); assertEquals("Smith", myConsole.getText()); } - public void testCRTypeFlushCR() throws Exception { + public void testCRTypeFlushCR() { myConsole.print("Hi", ConsoleViewContentType.NORMAL_OUTPUT); myConsole.flushDeferredText(); assertEquals("Hi", myConsole.getText()); @@ -226,7 +226,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { return console; } - public void testPerformance() throws Exception { + public void testPerformance() { withCycleConsole(100, console -> PlatformTestUtil.startPerformanceTest("console print", 15000, () -> { console.clear(); @@ -240,7 +240,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { }).assertTiming()); } - public void testLargeConsolePerformance() throws Exception { + public void testLargeConsolePerformance() { withCycleConsole(UISettings.getInstance().getConsoleCycleBufferSizeKb(), console -> PlatformTestUtil.startPerformanceTest("console print", 9000, () -> { console.clear(); @@ -252,7 +252,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { }).assertTiming()); } - public void testPerformanceOfMergeableTokens() throws Exception { + public void testPerformanceOfMergeableTokens() { withCycleConsole(1000, console -> PlatformTestUtil.startPerformanceTest("console print with mergeable tokens", 3500, () -> { console.clear(); @@ -354,7 +354,7 @@ public class ConsoleViewImplTest extends LightPlatformTestCase { action.actionPerformed(editor, c, dataContext); } - public void testBackspaceDoesDeleteTheLastTypedChar() throws Exception { + public void testBackspaceDoesDeleteTheLastTypedChar() { final ConsoleViewImpl console = myConsole; final Editor editor = console.getEditor(); console.print("xxxx", ConsoleViewContentType.NORMAL_OUTPUT); diff --git a/platform/platform-tests/testSrc/com/intellij/execution/process/AnsiEscapeDecoderTest.java b/platform/platform-tests/testSrc/com/intellij/execution/process/AnsiEscapeDecoderTest.java index 1442e9411a35..b9107fca9807 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/process/AnsiEscapeDecoderTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/process/AnsiEscapeDecoderTest.java @@ -9,7 +9,10 @@ import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; import org.junit.Assert; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.OutputStream; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -19,26 +22,26 @@ public class AnsiEscapeDecoderTest extends PlatformTestCase { private static final String STDOUT_KEY = ProcessOutputTypes.STDOUT.toString(); private static final String STDERR_KEY = ProcessOutputTypes.STDERR.toString(); - public void testTextWithoutColors() throws Exception { + public void testTextWithoutColors() { check(new ColoredText("")); check(new ColoredText("simple text").addExpected("simple text", STDOUT_KEY)); } - public void testSingleColoredChunk() throws Exception { + public void testSingleColoredChunk() { check(new ColoredText("Chrome 35.0.1916 (Linux): Executed 0 of 1\u001B[32m SUCCESS\u001B[39m (0 secs / 0 secs)\n") .addExpected("Chrome 35.0.1916 (Linux): Executed 0 of 1", STDOUT_KEY) .addExpected(" SUCCESS", "\u001B[32m") .addExpected(" (0 secs / 0 secs)\n", "\u001B[39m")); } - public void testCompoundEscSeq() throws Exception { + public void testCompoundEscSeq() { check(new ColoredText("E\u001B[41m\u001B[37mE\u001B[0mE") .addExpected("E", STDOUT_KEY) .addExpected("E", "\u001B[41;37m") .addExpected("E", STDOUT_KEY)); } - public void testOtherEscSeq() throws Exception { + public void testOtherEscSeq() { check(new ColoredText("Plain\u001B[32mGreen\u001B[39mNormal\u001B[1A\u001B[2K\u001B[31mRed\u001B[39m") .addExpected("Plain", STDOUT_KEY) .addExpected("Green", "\u001B[32m") @@ -46,7 +49,7 @@ public class AnsiEscapeDecoderTest extends PlatformTestCase { .addExpected("Red", "\u001B[31m")); } - public void testBackspaceControlSequence() throws Exception { + public void testBackspaceControlSequence() { check(false, ContainerUtil.newArrayList( new ColoredText(" 10% 0/1 build modules\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b 70% 1/1 build modules") .addExpected(" 70% 1/1 build modules", STDOUT_KEY), @@ -56,7 +59,7 @@ public class AnsiEscapeDecoderTest extends PlatformTestCase { )); } - public void testIncompleteEscapeSequences() throws Exception { + public void testIncompleteEscapeSequences() { check(true, ContainerUtil.newArrayList( new ColoredText("\u001B"), new ColoredText("[33m Hello\u001B[3").addExpected(" Hello", "\u001B[33m"), @@ -175,7 +178,7 @@ public class AnsiEscapeDecoderTest extends PlatformTestCase { }; } - public void testPerformance() throws IOException { + public void testPerformance() { Process testProcess = createTestProcess(); //noinspection CodeBlock2Expr diff --git a/platform/platform-tests/testSrc/com/intellij/execution/process/BinaryOSProcessHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/execution/process/BinaryOSProcessHandlerTest.java index 41aeca2a83cc..5f9248199075 100644 --- a/platform/platform-tests/testSrc/com/intellij/execution/process/BinaryOSProcessHandlerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/execution/process/BinaryOSProcessHandlerTest.java @@ -96,7 +96,7 @@ public class BinaryOSProcessHandlerTest { private static final int SEND_TIMEOUT = 500; @SuppressWarnings("BusyWait") - public static void main(String[] args) throws IOException, InterruptedException { + public static void main(String[] args) throws InterruptedException { System.err.print(TEXT); for (int offset = 0; offset < BYTES.length; offset += PACKET_SIZE) { diff --git a/platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java index 3a82faa89965..0aa835ceedcc 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java @@ -137,7 +137,7 @@ public class LocalVcsLabelsTest extends LocalHistoryTestCase { } @Test - public void testGettingByteContent() throws Exception { + public void testGettingByteContent() { LabelImpl l1 = myVcs.putSystemLabel("label", "project", -1); add(myVcs, createFile(myRoot, "f", "one")); @@ -158,7 +158,7 @@ public class LocalVcsLabelsTest extends LocalHistoryTestCase { } @Test - public void testGettingByteContentInsideChangeSet() throws Exception { + public void testGettingByteContentInsideChangeSet() { myVcs.beginChangeSet(); add(myVcs, createFile(myRoot, "f", "one")); LabelImpl l1 = myVcs.putSystemLabel("label", "project", -1); @@ -171,7 +171,7 @@ public class LocalVcsLabelsTest extends LocalHistoryTestCase { } @Test - public void testGettingByteContentAfterRename() throws Exception { + public void testGettingByteContentAfterRename() { add(myVcs, createFile(myRoot, "f", "one")); LabelImpl l1 = myVcs.putSystemLabel("label", "project", -1); diff --git a/platform/platform-tests/testSrc/com/intellij/history/core/PathsTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/PathsTest.java index f8bc13e05aed..029e68c6e645 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/core/PathsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/core/PathsTest.java @@ -71,7 +71,7 @@ public class PathsTest extends LocalHistoryTestCase { } @Test - public void testIsParentOf() throws Exception { + public void testIsParentOf() { assertTrue(Paths.isParent("foo", "foo")); assertTrue(Paths.isParent("foo", "foo/bar")); assertTrue(Paths.isParent("foo/bar", "foo/bar")); @@ -86,7 +86,7 @@ public class PathsTest extends LocalHistoryTestCase { } @Test - public void testIsParentOrChildOf() throws Exception { + public void testIsParentOrChildOf() { assertTrue(Paths.isParentOrChild("foo/bar", "foo/bar")); assertTrue(Paths.isParentOrChild("foo/bar", "foo/bar/baz")); assertTrue(Paths.isParentOrChild("foo/bar/baz", "foo/bar")); @@ -96,7 +96,7 @@ public class PathsTest extends LocalHistoryTestCase { } @Test - public void testSplitting() throws Exception { + public void testSplitting() { assertEquals(array("/", "foo", "bar"), ContainerUtil.collect(Paths.split("/foo/bar").iterator())); assertEquals(array("/", "foo", "bar"), ContainerUtil.collect(Paths.split("/foo/bar/").iterator())); assertEquals(array("foo", "bar"), ContainerUtil.collect(Paths.split("foo/bar/").iterator())); diff --git a/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java index 69e64f41100c..81cb7a136ff8 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java @@ -324,7 +324,7 @@ public class ChangeListCollectingChangesTest extends ChangeListTestCase { } @Test - public void testFilteredChanges() throws Exception { + public void testFilteredChanges() { ChangeSet cs1 = addChangeSet(facade, createDirectory(r, "dir")); ChangeSet cs2 = addChangeSet(facade, createFile(r, "dir/FooBar")); ChangeSet cs3 = addChangeSet(facade, createFile(r, "dir/BarBaz")); @@ -338,7 +338,7 @@ public class ChangeListCollectingChangesTest extends ChangeListTestCase { } @Test - public void testFilteredChangesDoesnTIncludeChanges() throws Exception { + public void testFilteredChangesDoesnTIncludeChanges() { ChangeSet cs1 = addChangeSet(facade, createDirectory(r, "dir")); ChangeSet cs2 = addChangeSet(facade, createFile(r, "dir/FooBar")); ChangeSet cs3 = addChangeSet(facade, createFile(r, "dir/BarBaz")); diff --git a/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListTest.java b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListTest.java index 96382d20e55e..a3fc9cd81fae 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/core/changes/ChangeListTest.java @@ -118,7 +118,7 @@ public class ChangeListTest extends ChangeListTestCase { } @Test - public void testForcesBegin() throws Exception { + public void testForcesBegin() { facade.beginChangeSet(); add(facade, createFile(r, "f1")); facade.beginChangeSet(); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ActionsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ActionsTest.java index 7977a349d227..23f44f3d75e2 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ActionsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ActionsTest.java @@ -24,7 +24,6 @@ import com.intellij.openapi.editor.Document; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.vfs.VirtualFile; -import java.io.IOException; import java.util.List; public class ActionsTest extends IntegrationTestCase { @@ -79,7 +78,7 @@ public class ActionsTest extends IntegrationTestCase { CommandProcessor.getInstance().executeCommand(myProject, new RunnableAdapter() { @Override - public void doRun() throws IOException { + public void doRun() { setContent(f, "file"); setDocumentTextFor(f, "doc1"); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/BasicsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/BasicsTest.java index 3168475375c4..1e97e9691259 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/BasicsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/BasicsTest.java @@ -35,7 +35,7 @@ import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; public class BasicsTest extends IntegrationTestCase { - public void testProcessingCommands() throws Exception { + public void testProcessingCommands() { final VirtualFile[] f = new VirtualFile[1]; ApplicationManager.getApplication().runWriteAction(() -> CommandProcessor.getInstance().executeCommand(myProject, new RunnableAdapter() { @@ -51,7 +51,7 @@ public class BasicsTest extends IntegrationTestCase { assertEquals(2, getRevisionsFor(f[0]).size()); } - public void testPuttingUserLabel() throws Exception { + public void testPuttingUserLabel() { VirtualFile f = createChildData(myRoot, "f.txt"); LocalHistory.getInstance().putUserLabel(myProject, "global"); @@ -69,7 +69,7 @@ public class BasicsTest extends IntegrationTestCase { assertEquals(-1, rr.get(2).getLabelColor()); } - public void testPuttingSystemLabel() throws IOException { + public void testPuttingSystemLabel() { VirtualFile f = createChildData(myRoot, "file.txt"); assertEquals(2, getRevisionsFor(f).size()); @@ -86,7 +86,7 @@ public class BasicsTest extends IntegrationTestCase { assertEquals("label", rr.get(1).getLabel()); } - public void testPuttingLabelWithUnsavedDocuments() throws Exception { + public void testPuttingLabelWithUnsavedDocuments() { VirtualFile f = createChildData(myRoot, "f.txt"); setContent(f, "1"); @@ -111,7 +111,7 @@ public class BasicsTest extends IntegrationTestCase { assertEquals("", new String(rr.get(7).findEntry().getContent().getBytes())); } - public void testDoNotRegisterSameUnsavedDocumentContentTwice() throws Exception { + public void testDoNotRegisterSameUnsavedDocumentContentTwice() { VirtualFile f = createChildData(myRoot, "f.txt"); setContent(f, "1"); @@ -128,7 +128,7 @@ public class BasicsTest extends IntegrationTestCase { assertEquals("", new String(rr.get(4).findEntry().getContent().getBytes())); } - public void testIsUnderControl() throws Exception { + public void testIsUnderControl() { VirtualFile f1 = createChildData(myRoot, "file.txt"); VirtualFile f2 = createChildData(myRoot, "file.hprof"); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java index 1ff19eabaa4b..f76b6b51af53 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ExternalChangesAndRefreshingTest.java @@ -144,7 +144,7 @@ public class ExternalChangesAndRefreshingTest extends IntegrationTestCase { assertEquals("content", content[0]); } - public void testDeletionOfFilteredDirectoryExternallyDoesNotThrowExceptionDuringRefresh() throws Exception { + public void testDeletionOfFilteredDirectoryExternallyDoesNotThrowExceptionDuringRefresh() { int before = getRevisionsFor(myRoot).size(); createChildDirectory(myRoot, FILTERED_DIR_NAME); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/FileListeningTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/FileListeningTest.java index 4767ab53ce3c..3790c99eced1 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/FileListeningTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/FileListeningTest.java @@ -51,7 +51,7 @@ public class FileListeningTest extends IntegrationTestCase { assertEquals(2, getRevisionsFor(f).size()); } - public void testCreatingDirectories() throws Exception { + public void testCreatingDirectories() { VirtualFile f = createDirectory("dir"); assertEquals(2, getRevisionsFor(f).size()); } @@ -63,7 +63,7 @@ public class FileListeningTest extends IntegrationTestCase { assertEquals(before, getRevisionsFor(myRoot).size()); } - public void testIgnoringFilteredDirectories() throws Exception { + public void testIgnoringFilteredDirectories() { int before = getRevisionsFor(myRoot).size(); createDirectory(FILTERED_DIR_NAME); @@ -152,7 +152,7 @@ public class FileListeningTest extends IntegrationTestCase { addFileListenerDuring(l, new RunnableAdapter() { @Override - public void doRun() throws IOException { + public void doRun() { rename(f, "new.txt"); } }); @@ -195,7 +195,7 @@ public class FileListeningTest extends IntegrationTestCase { assertEquals(3, getRevisionsFor(f).size()); } - public void testRenamingNonFilteredDirectoriesToFiltered() throws Exception { + public void testRenamingNonFilteredDirectoriesToFiltered() { int before = getRevisionsFor(myRoot).size(); VirtualFile f = createDirectory("not_filtered"); @@ -235,7 +235,7 @@ public class FileListeningTest extends IntegrationTestCase { }); } - public void testDeletion() throws Exception { + public void testDeletion() { VirtualFile f = createDirectory("f.txt"); int before = getRevisionsFor(myRoot).size(); @@ -244,7 +244,7 @@ public class FileListeningTest extends IntegrationTestCase { assertEquals(before + 1, getRevisionsFor(myRoot).size()); } - public void testDeletionOfFilteredDirectoryDoesNotThrowsException() throws Exception { + public void testDeletionOfFilteredDirectoryDoesNotThrowsException() { int before = getRevisionsFor(myRoot).size(); VirtualFile f = createDirectory(FILTERED_DIR_NAME); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java index c4846103aad6..81c5e1c47a55 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/GettingContentAtDateTest.java @@ -33,7 +33,7 @@ public class GettingContentAtDateTest extends IntegrationTestCase { f = createChildData(myRoot, "f.txt"); } - public void testContentAtDate() throws Exception { + public void testContentAtDate() { setContent(f, "1", TIMESTAMP_INCREMENT); setContent(f, "2", TIMESTAMP_INCREMENT * 2); @@ -44,14 +44,14 @@ public class GettingContentAtDateTest extends IntegrationTestCase { assertContentAt(TIMESTAMP_INCREMENT * 3, null); } - public void testContentAtDateForFilteredFilesIsNull() throws Exception { + public void testContentAtDateForFilteredFilesIsNull() { VirtualFile f = createChildData(myRoot, "f.class"); setContent(f, "1", 1111); assertContentAt(1111, null); } - public void testGettingFirstAvailableContentAfterPurge() throws Exception { + public void testGettingFirstAvailableContentAfterPurge() { Clock.setTime(1); setContent(f, "1", TIMESTAMP_INCREMENT); Clock.setTime(2); @@ -66,7 +66,7 @@ public class GettingContentAtDateTest extends IntegrationTestCase { assertContentAt(TIMESTAMP_INCREMENT * 3, "3"); } - public void testGettingMostRecentRevisionContent() throws Exception { + public void testGettingMostRecentRevisionContent() { setContent(f, "1", TIMESTAMP_INCREMENT); setContent(f, "2", TIMESTAMP_INCREMENT * 2); @@ -79,7 +79,7 @@ public class GettingContentAtDateTest extends IntegrationTestCase { assertContentAt(c, "2"); } - public void testWithUnsavedDocuments() throws Exception { + public void testWithUnsavedDocuments() { setContent(f, "FILE1", TIMESTAMP_INCREMENT); Clock.setTime(TIMESTAMP_INCREMENT * 2); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/IdeaGatewayTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/IdeaGatewayTest.java index d5b5f78a019a..22780e8cc17e 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/IdeaGatewayTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/IdeaGatewayTest.java @@ -25,7 +25,7 @@ import java.io.File; import java.io.IOException; public class IdeaGatewayTest extends IntegrationTestCase { - public void testFindingFile() throws Exception { + public void testFindingFile() { assertEquals(myRoot, myGateway.findVirtualFile(myRoot.getPath())); assertNull(myGateway.findVirtualFile(myRoot.getPath() + "/nonexistent")); } diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java index 2fd9341d50c4..1dcc7535be1a 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/IntegrationTestCase.java @@ -106,17 +106,17 @@ public abstract class IntegrationTestCase extends PlatformTestCase { } @NotNull - protected VirtualFile createDirectory(String name) throws IOException { + protected VirtualFile createDirectory(String name) { VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByPath(createDirectoryExternally(name)); assertNotNull(name, file); return file; } - protected void setContent(VirtualFile f, String content) throws IOException { + protected void setContent(VirtualFile f, String content) { setContent(f, content, f.getTimeStamp() + TIMESTAMP_INCREMENT); } - protected void setContent(VirtualFile f, String content, long timestamp) throws IOException { + protected void setContent(VirtualFile f, String content, long timestamp) { setBinaryContent(f, content.getBytes(CharsetToolkit.UTF8_CHARSET), -1, timestamp,this); } @@ -132,7 +132,7 @@ public abstract class IntegrationTestCase extends PlatformTestCase { return FileUtil.toSystemIndependentName(f.getPath()); } - protected String createDirectoryExternally(String name) throws IOException { + protected String createDirectoryExternally(String name) { File f = new File(myRoot.getPath(), name); assertTrue(f.getPath(), f.mkdirs() || f.isDirectory()); return FileUtil.toSystemIndependentName(f.getPath()); @@ -187,7 +187,7 @@ public abstract class IntegrationTestCase extends PlatformTestCase { }); } - protected static void addFileListenerDuring(VirtualFileListener l, Runnable r) throws Exception { + protected static void addFileListenerDuring(VirtualFileListener l, Runnable r) { VirtualFileManager.getInstance().addVirtualFileListener(l); try { r.run(); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java index 963024311ad7..630c2bda3d8e 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java @@ -26,7 +26,6 @@ import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -40,7 +39,7 @@ public abstract class PatchingTestCase extends IntegrationTestCase { patchFilePath = new File(dir, "patch").getPath(); } - protected void clearRoot() throws IOException { + protected void clearRoot() { for (VirtualFile f : myRoot.getChildren()) { delete(f); } @@ -54,7 +53,7 @@ public abstract class PatchingTestCase extends IntegrationTestCase { new PatchApplier(myProject, myRoot, patches, null, null, null).execute(); } - protected static void createChildDataWithContent(@NotNull VirtualFile dir, @NotNull String name) throws IOException { + protected static void createChildDataWithContent(@NotNull VirtualFile dir, @NotNull String name) { createChildData(dir, name); VirtualFile file = dir.findChild(name); setFileText(file, "some content"); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java index 61b599784a7f..3fc6db6f4e2a 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/RevisionsAndDiffsTest.java @@ -72,7 +72,7 @@ public class RevisionsAndDiffsTest extends IntegrationTestCase { assertContent("content", e); } - public void testCurrentRevisionForDirectoryAfterPurge() throws Exception { + public void testCurrentRevisionForDirectoryAfterPurge() { Clock.setTime(10); VirtualFile f = createDirectory("dir"); getVcs().getChangeListInTests().purgeObsolete(0); @@ -182,7 +182,7 @@ public class RevisionsAndDiffsTest extends IntegrationTestCase { assertNull(rr.get(3).findEntry()); } - public void testRevisionForDirectoryWithTheSameNameAsDeletedOne() throws IOException { + public void testRevisionForDirectoryWithTheSameNameAsDeletedOne() { VirtualFile dir = createDirectory("dir"); delete(dir); dir = createDirectory("dir"); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java b/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java index bc5369b9bcb1..44a261d191da 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/TestVirtualFile.java @@ -25,7 +25,6 @@ import com.intellij.util.ArrayUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; @@ -105,7 +104,7 @@ public class TestVirtualFile extends VirtualFile { @Override @NotNull - public byte[] contentsToByteArray() throws IOException { + public byte[] contentsToByteArray() { return myContent == null ? ArrayUtil.EMPTY_BYTE_ARRAY : myContent.getBytes(); } @@ -138,7 +137,7 @@ public class TestVirtualFile extends VirtualFile { @Override @NotNull - public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) throws IOException { + public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) { throw new UnsupportedOperationException(); } @@ -148,7 +147,7 @@ public class TestVirtualFile extends VirtualFile { } @Override - public InputStream getInputStream() throws IOException { + public InputStream getInputStream() { throw new UnsupportedOperationException(); } } diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/VisitingTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/VisitingTest.java index 7d11ad65a007..f8e9a659a37b 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/VisitingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/VisitingTest.java @@ -140,7 +140,7 @@ public class VisitingTest extends IntegrationTestCase { assertVisitorLog("begin create end finished ", visitor); } - private void assertVisitorLog(final String expected) throws Exception { + private void assertVisitorLog(final String expected) { TestVisitor visitor = new TestVisitor(); assertVisitorLog(expected, visitor); } @@ -159,7 +159,7 @@ public class VisitingTest extends IntegrationTestCase { } @Override - public void end(ChangeSet c) throws StopVisitingException { + public void end(ChangeSet c) { log += "end "; } @@ -169,7 +169,7 @@ public class VisitingTest extends IntegrationTestCase { } @Override - public void visit(RenameChange c) throws StopVisitingException { + public void visit(RenameChange c) { log += "rename "; } diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java index e01a009b6549..5298f7883ae8 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryChangeModelTest.java @@ -29,7 +29,7 @@ import java.util.List; public class DirectoryChangeModelTest extends IntegrationTestCase { - public void testNames() throws IOException { + public void testNames() { VirtualFile f = createDirectory("foo"); rename(f, "bar"); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java index acfe47503925..a9288f816071 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogModelTest.java @@ -28,13 +28,13 @@ import java.util.List; public class DirectoryHistoryDialogModelTest extends LocalHistoryUITestCase { private DirectoryHistoryDialogModel m; - public void testTitle() throws IOException { + public void testTitle() { VirtualFile dir = createDirectory("dir"); initModelFor(dir); assertEquals(FileUtil.toSystemDependentName(dir.getPath()), m.getTitle()); } - public void testNoDifference() throws IOException { + public void testNoDifference() { VirtualFile dir = createDirectory("dir"); getVcs().getChangeListInTests().purgeObsolete(0); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java index b8286c01f3e1..94ac91d45423 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/DirectoryHistoryDialogTest.java @@ -22,11 +22,10 @@ import com.intellij.history.integration.ui.views.DirectoryChange; import com.intellij.history.integration.ui.views.DirectoryHistoryDialog; import com.intellij.openapi.util.Disposer; -import java.io.IOException; import java.util.Collections; public class DirectoryHistoryDialogTest extends LocalHistoryUITestCase { - public void testDialogWorks() throws IOException { + public void testDialogWorks() { DirectoryHistoryDialog d = new DirectoryHistoryDialog(myProject, myGateway, myRoot); Disposer.dispose(d); } diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java index a3fe37d5b97e..1a0fee6afabb 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/FileHistoryDialogTest.java @@ -28,18 +28,17 @@ import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.text.DateFormatUtil; -import java.io.IOException; import java.util.Date; public class FileHistoryDialogTest extends LocalHistoryUITestCase { - public void testDialogWorks() throws IOException { + public void testDialogWorks() { VirtualFile file = createChildData(myRoot, "f.txt"); FileHistoryDialog d = new FileHistoryDialog(myProject, myGateway, file); Disposer.dispose(d); } - public void testTitles() throws IOException { + public void testTitles() { long leftTime = new Date(2001 - 1900, 1, 3, 12, 0).getTime(); long rightTime = new Date(2002 - 1900, 2, 4, 14, 0).getTime(); @@ -61,7 +60,7 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { m.getDifferenceModel().getRightTitle(new NullRevisionsProgress())); } - public void testContent() throws IOException { + public void testContent() { VirtualFile f = createChildData(myRoot, "f.txt"); setBinaryContent(f, "old".getBytes()); setBinaryContent(f, "new".getBytes()); @@ -72,7 +71,7 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { assertDiffContents("old", "new", m); } - public void testContentWhenOnlyOneRevisionSelected() throws IOException { + public void testContentWhenOnlyOneRevisionSelected() { VirtualFile f = createChildData(myRoot, "f.txt"); setBinaryContent(f, "old".getBytes()); setBinaryContent(f, "new".getBytes()); @@ -82,7 +81,7 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { assertDiffContents("old", "new", m); } - public void testContentForCurrentRevision() throws IOException { + public void testContentForCurrentRevision() { VirtualFile f = createChildData(myRoot, "f.txt"); setBinaryContent(f, "old".getBytes()); setBinaryContent(f, "current".getBytes()); @@ -107,7 +106,7 @@ public class FileHistoryDialogTest extends LocalHistoryUITestCase { assertEquals("newDir", dir.getName()); } - private void assertDiffContents(String leftContent, String rightContent, FileHistoryDialogModel m) throws IOException { + private void assertDiffContents(String leftContent, String rightContent, FileHistoryDialogModel m) { DiffContent left = getLeftDiffContent(m); DiffContent right = getRightDiffContent(m); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java index 8b97c3dffcb4..77dd5bcdbc01 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/HistoryDialogModelTest.java @@ -24,7 +24,6 @@ import com.intellij.history.integration.ui.models.RevisionItem; import com.intellij.openapi.vfs.VirtualFile; import org.junit.Test; -import java.io.IOException; import java.util.List; public class HistoryDialogModelTest extends IntegrationTestCase { @@ -61,7 +60,7 @@ public class HistoryDialogModelTest extends IntegrationTestCase { } @Test - public void testDoesNotRecomputeRevisionsEveryTime() throws IOException { + public void testDoesNotRecomputeRevisionsEveryTime() { assertEquals(3, m.getRevisions().size()); setContent(f, "xxx"); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java index 22cb21884493..8d5edf49c025 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/LocalHistoryActionsTest.java @@ -34,8 +34,6 @@ import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; - import static com.intellij.util.containers.UtilKt.stream; public class LocalHistoryActionsTest extends LocalHistoryUITestCase { @@ -68,7 +66,7 @@ public class LocalHistoryActionsTest extends LocalHistoryUITestCase { return EditorFactory.getInstance(); } - public void testShowHistoryAction() throws IOException { + public void testShowHistoryAction() { ShowHistoryAction a = new ShowHistoryAction(); assertStatus(a, myRoot, true); assertStatus(a, f, true); @@ -78,7 +76,7 @@ public class LocalHistoryActionsTest extends LocalHistoryUITestCase { assertStatus(a, createChildData(myRoot, "f.xxx"), false); } - public void testLocalHistoryActionDisabledWithoutProject() throws IOException { + public void testLocalHistoryActionDisabledWithoutProject() { LocalHistoryAction a = new LocalHistoryAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) { @@ -88,12 +86,12 @@ public class LocalHistoryActionsTest extends LocalHistoryUITestCase { assertStatus(a, myRoot, null, false); } - public void testShowHistoryActionIsDisabledForMultipleSelection() throws Exception { + public void testShowHistoryActionIsDisabledForMultipleSelection() { ShowHistoryAction a = new ShowHistoryAction(); assertStatus(a, new VirtualFile[] {f, new TestVirtualFile("ff")}, myProject, false); } - public void testShowSelectionHistoryActionForSelection() throws Exception { + public void testShowSelectionHistoryActionForSelection() { editor.getSelectionModel().setSelection(0, 2); ShowSelectionHistoryAction a = new ShowSelectionHistoryAction(); @@ -105,13 +103,13 @@ public class LocalHistoryActionsTest extends LocalHistoryUITestCase { assertEquals("Show History for Selection", e.getPresentation().getText()); } - public void testShowSelectionHistoryActionIsDisabledForNonFiles() throws IOException { + public void testShowSelectionHistoryActionIsDisabledForNonFiles() { ShowSelectionHistoryAction a = new ShowSelectionHistoryAction(); assertStatus(a, myRoot, false); assertStatus(a, null, false); } - public void testShowSelectionHistoryActionIsDisabledForEmptySelection() throws Exception { + public void testShowSelectionHistoryActionIsDisabledForEmptySelection() { ShowSelectionHistoryAction a = new ShowSelectionHistoryAction(); assertStatus(a, f, false); } diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java index e1bee21de8db..9bea9f9e3a60 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/RecentChangeDialogTest.java @@ -25,7 +25,7 @@ import com.intellij.openapi.util.Disposer; import java.io.IOException; public class RecentChangeDialogTest extends LocalHistoryUITestCase { - public void testDialogWork() throws IOException { + public void testDialogWork() { getVcs().beginChangeSet(); createChildData(myRoot, "f.txt"); getVcs().endChangeSet("change"); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java index d03e0d7accf0..ef265ca51caa 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/SelectionHistoryDialogTest.java @@ -47,12 +47,12 @@ public class SelectionHistoryDialogTest extends LocalHistoryUITestCase { setBinaryContent(f,"a\nbcd\nc\ne\n".getBytes(), -1, 789,this); } - public void testDialogWorks() throws IOException { + public void testDialogWorks() { SelectionHistoryDialog d = new SelectionHistoryDialog(myProject, myGateway, f, 0, 0); Disposer.dispose(d); } - public void testTitles() throws IOException { + public void testTitles() { rename(f, "ff.txt"); setBinaryContent(f,new byte[0]); @@ -84,7 +84,7 @@ public class SelectionHistoryDialogTest extends LocalHistoryUITestCase { verify(p); } - public void testDiffContents() throws IOException { + public void testDiffContents() { initModelOnSecondLineAndSelectRevisions(0, 1); DiffContent left = dm.getLeftDiffContent(new NullRevisionsProgress()); @@ -94,7 +94,7 @@ public class SelectionHistoryDialogTest extends LocalHistoryUITestCase { assertContent("bc", right); } - public void testDiffContentsAndTitleForCurrentRevision() throws IOException { + public void testDiffContentsAndTitleForCurrentRevision() { initModelOnSecondLineAndSelectRevisions(0, 0); assertEquals("Current", dm.getRightTitle(new NullRevisionsProgress())); diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java index 41817a90bac9..7aa4140ea049 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java @@ -23,7 +23,6 @@ import com.intellij.history.core.LocalHistoryTestCase; import com.intellij.history.core.revisions.Revision; import com.intellij.history.core.tree.RootEntry; import com.intellij.history.integration.IdeaGateway; -import com.intellij.util.diff.FilesTooBigForDiffException; import org.jetbrains.annotations.NotNull; import org.junit.Test; @@ -36,7 +35,7 @@ public class SelectionCalculatorTest extends LocalHistoryTestCase { LocalHistoryFacade vcs = new InMemoryLocalHistoryFacade(); @Test - public void testSelectionWasNotChanged() throws FilesTooBigForDiffException { + public void testSelectionWasNotChanged() { List rr = createRevisions("abc\ndef\nghi", "abc1\ndef1\nghi1"); SelectionCalculator c = new SelectionCalculator(gw, rr, 0, 2); @@ -48,7 +47,7 @@ public class SelectionCalculatorTest extends LocalHistoryTestCase { } @Test - public void testSelectionWasMoved() throws FilesTooBigForDiffException { + public void testSelectionWasMoved() { List rr = createRevisions("abc\ndef\nghi", "def\nghi"); SelectionCalculator c = new SelectionCalculator(gw, rr, 0, 1); @@ -60,7 +59,7 @@ public class SelectionCalculatorTest extends LocalHistoryTestCase { } @Test - public void testSelectionForVeryOldRevisionTakenBackward() throws FilesTooBigForDiffException { + public void testSelectionForVeryOldRevisionTakenBackward() { List rr = createRevisions("ghi\nabc\ndef", "abc\nghi\ndef", "abc\ndef\nghi"); SelectionCalculator c = new SelectionCalculator(gw, rr, 0, 1); @@ -74,7 +73,7 @@ public class SelectionCalculatorTest extends LocalHistoryTestCase { } @Test - public void testNormalizingLineEnds() throws FilesTooBigForDiffException { + public void testNormalizingLineEnds() { List rr = createRevisions("abc\ndef\nghi", "abc\r\ndef\r\nghi"); SelectionCalculator c = new SelectionCalculator(gw, rr, 0, 1); @@ -86,7 +85,7 @@ public class SelectionCalculatorTest extends LocalHistoryTestCase { } @Test - public void testProgressOnGetSelection() throws FilesTooBigForDiffException { + public void testProgressOnGetSelection() { List rr = createRevisions("one", "two", "three", "four"); SelectionCalculator c = new SelectionCalculator(gw, rr, 0, 0); @@ -103,7 +102,7 @@ public class SelectionCalculatorTest extends LocalHistoryTestCase { } @Test - public void testProgressOnCanCalculate() throws FilesTooBigForDiffException { + public void testProgressOnCanCalculate() { List rr = createRevisions("one", "two"); SelectionCalculator c = new SelectionCalculator(gw, rr, 0, 0); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/ActivityMonitorTest.java b/platform/platform-tests/testSrc/com/intellij/ide/ActivityMonitorTest.java index a0df57a6cc8c..3dd76c4b395d 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/ActivityMonitorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/ActivityMonitorTest.java @@ -91,7 +91,7 @@ public class ActivityMonitorTest extends LightPlatformTestCase { assertReady(project2); } - public void testReadyWithWatchActivities() throws Exception { + public void testReadyWithWatchActivities() { final UiActivity root = new UiActivity("root"); final UiActivity op1 = new UiActivity("root", "operation1"); @@ -161,7 +161,7 @@ public class ActivityMonitorTest extends LightPlatformTestCase { } } - public void testUiActivity() throws Exception { + public void testUiActivity() { assertTrue(new UiActivity("root", "folder1").isSameOrGeneralFor(new UiActivity("root", "folder1"))); assertTrue(new UiActivity("root", "folder1").isSameOrGeneralFor(new UiActivity("root", "folder1", "folder2"))); assertFalse(new UiActivity("root", "folder2").isSameOrGeneralFor(new UiActivity("root", "folder1", "folder2"))); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java b/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java index fc61670666c3..0f8b1b37d921 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/bookmarks/BookmarkManagerTest.java @@ -51,7 +51,7 @@ public class BookmarkManagerTest extends AbstractEditorTest { super.tearDown(); } - public void testWholeTextReplace() throws IOException { + public void testWholeTextReplace() { @NonNls String text = "public class Test {\n" + " public void test() {\n" + @@ -66,7 +66,7 @@ public class BookmarkManagerTest extends AbstractEditorTest { new WriteCommandAction.Simple(getProject()) { @Override - protected void run() throws Throwable { + protected void run() { myEditor.getDocument().setText(text); } }.execute().throwException(); @@ -79,7 +79,7 @@ public class BookmarkManagerTest extends AbstractEditorTest { } } - public void testBookmarkLineRemove() throws IOException { + public void testBookmarkLineRemove() { List adapters = getProject().getPicoContainer().getComponentAdaptersOfType(ChangeListManagerImpl.class); LOG.debug(adapters.size() + " adapters:"); for (ComponentAdapter adapter : adapters) { @@ -101,7 +101,7 @@ public class BookmarkManagerTest extends AbstractEditorTest { assertTrue(getManager().getValidBookmarks().isEmpty()); } - public void testTwoBookmarksOnSameLine1() throws IOException { + public void testTwoBookmarksOnSameLine1() { @NonNls String text = "public class Test {\n" + " public void test() {\n" + @@ -126,7 +126,7 @@ public class BookmarkManagerTest extends AbstractEditorTest { checkBookmarkNavigation(bookmark); } } - public void testTwoBookmarksOnSameLine2() throws IOException { + public void testTwoBookmarksOnSameLine2() { @NonNls String text = "public class Test {\n" + " public void test() {\n" + @@ -157,7 +157,7 @@ public class BookmarkManagerTest extends AbstractEditorTest { delete(); } - public void testBookmarkIsSavedAfterRemoteChange() throws IOException { + public void testBookmarkIsSavedAfterRemoteChange() { @NonNls String text = "public class Test {\n" + " public void test() {\n" + @@ -169,7 +169,7 @@ public class BookmarkManagerTest extends AbstractEditorTest { new WriteCommandAction.Simple(getProject()) { @Override - protected void run() throws Throwable { + protected void run() { myEditor.getDocument().setText("111\n222" + text + "333"); } }.execute().throwException(); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleConfigurationTest.java b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleConfigurationTest.java index 153213d7d5a7..fce7cb984e29 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleConfigurationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleConfigurationTest.java @@ -32,7 +32,7 @@ public class CodeStyleConfigurationTest extends CodeStyleTestCase { /** * Check that indent options are correcly read if mixed with other language options */ - public void testIndentOptionsRead() throws Exception { + public void testIndentOptionsRead() { org.jdom.Element rootElement = new Element("option"); Element langCodeStyle = new Element("codeStyleSettings"); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleSchemesModelTest.java b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleSchemesModelTest.java index 30a32da42618..81553ad820e7 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleSchemesModelTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/CodeStyleSchemesModelTest.java @@ -56,7 +56,7 @@ public class CodeStyleSchemesModelTest extends CodeStyleTestCase { } } - public void testDefaults() throws Exception { + public void testDefaults() { CodeStyleScheme defaultScheme = myModel.getSelectedScheme(); assertEquals(CodeStyleScheme.DEFAULT_SCHEME_NAME, defaultScheme.getName()); assertEquals(new CodeStyleSettings(), defaultScheme.getCodeStyleSettings()); @@ -64,7 +64,7 @@ public class CodeStyleSchemesModelTest extends CodeStyleTestCase { assertFalse(myModel.isUsePerProjectSettings()); } - public void testCopyToIde() throws Exception { + public void testCopyToIde() { CodeStyleScheme projectScheme = myModel.getProjectScheme(); myModel.selectScheme(projectScheme, null); assertEquals(CodeStyleScheme.PROJECT_SCHEME_NAME, myModel.getSelectedScheme().getName()); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/NewProjectSettingsTest.java b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/NewProjectSettingsTest.java index d2c20cb08749..4ba1d0b8ece2 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/NewProjectSettingsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/NewProjectSettingsTest.java @@ -51,7 +51,7 @@ public class NewProjectSettingsTest extends CodeStyleTestCase { } @Override - protected void setupProject() throws Exception { + protected void setupProject() { Runnable setupRunnable = ourSetupMap.get(getTestName(true)); if (setupRunnable != null) setupRunnable.run(); } @@ -66,7 +66,7 @@ public class NewProjectSettingsTest extends CodeStyleTestCase { manager.setMainProjectCodeStyle(null); } - public void testNonDefaultSettings() throws Exception { + public void testNonDefaultSettings() { CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject()); CodeStyleSettings appSettings = CodeStyleSettingsManager.getInstance().getMainProjectCodeStyle(); assertNotNull(appSettings); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/ProjectCodeStyleMigrationTest.java b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/ProjectCodeStyleMigrationTest.java index cd773b1eabd5..4c0275c75c82 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/ProjectCodeStyleMigrationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/codeStyleSettings/ProjectCodeStyleMigrationTest.java @@ -16,21 +16,16 @@ package com.intellij.ide.codeStyleSettings; import com.intellij.openapi.components.ServiceManager; -import com.intellij.openapi.project.Project; import com.intellij.openapi.util.JDOMUtil; import com.intellij.psi.codeStyle.CodeStyleSettings; import com.intellij.psi.codeStyle.CodeStyleSettingsManager; import com.intellij.psi.codeStyle.LegacyCodeStyleSettingsManager; import com.intellij.psi.codeStyle.ProjectCodeStyleSettingsManager; -import com.intellij.testFramework.LightProjectDescriptor; import org.jdom.Document; import org.jdom.Element; -import org.jdom.JDOMException; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.File; -import java.io.IOException; import static com.intellij.psi.codeStyle.CodeStyleScheme.CODE_STYLE_TAG_NAME; @@ -53,7 +48,7 @@ public class ProjectCodeStyleMigrationTest extends CodeStyleTestCase { } @SuppressWarnings("deprecation") - public void testMigrateDefault() throws IOException { + public void testMigrateDefault() { CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(getProject()); assertInstanceOf(settingsManager, ProjectCodeStyleSettingsManager.class); CodeStyleSettings projectSettings = settingsManager.getCurrentSettings(); @@ -65,7 +60,7 @@ public class ProjectCodeStyleMigrationTest extends CodeStyleTestCase { } @SuppressWarnings("deprecation") - public void testMigrateChanged() throws IOException { + public void testMigrateChanged() { CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(getProject()); assertInstanceOf(settingsManager, ProjectCodeStyleSettingsManager.class); CodeStyleSettings projectSettings = settingsManager.getCurrentSettings(); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java b/platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java index 9789fe0a779d..ab42b5623a0a 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java @@ -43,7 +43,7 @@ public class LightFileTemplatesTest extends LightPlatformTestCase { private static final String TEST_TEMPLATE_TXT = "testTemplate.txt"; private static final String HI_THERE = "hi there"; - public void testSchemas() throws Exception { + public void testSchemas() { assertEquals(FileTemplatesScheme.DEFAULT, myTemplateManager.getCurrentScheme()); FileTemplate template = myTemplateManager.getTemplate(TEST_TEMPLATE_TXT); @@ -59,12 +59,12 @@ public class LightFileTemplatesTest extends LightPlatformTestCase { assertEquals(newText, myTemplateManager.getTemplate(TEST_TEMPLATE_TXT).getText()); } - public void testDefaultProject() throws Exception { + public void testDefaultProject() { Project defaultProject = ProjectManager.getInstance().getDefaultProject(); assertNull(FileTemplateManager.getInstance(defaultProject).getProjectScheme()); } - public void testConfigurable() throws Exception { + public void testConfigurable() { AllFileTemplatesConfigurable configurable = new AllFileTemplatesConfigurable(getProject()); try { configurable.createComponent(); @@ -75,7 +75,7 @@ public class LightFileTemplatesTest extends LightPlatformTestCase { } } - public void testSaveFileAsTemplate() throws Exception { + public void testSaveFileAsTemplate() { AllFileTemplatesConfigurable configurable = new AllFileTemplatesConfigurable(getProject()); try { configurable.createComponent(); @@ -190,7 +190,7 @@ public class LightFileTemplatesTest extends LightPlatformTestCase { } } - public void testRemoveTemplate() throws Exception { + public void testRemoveTemplate() { FileTemplate[] before = myTemplateManager.getAllTemplates(); try { FileTemplate template = myTemplateManager.getTemplate(TEST_TEMPLATE_TXT); @@ -208,7 +208,7 @@ public class LightFileTemplatesTest extends LightPlatformTestCase { } } - public void testSaveReformatCode() throws Exception { + public void testSaveReformatCode() { FileTemplate template = myTemplateManager.getTemplate(TEST_TEMPLATE_TXT); assertTrue(template.isReformatCode()); template.setReformatCode(false); @@ -221,7 +221,7 @@ public class LightFileTemplatesTest extends LightPlatformTestCase { .writeElement(element)); } - public void testDoNotSaveDefaults() throws Exception { + public void testDoNotSaveDefaults() { assertFalse(((FileTemplateBase)myTemplateManager.getTemplate(TEST_TEMPLATE_TXT)).isLiveTemplateEnabledByDefault()); FileTemplateBase template = (FileTemplateBase)myTemplateManager.getTemplate("templateWithLiveTemplate.txt"); assertTrue(template.isLiveTemplateEnabledByDefault()); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/packageSets/PatternRegexpConvertorTest.java b/platform/platform-tests/testSrc/com/intellij/ide/packageSets/PatternRegexpConvertorTest.java index e29a1fe44bbc..a7dcba3cc8c9 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/packageSets/PatternRegexpConvertorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/packageSets/PatternRegexpConvertorTest.java @@ -8,7 +8,7 @@ import com.intellij.psi.search.scope.packageSet.FilePatternPackageSet; import junit.framework.TestCase; public class PatternRegexpConvertorTest extends TestCase { - public void testConvertToRegexp() throws Exception { + public void testConvertToRegexp() { assertEquals("a\\.[^\\.]*", FilePatternPackageSet.convertToRegexp("a.*", '.')); assertEquals("a\\.(.*\\.)?[^\\.]*", FilePatternPackageSet.convertToRegexp("a..*", '.')); assertEquals("a\\/[^\\/]*", FilePatternPackageSet.convertToRegexp("a/*", '/')); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java b/platform/platform-tests/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java index c48fae6e2261..baa4cdae6d56 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/plugins/PluginDescriptorTest.java @@ -20,7 +20,6 @@ import com.intellij.util.lang.UrlClassLoader; import org.junit.Test; import java.io.File; -import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; @@ -98,7 +97,7 @@ public class PluginDescriptorTest { } @Override - public Enumeration getResources(String name) throws IOException { + public Enumeration getResources(String name) { return new SingleUrlEnumeration(myUrl); } } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/search/PorterStemmerTest.java b/platform/platform-tests/testSrc/com/intellij/ide/search/PorterStemmerTest.java index 82d0c0b30986..ec799cd07252 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/search/PorterStemmerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/search/PorterStemmerTest.java @@ -8,7 +8,7 @@ import com.intellij.ide.ui.search.PorterStemmerUtil; import junit.framework.TestCase; public class PorterStemmerTest extends TestCase { - public void test() throws Exception { + public void test() { assertEquals("name", PorterStemmerUtil.stem("names")); assertEquals("j2ee", PorterStemmerUtil.stem("j2ee")); assertEquals("keyword1", PorterStemmerUtil.stem("keyword1")); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/severities/HighlightSeveritiesTest.java b/platform/platform-tests/testSrc/com/intellij/ide/severities/HighlightSeveritiesTest.java index d73c017f72fc..9bae81b6c935 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/severities/HighlightSeveritiesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/severities/HighlightSeveritiesTest.java @@ -21,7 +21,7 @@ import junit.framework.TestCase; import org.jdom.Element; public class HighlightSeveritiesTest extends TestCase { - public void testSeveritiesMigration() throws Exception{ + public void testSeveritiesMigration() { final Element element = new Element("temp"); new HighlightSeverity(HighlightSeverity.ERROR.myName, 500).writeExternal(element); HighlightSeverity newSeverity = new HighlightSeverity(element); diff --git a/platform/platform-tests/testSrc/com/intellij/ide/ui/TopHitProvidersTest.java b/platform/platform-tests/testSrc/com/intellij/ide/ui/TopHitProvidersTest.java index c16e9f580319..9809807e8798 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/ui/TopHitProvidersTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/ui/TopHitProvidersTest.java @@ -28,7 +28,7 @@ import java.util.stream.Collectors; * @author Konstantin Bulenkov */ public class TopHitProvidersTest extends PlatformTestCase { - public void testUiSettings() throws Exception { + public void testUiSettings() { List providers = getProvider(AppearanceOptionsTopHitProvider.ID); for (OptionsTopHitProvider provider: providers) { for (OptionDescription option : provider.getOptions(null)) { diff --git a/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java index 947fb566cb7e..1b98f6ce6ca2 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java @@ -121,12 +121,12 @@ abstract class BaseTreeTestCase extends FlyIdeaTestCase { Assert.assertTrue(success); } - void expand(final TreePath p) throws Exception { + void expand(final TreePath p) { invokeAndWaitIfNeeded(() -> myTree.expandPath(p)); waitBuilderToCome(); } - void collapsePath(final TreePath p) throws Exception { + void collapsePath(final TreePath p) { invokeAndWaitIfNeeded(() -> myTree.collapsePath(p)); waitBuilderToCome(); } @@ -344,7 +344,7 @@ abstract class BaseTreeTestCase extends FlyIdeaTestCase { super.tearDown(); } - void assertTree(final String expected) throws Exception { + void assertTree(final String expected) { waitBuilderToCome(); assertTreeNow(expected); } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java index 28018f98d08b..4c9cfa2744a2 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/FilteringTreeBuilderTest.java @@ -166,11 +166,11 @@ public class FilteringTreeBuilderTest extends BaseTreeTestCase { select(new Object[] {node}, false); } - private void updateFilter(final String text) throws Exception { + private void updateFilter(final String text) { update(text, null); } - private void update(final String text, @Nullable final Object selection) throws Exception { + private void update(final String text, @Nullable final Object selection) { myFilter.update(text, selection); } diff --git a/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java index e6f7cd40ca0c..6fa65d7f1bd5 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java @@ -31,7 +31,6 @@ import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath; -import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -1373,7 +1372,7 @@ public class TreeUiTest extends AbstractTreeBuilderTest { final int start, final int end, @Nullable final Runnable eachRunnable, - @Nullable final Runnable endRunnable) throws InvocationTargetException, InterruptedException { + @Nullable final Runnable endRunnable) { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { for (int i = start; i <= end; i++) { Node eachFile = node.addChild("File " + i); @@ -1399,7 +1398,7 @@ public class TreeUiTest extends AbstractTreeBuilderTest { private void runAndInterrupt(final Runnable action, final String interruptAction, final Object interruptElement, - final Interruption interruption) throws Exception { + final Interruption interruption) { myElementUpdate.clear(); final boolean[] wasInterrupted = new boolean[]{false}; @@ -2390,47 +2389,47 @@ public class TreeUiTest extends AbstractTreeBuilderTest { } @Override - public void testSelectionGoesToParentWhenOnlyChildMoved2() throws Exception { + public void testSelectionGoesToParentWhenOnlyChildMoved2() { //todo } @Override - public void testQueryStructureWhenExpand() throws Exception { + public void testQueryStructureWhenExpand() { //todo } @Override - public void testMoveElementToAdjacentEmptyParentWithSmartExpandAndSerialUpdateSubtrees() throws Exception { + public void testMoveElementToAdjacentEmptyParentWithSmartExpandAndSerialUpdateSubtrees() { // doesn't make sense since pass-through mode is always serial, it doesn't queue for updates } @Override - public void testElementMove1() throws Exception { + public void testElementMove1() { //todo } @Override - public void testClear() throws Exception { + public void testClear() { //todo } @Override - public void testDoubleCancelUpdate() throws Exception { + public void testDoubleCancelUpdate() { // doesn't make sense in pass-through mode } @Override - public void testNoExtraJTreeModelUpdate() throws Exception { + public void testNoExtraJTreeModelUpdate() { // doesn't make sense in pass-through mode } @Override - public void testSelectWhenUpdatesArePending() throws Exception { + public void testSelectWhenUpdatesArePending() { // doesn't make sense in pass-through mode } @Override - public void testBigTreeUpdate() throws Exception { + public void testBigTreeUpdate() { // doesn't make sense in pass-through mode } } @@ -2459,12 +2458,12 @@ public class TreeUiTest extends AbstractTreeBuilderTest { } @Override - public void testNoInfiniteSmartExpand() throws Exception { + public void testNoInfiniteSmartExpand() { //todo } @Override - public void testBigTreeUpdate() throws Exception { + public void testBigTreeUpdate() { //to slow, tested the same in VeryQuickBgLoadingTest } } @@ -2480,12 +2479,12 @@ public class TreeUiTest extends AbstractTreeBuilderTest { } @Override - public void testNoInfiniteSmartExpand() throws Exception { + public void testNoInfiniteSmartExpand() { //todo } @Override - public void testBigTreeUpdate() throws Exception { + public void testBigTreeUpdate() { //to slow, tested the same in VeryQuickBgLoadingTest } } @@ -2497,17 +2496,17 @@ public class TreeUiTest extends AbstractTreeBuilderTest { } @Override - public void testNoInfiniteSmartExpand() throws Exception { + public void testNoInfiniteSmartExpand() { // todo; } @Override - public void testReleaseBuilderDuringUpdate() throws Exception { + public void testReleaseBuilderDuringUpdate() { // todo } @Override - public void testReleaseBuilderDuringGetChildren() throws Exception { + public void testReleaseBuilderDuringGetChildren() { // todo } } diff --git a/platform/platform-tests/testSrc/com/intellij/module/ModulePointerTest.java b/platform/platform-tests/testSrc/com/intellij/module/ModulePointerTest.java index 4455819f8702..4fed5987b347 100644 --- a/platform/platform-tests/testSrc/com/intellij/module/ModulePointerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/module/ModulePointerTest.java @@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author nik */ public class ModulePointerTest extends PlatformTestCase { - public void testCreateByName() throws Exception { + public void testCreateByName() { final ModulePointer pointer = getPointerManager().create("m"); assertSame(pointer, getPointerManager().create("m")); assertNull(pointer.getModule()); @@ -41,7 +41,7 @@ public class ModulePointerTest extends PlatformTestCase { assertEquals("m", pointer.getModuleName()); } - public void testCreateByModule() throws Exception { + public void testCreateByModule() { final Module module = addModule("x"); final ModulePointer pointer = getPointerManager().create(module); assertSame(pointer, getPointerManager().create(module)); @@ -70,7 +70,7 @@ public class ModulePointerTest extends PlatformTestCase { assertEquals("xyz", pointer.getModuleName()); } - public void testDisposePointerFromUncommittedModifiableModel() throws Exception { + public void testDisposePointerFromUncommittedModifiableModel() { ModulePointerManager pointerManager = getPointerManager(); final ModulePointer pointer = pointerManager.create("xxx"); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/ApplicationImplTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/ApplicationImplTest.java index d07d2fc827da..202dbb26ae91 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/ApplicationImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/ApplicationImplTest.java @@ -117,14 +117,14 @@ public class ApplicationImplTest extends LightPlatformTestCase { } - public void testRead50Write50LockPerformance() throws InterruptedException { + public void testRead50Write50LockPerformance() { final int readIterations = 600000; final int writeIterations = 600000; runReadWrites(readIterations, writeIterations, 2000); } - public void testRead100Write0LockPerformance() throws InterruptedException { + public void testRead100Write0LockPerformance() { final int readIterations = 60000000; final int writeIterations = 0; @@ -504,7 +504,7 @@ public class ApplicationImplTest extends LightPlatformTestCase { if (exception != null) throw exception; } - public void testRWLockPerformance() throws InterruptedException { + public void testRWLockPerformance() { long s = System.currentTimeMillis(); while (System.currentTimeMillis() < s + 2000) { UIUtil.dispatchAllInvocationEvents(); @@ -556,7 +556,7 @@ public class ApplicationImplTest extends LightPlatformTestCase { UIUtil.dispatchAllInvocationEvents(); } - public void testSuspendWriteActionDelaysForeignReadActions() throws Exception { + public void testSuspendWriteActionDelaysForeignReadActions() { Semaphore mayStartForeignRead = new Semaphore(); mayStartForeignRead.down(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java index 43dcdf8e0e8f..8b6ef4a4a574 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java @@ -31,7 +31,6 @@ import junit.framework.TestCase; import javax.swing.*; import java.awt.*; -import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -148,7 +147,7 @@ public class LaterInvocatorTest extends PlatformTestCase { if (exception[0] != null) throw exception[0]; } - public void testReorder() throws InterruptedException, InvocationTargetException { + public void testReorder() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { LaterInvocator.enterModal(myWindow1); synchronized (this) { @@ -164,7 +163,7 @@ public class LaterInvocatorTest extends PlatformTestCase { }); } - public void testTrueReorder() throws InvocationTargetException, InterruptedException { + public void testTrueReorder() { SwingUtilities.invokeLater(() -> { LaterInvocator.enterModal(myWindow1); ApplicationManager.getApplication().invokeLater(new MyRunnable("1"), ModalityState.NON_MODAL); @@ -178,7 +177,7 @@ public class LaterInvocatorTest extends PlatformTestCase { checkOrder(2); } - public void testEverInvoked() throws InvocationTargetException, InterruptedException { + public void testEverInvoked() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { LaterInvocator.enterModal(myWindow1); ApplicationManager.getApplication().invokeLater(ENTER_MODAL, ModalityState.NON_MODAL); @@ -194,7 +193,7 @@ public class LaterInvocatorTest extends PlatformTestCase { }); } - public void testDoesNotInvokeWhenModal() throws InvocationTargetException, InterruptedException { + public void testDoesNotInvokeWhenModal() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { LaterInvocator.enterModal(myWindow1); @@ -209,7 +208,7 @@ public class LaterInvocatorTest extends PlatformTestCase { }); } - public void testStress() throws Exception { + public void testStress() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { int N = 1000; //long start = System.currentTimeMillis(); @@ -274,7 +273,7 @@ public class LaterInvocatorTest extends PlatformTestCase { } - public void testOrderWithSwingInvokeLater2() throws InterruptedException, InvocationTargetException { + public void testOrderWithSwingInvokeLater2() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { LaterInvocator.enterModal(myWindow1); synchronized (this) { @@ -289,7 +288,7 @@ public class LaterInvocatorTest extends PlatformTestCase { }); } - public void testOrderWithSwingInvokeLater3() throws InterruptedException, InvocationTargetException { + public void testOrderWithSwingInvokeLater3() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { LaterInvocator.enterModal(myWindow1); synchronized (this) { @@ -304,7 +303,7 @@ public class LaterInvocatorTest extends PlatformTestCase { }); } - public void testExpired() throws Exception { + public void testExpired() { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { @@ -333,7 +332,7 @@ public class LaterInvocatorTest extends PlatformTestCase { }); } - public void testOrderWithSwingInvokeLater4() throws InterruptedException, InvocationTargetException { + public void testOrderWithSwingInvokeLater4() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { SwingUtilities.invokeLater(ENTER_MODAL); flushSwingQueue(); @@ -356,7 +355,7 @@ public class LaterInvocatorTest extends PlatformTestCase { }); } - public void testDeadLock() throws InvocationTargetException, InterruptedException { + public void testDeadLock() throws InterruptedException { final Object lock = new Object(); final boolean[] started = { false }; final Thread thread = new Thread("later invokator test") { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/components/impl/PathMacroManagerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/components/impl/PathMacroManagerTest.java index dd55dcfec027..83ba980cbc04 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/components/impl/PathMacroManagerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/components/impl/PathMacroManagerTest.java @@ -65,7 +65,7 @@ public class PathMacroManagerTest { private Disposable myRootDisposable = Disposer.newDisposable(); @Before - public final void setupApplication() throws Exception { + public final void setupApplication() { context = new JUnit4Mockery(); context.setImposteriser(ClassImposteriser.INSTANCE); myApplication = context.mock(ApplicationEx.class, "application"); @@ -87,7 +87,7 @@ public class PathMacroManagerTest { @Override @Nullable - public Object invoke(final Invocation invocation) throws Throwable { + public Object invoke(final Invocation invocation) { ((Runnable)invocation.getParameter(0)).run(); return null; } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/diff/SimpleContentTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/SimpleContentTest.java index 2cc232d94534..f71abc44b524 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/diff/SimpleContentTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/diff/SimpleContentTest.java @@ -18,11 +18,10 @@ package com.intellij.openapi.diff; import com.intellij.openapi.editor.Document; import com.intellij.testFramework.PlatformTestCase; -import java.io.IOException; import java.util.Arrays; public class SimpleContentTest extends PlatformTestCase { - public void testEqualsAndDifferent() throws IOException { + public void testEqualsAndDifferent() { SimpleContent content1 = new SimpleContent("a\nb"); SimpleContent content2 = new SimpleContent("a\nb"); assertTrue(Arrays.equals(content1.getBytes(), content2.getBytes())); @@ -45,7 +44,7 @@ public class SimpleContentTest extends PlatformTestCase { assertTrue(Arrays.equals("a\nb\r\nc".getBytes(), content.getBytes())); } - public void testModifyContent() throws IOException { + public void testModifyContent() { SimpleContent content = new SimpleContent("abc\r\ndef"); content.setReadOnly(false); String originalText = content.getText(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeFuncTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeFuncTest.java index 9393daeef1cc..014d7a7a0298 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeFuncTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeFuncTest.java @@ -32,7 +32,6 @@ import com.intellij.openapi.fileEditor.TextEditor; import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider; import com.intellij.testFramework.PlatformTestCase; import com.intellij.util.Assertion; -import com.intellij.util.diff.FilesTooBigForDiffException; import org.jetbrains.annotations.NotNull; public class MergeFuncTest extends PlatformTestCase { @@ -47,7 +46,7 @@ public class MergeFuncTest extends PlatformTestCase { private final Assertion CHECK = new Assertion(); private ChangeCounter myCounters; - public void testNoConflicts() throws FilesTooBigForDiffException { + public void testNoConflicts() { useDocuments("a\nIns1\nb\nccc", "a\nb\nccc", "a\nb\ndddd"); @@ -84,7 +83,7 @@ public class MergeFuncTest extends PlatformTestCase { assertEquals(conflicts, myCounters.getConflictCounter()); } - public void testConflictingChange() throws FilesTooBigForDiffException { + public void testConflictingChange() { useDocuments("1\n2\n3\nX\na\nb\nc\nY\nVer1\nVer12\nZ", "X\na\nb\nc\nY\n" + "Ver12\nVer23\nZ", "X\n" + "Y\n" + "Ver23\nVer3\nZ"); @@ -106,7 +105,7 @@ public class MergeFuncTest extends PlatformTestCase { checkCounters(0, 2); } - public void testApplyMergeThenUndo() throws FilesTooBigForDiffException { + public void testApplyMergeThenUndo() { String baseText = "X\n1\n2\n3\nY"; useDocuments("X\nb\nY", baseText, "X\na\nY"); initMerge(); @@ -137,7 +136,7 @@ public class MergeFuncTest extends PlatformTestCase { assertEquals(0, getBaseIntervals().length); } - public void testApplyModifiedDeletedConflict() throws FilesTooBigForDiffException { + public void testApplyModifiedDeletedConflict() { String baseText = "X\n1\n2\n3\nY"; useDocuments("X\nY", baseText, "X\na\nY"); initMerge(); @@ -164,7 +163,7 @@ public class MergeFuncTest extends PlatformTestCase { assertEquals(0, getBaseIntervals().length); } - public void testInvalidatingChange() throws FilesTooBigForDiffException { + public void testInvalidatingChange() { useDocuments("X\n1\n2\nY", "X\n1\nIns\n2\nY", "X\n1\n2\nY"); initMerge(); MergeTestUtils.Range[] sideConflict = {MergeTestUtils.del(4, 0)}; @@ -180,7 +179,7 @@ public class MergeFuncTest extends PlatformTestCase { assertEquals(0, getBaseIntervals().length); } - public void testApplySeveralActions() throws FilesTooBigForDiffException { + public void testApplySeveralActions() { useDocuments("X\n1\nY\n2\nZ\n3\n4\nU\nW\n", "X\na\nY\nb\nZ\nc\nU\nd\nW\n", "X\na\nY\nB\nZ\nC\nU\nD\nW\n"); @@ -198,7 +197,7 @@ public class MergeFuncTest extends PlatformTestCase { MergeTestUtils.checkMarkup(myERight, new MergeTestUtils.Range[0]); } - public void testIgnoreChangeAction() throws FilesTooBigForDiffException { + public void testIgnoreChangeAction() { useDocuments("X\n1\nY\n2\nZ", "X\na\nY\nb\nZ", "X\na\nY\nB\nZ"); initMerge(); pressIgnoreActionIcon(myELeft, 0); @@ -213,7 +212,7 @@ public class MergeFuncTest extends PlatformTestCase { MergeTestUtils.checkMarkup(myERight, new MergeTestUtils.Range[0]); } - public void testLongBase() throws FilesTooBigForDiffException { + public void testLongBase() { useDocuments("X\n1\n2\n3\nZ", "X\n1\nb\n3\nd\ne\nf\nZ", "X\na\nb\nc\nZ"); initMerge(); MergeTestUtils.checkMarkup(myELeft, new MergeTestUtils.Range[]{MergeTestUtils.conf(2, 6)}); @@ -221,7 +220,7 @@ public class MergeFuncTest extends PlatformTestCase { MergeTestUtils.checkMarkup(myERight, new MergeTestUtils.Range[]{MergeTestUtils.conf(2, 6)}); } - public void testReplaceBaseWithBranch() throws FilesTooBigForDiffException { + public void testReplaceBaseWithBranch() { String leftVersion = "a\nX\nb\nc"; useDocuments(leftVersion, "A\nX\nB\nc", "1\nX\n1\nc"); initMerge(); @@ -233,7 +232,7 @@ public class MergeFuncTest extends PlatformTestCase { MergeTestUtils.checkMarkup(myERight, new MergeTestUtils.Range[0]); } - public void testError1() throws FilesTooBigForDiffException { + public void testError1() { useDocuments("start\n" + "change\n" + " a\n" + @@ -248,7 +247,7 @@ public class MergeFuncTest extends PlatformTestCase { initMerge(); } - public void testError2() throws FilesTooBigForDiffException { + public void testError2() { useDocuments("C\nX", "C\n", "C\n"); initMerge(); MergeTestUtils.checkMarkup(myERight, new MergeTestUtils.Range[0]); @@ -256,7 +255,7 @@ public class MergeFuncTest extends PlatformTestCase { MergeTestUtils.checkMarkup(myELeft, new MergeTestUtils.Range[]{MergeTestUtils.ins(2, 1)}); } - public void testError3() throws FilesTooBigForDiffException { + public void testError3() { useDocuments("original\nlocal\nlocal\nlocal\noriginal\n", "original\noriginal\noriginal\noriginal\noriginal\n", "original\nremote\nremote\nremote\noriginal\n"); @@ -298,7 +297,7 @@ public class MergeFuncTest extends PlatformTestCase { myRight = MergeTestUtils.createRODocument(right); } - private void initMerge() throws FilesTooBigForDiffException { + private void initMerge() { myMergeList = MergeList.create(myProject, myLeft, myBase, myRight); Editor[] editors = myUtils.createEditors(new Document[]{myLeft, myBase, myRight}); myELeft = editors[0]; @@ -362,7 +361,7 @@ public class MergeFuncTest extends PlatformTestCase { } @Override - protected void invokeTestRunnable(@NotNull Runnable runnable) throws Exception { + protected void invokeTestRunnable(@NotNull Runnable runnable) { runnable.run(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeTestUtils.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeTestUtils.java index da3159be76e2..3fc42348d5d1 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeTestUtils.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/incrementalMerge/MergeTestUtils.java @@ -139,7 +139,7 @@ public class MergeTestUtils { return new Range(DiffColors.DIFF_INSERTED.getExternalName(), createRange(start, length)); } - protected void tearDown() throws Exception { + protected void tearDown() { EditorFactory editorFactory = EditorFactory.getInstance(); for (Editor editor : myEditorsToDispose) { editorFactory.releaseEditor(editor); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/mergeTool/MergeDataTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/mergeTool/MergeDataTest.java index 41389e0660c7..deeb119ae800 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/mergeTool/MergeDataTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/mergeTool/MergeDataTest.java @@ -23,12 +23,10 @@ import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.TempFiles; -import java.io.IOException; - public class MergeDataTest extends BaseDiffTestCase { private TempFiles myTempFiles; - public void testWorkingDocument() throws IOException { + public void testWorkingDocument() { VirtualFile file = myTempFiles.createVFile("merge", ".txt"); assertNotNull(file); assertEquals("txt", file.getExtension()); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/patch/GenericApplyPatchTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/patch/GenericApplyPatchTest.java index cf5fba821d90..25a6f36d96e8 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/patch/GenericApplyPatchTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/diff/impl/patch/GenericApplyPatchTest.java @@ -26,7 +26,7 @@ import org.junit.Assert; import java.util.*; public class GenericApplyPatchTest extends PlatformTestCase { - public void testSeveralSteps() throws Exception { + public void testSeveralSteps() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -49,7 +49,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\n2\n5\n6\n9\n10\n11\naaa", after); } - public void testExchangedParts() throws Exception { + public void testExchangedParts() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.REMOVE, "2")); @@ -74,7 +74,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("5\n6a\n7a\n8\n1\n2a\n3a\n4\n9\nextra line", after); } - public void testDeleteAlmostOk() throws Exception { + public void testDeleteAlmostOk() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -96,7 +96,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\nfjsfsd\nqwhduhqwude\n\n2\n9\n8\n11\naaa", after); } - public void testInsertAlmostOk() throws Exception { + public void testInsertAlmostOk() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -118,7 +118,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\nfjsfsd\nqwhduhqwude\n\n2\n3\n4\n5\n9\n8\n11\naaa", after); } - public void testInsertAlmostOkAlreadyApplied() throws Exception { + public void testInsertAlmostOkAlreadyApplied() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -140,7 +140,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\nfjsfsd\nqwhduhqwude\n\n2\n3\n4\n5\n9\n8\n11\naaa", after); } - public void testChangeAlmostOk() throws Exception { + public void testChangeAlmostOk() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -164,7 +164,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\nfjsfsd\nqwhduhqwude\n\n2\na\nb\n9\n8\n11\naaa", after); } - public void testChangeAlmostOkAlreadyApplied() throws Exception { + public void testChangeAlmostOkAlreadyApplied() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -189,7 +189,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\nfjsfsd\nqwhduhqwude\n\n2\na\nb\nc\n9\n8\n11\naaa", after); } - public void testChangeAlmostOkManySteps() throws Exception { + public void testChangeAlmostOkManySteps() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -224,7 +224,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\nfjsfsd\nqwhduhqwude\n\n2\n-1\n4\n9\n8\n11\naaa\n2\n-1a\n-2a\n-3a\n-3b\n-4a\n-4b\n", after); } - public void testFirstNewLine() throws Exception { + public void testFirstNewLine() { final PatchHunk patchHunk = new PatchHunk(1, 2, 1, 3); patchHunk.addLine(new PatchLine(PatchLine.Type.ADD, "")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); @@ -239,7 +239,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("\n1\n2\n", after); } - public void testNewEmptyLine() throws Exception { + public void testNewEmptyLine() { final PatchHunk patchHunk = new PatchHunk(1, 3, 1, 4); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "0")); patchHunk.addLine(new PatchLine(PatchLine.Type.ADD, "")); @@ -255,7 +255,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\n\n1\n2\n", after); } - public void testInsertionsIntoTransformationsCoinsidence() throws Exception { + public void testInsertionsIntoTransformationsCoinsidence() { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < 20; i++) { sb.append(String.valueOf(i + 1)).append('\n'); @@ -269,7 +269,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals(ApplyPatchStatus.ALREADY_APPLIED, gap.getStatus()); } - public void testInsertionsIntoTransformationsInsert() throws Exception { + public void testInsertionsIntoTransformationsInsert() { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < 20; i++) { sb.append(String.valueOf(i + 1)).append('\n'); @@ -291,7 +291,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertTrue("ins".equals(list.get(1))); } - public void testInsertionsIntoTransformationsInsert0() throws Exception { + public void testInsertionsIntoTransformationsInsert0() { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < 20; i++) { sb.append(String.valueOf(i + 1)).append('\n'); @@ -313,7 +313,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertTrue("5".equals(list.get(1))); } - public void testInsertionsIntoTransformationsInsert1() throws Exception { + public void testInsertionsIntoTransformationsInsert1() { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < 20; i++) { sb.append(String.valueOf(i + 1)).append('\n'); @@ -335,7 +335,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertTrue("ins".equals(list.get(1))); } - public void testInsertionsIntoTransformationsDeletion() throws Exception { + public void testInsertionsIntoTransformationsDeletion() { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < 20; i++) { sb.append(String.valueOf(i + 1)).append('\n'); @@ -355,7 +355,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertTrue(list.size() == 0); } - public void testInsertionsIntoTransformationsDeletion1() throws Exception { + public void testInsertionsIntoTransformationsDeletion1() { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < 20; i++) { sb.append(String.valueOf(i + 1)).append('\n'); @@ -375,7 +375,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertTrue(list.size() == 0); } - public void testInsertionsIntoTransformationsDeletion0() throws Exception { + public void testInsertionsIntoTransformationsDeletion0() { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < 20; i++) { sb.append(String.valueOf(i + 1)).append('\n'); @@ -395,7 +395,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertTrue(list.size() == 0); } - public void testBetterContextMatch() throws Exception { + public void testBetterContextMatch() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -417,7 +417,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\n0\n0\n3\n4\n5\n\n\n5454\n5345\n2\na\nb\n543543", after); } - public void testBetterContextMatch1() throws Exception { + public void testBetterContextMatch1() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -439,7 +439,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\n0\n0\n3\n4\n5\n\n\n5454\n5345\na\nb\n11\n543543", after); } - public void testBetterContextMatch2() throws Exception { + public void testBetterContextMatch2() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -461,7 +461,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\n0\n0\n2\n3\n4\n5\n\n\n5454\n5345\n2\na\nb\n11\n543543", after); } - public void testFromSecondLineManySteps() throws Exception { + public void testFromSecondLineManySteps() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -496,7 +496,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\nfjsfsd\nqwhduhqwude\n\n2\n-1\n4\n9\n8\n11\naaa\n2\n-1a\n-2a\n-3a\n-3b\n-4a\n-4b\n", after); } - public void testFromSecondLineManySteps0() throws Exception { + public void testFromSecondLineManySteps0() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -534,7 +534,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("0\nmmm\nfjsfsd\nqwhduhqwude\n\n2\n-1\n-1*\n4\n9\n8\n11\naaa\n2\n-1a\n-1a*\n-2a\n-3a\n-3b\n-4a\n-4b\n", after); } - public void testMoreInsertParts() throws Exception { + public void testMoreInsertParts() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1c")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2c")); @@ -556,7 +556,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("sdsad\nsdsad\n1c\n2c\n3c\n2r\n3a\n3c\n2r\n8\n9\n10\n", after); } - public void testMoreDeletionParts() throws Exception { + public void testMoreDeletionParts() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1c")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2c")); @@ -578,7 +578,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("sdsad\nsdsad\n1c\n2c\n3c\n2r\n8\n9\n10\n", after); } - public void testDoesNotMatchInTheEnd() throws Exception { + public void testDoesNotMatchInTheEnd() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -606,7 +606,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { // actually didn't catch the previous version // nevertheless, should also pass - public void testDoesNotMatchAtStart() throws Exception { + public void testDoesNotMatchAtStart() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -632,7 +632,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("5\n6\n0\nmmm\n2\n4\n7\n8\n11\naaa", after); } - public void testOneLineInsertion() throws Exception { + public void testOneLineInsertion() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); final PatchLine line = new PatchLine(PatchLine.Type.ADD, "5"); line.setSuppressNewLine(true); @@ -648,7 +648,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("5\n", after); } - public void testOneLineBadInsertion() throws Exception { + public void testOneLineBadInsertion() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); final PatchLine line = new PatchLine(PatchLine.Type.ADD, "5"); line.setSuppressNewLine(true); @@ -665,7 +665,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("5\n7\n8\n5\n", after); } - public void testConflict1() throws Exception { + public void testConflict1() { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); @@ -686,7 +686,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { Assert.assertEquals("1\n2\n5\n3=*7\n11\n12", after); } - public void testAddAsFirst() throws Exception { + public void testAddAsFirst() { int[] beforeOfsetExpected = {1, 1}; int[] afterOfsetExpected = {1, 2}; final PatchHunk patchHunk = new PatchHunk(1, 4, 1, 5); @@ -705,7 +705,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { } } - public void testOffsets() throws Exception { + public void testOffsets() { final PatchHunk patchHunk1 = new PatchHunk(1, 2, 1, 1); patchHunk1.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk1.addLine(new PatchLine(PatchLine.Type.REMOVE, "2")); @@ -744,7 +744,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { } - public void testAlreadyApplied() throws Exception { + public void testAlreadyApplied() { int[] beforeAppliedExpected = {2, 5, 6, 8}; int[] endAppliedExpected = {4, 5, 7, 10}; @@ -781,7 +781,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { checkAppliedPositions(beforeAppliedExpected2, endAppliedExpected2, HunkStatus.ALREADY_APPLIED, appliedInfo); } - public void testExactlyApplied() throws Exception { + public void testExactlyApplied() { int[] beforeAppliedExpected = {5, 8, 10, 12}; int[] afterAppliedExpected = {7, 9, 11, 12}; final PatchHunk patchHunk = new PatchHunk(2, 12, 2, 12); @@ -807,7 +807,7 @@ public class GenericApplyPatchTest extends PlatformTestCase { checkAppliedPositions(beforeAppliedExpected, afterAppliedExpected, HunkStatus.EXACTLY_APPLIED, gap.getAppliedInfo()); } - public void testMatchBeforeStartOffset() throws Exception { + public void testMatchBeforeStartOffset() { final PatchHunk patchHunk = new PatchHunk(2, 9, 2, 12); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "c2")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "c2")); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/DocumentTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/DocumentTest.java index ce6b1bd496f0..4bdeb7ce74a4 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/DocumentTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/DocumentTest.java @@ -25,10 +25,10 @@ import com.intellij.testFramework.LightPlatformTestCase; import com.intellij.util.IncorrectOperationException; public class DocumentTest extends LightPlatformTestCase { - public void testCorrectlyAddingAndRemovingListeners() throws Exception { + public void testCorrectlyAddingAndRemovingListeners() { new WriteCommandAction.Simple(getProject()) { @Override - protected void run() throws Throwable { + protected void run() { final Document doc = new DocumentImpl(""); final StringBuilder b = new StringBuilder(); doc.addDocumentListener(new DocumentListener() { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorCreationPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorCreationPerformanceTest.java index ab9fb6030137..1993d0b3f10b 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorCreationPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorCreationPerformanceTest.java @@ -20,7 +20,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.testFramework.PlatformTestUtil; public class EditorCreationPerformanceTest extends AbstractEditorTest { - public void testOpeningEditorWithManyLines() throws Exception { + public void testOpeningEditorWithManyLines() { Document document = EditorFactory.getInstance().createDocument(StringUtil.repeat(LOREM_IPSUM + '\n', 15000)); PlatformTestUtil.startPerformanceTest("Editor creation", 75, () -> { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorModificationUtilTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorModificationUtilTest.java index d4231f3f2564..e20433b58822 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorModificationUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorModificationUtilTest.java @@ -19,7 +19,7 @@ import com.intellij.openapi.command.WriteCommandAction; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; public class EditorModificationUtilTest extends LightPlatformCodeInsightTestCase { - public void testInsertStringAtCaretNotMovingCaret() throws Exception { + public void testInsertStringAtCaretNotMovingCaret() { configureFromFileText(getTestName(false) + ".txt", "text "); WriteCommandAction.runWriteCommandAction(getProject(), () -> { EditorModificationUtil.insertStringAtCaret(myEditor, " ", false, false); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretColumnModeTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretColumnModeTest.java index 550676694bdf..1154f40efec0 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretColumnModeTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretColumnModeTest.java @@ -19,10 +19,8 @@ import com.intellij.openapi.actionSystem.IdeActions; import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.editor.impl.AbstractEditorTest; -import java.io.IOException; - public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { - public void testUpDown() throws Exception { + public void testUpDown() { init("line1\n" + "line2\n" + "line3"); @@ -58,7 +56,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "line3"); } - public void testPageUpDown() throws Exception { + public void testPageUpDown() { init("line1\n" + "line2\n" + "line3\n" + @@ -114,7 +112,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "line7"); } - public void testSelectionWithKeyboard() throws Exception { + public void testSelectionWithKeyboard() { init("line1\n" + "line2\n" + "line3"); @@ -170,7 +168,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "line3"); } - public void testSelectNextPrevWord() throws Exception { + public void testSelectNextPrevWord() { init("aaa aaa\n" + "bbbb bbbb"); executeAction(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN_WITH_SELECTION); @@ -182,7 +180,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "bbbb bbbb"); } - public void testMoveToSelectionStart() throws Exception { + public void testMoveToSelectionStart() { init("a"); mouse().pressAt(0, 2).dragTo(0, 4).release(); verifyCaretsAndSelections(0, 4, 2, 4); @@ -191,7 +189,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { verifyCaretsAndSelections(0, 2, 2, 2); } - public void testMoveToSelectionEnd() throws Exception { + public void testMoveToSelectionEnd() { init("a"); mouse().pressAt(0, 4).dragTo(0, 2).release(); verifyCaretsAndSelections(0, 2, 2, 4); @@ -200,7 +198,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { verifyCaretsAndSelections(0, 4, 4, 4); } - public void testReverseBlockSelection() throws Exception { + public void testReverseBlockSelection() { init("a"); mouse().pressAt(0, 4).dragTo(0, 3).release(); verifyCaretsAndSelections(0, 3, 3, 4); @@ -209,7 +207,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { verifyCaretsAndSelections(0, 4, 4, 4); } - public void testSelectionWithKeyboardInEmptySpace() throws Exception { + public void testSelectionWithKeyboardInEmptySpace() { init("\n\n"); mouse().clickAt(1, 1); verifyCaretsAndSelections(1, 1, 1, 1); @@ -251,7 +249,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { verifyCaretsAndSelections(1, 1, 1, 1); } - public void testBlockSelection() throws Exception { + public void testBlockSelection() { init("a\n" + "bbb\n" + "ccccc"); @@ -261,7 +259,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { 2, 1, 1, 4); } - public void testTyping() throws Exception { + public void testTyping() { init("a\n" + "bbb\n" + "ccccc"); @@ -272,7 +270,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "ccScc"); } - public void testCopyPasteOfShortLines() throws Exception { + public void testCopyPasteOfShortLines() { init("a\n" + "bbb\n" + "ccccc"); @@ -285,7 +283,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "ccccccc"); } - public void testPasteOfBlockToASingleCaret() throws Exception { + public void testPasteOfBlockToASingleCaret() { init("a\n" + "bbb\n" + "ccccc"); @@ -298,7 +296,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "ccccc"); } - public void testPasteOfSeveralLinesCopiedFromIdeaToASingleCaret() throws Exception { + public void testPasteOfSeveralLinesCopiedFromIdeaToASingleCaret() { init("a\n" + "bbb\n" + "ccccc"); @@ -313,7 +311,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "bccccc"); } - public void testSelectToDocumentStart() throws Exception { + public void testSelectToDocumentStart() { init("line1\n" + "line2\n" + "line3\n" + @@ -326,7 +324,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "line4"); } - public void testSelectToDocumentEnd() throws Exception { + public void testSelectToDocumentEnd() { init("line1\n" + "line2\n" + "line3\n" + @@ -339,7 +337,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { "line4"); } - public void testToggleCaseToLower() throws Exception { + public void testToggleCaseToLower() { init("a\n" + "BBB\n" + "ccccc"); @@ -352,7 +350,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { 2, 4, 2, 4); } - public void testToggleCaseToUpper() throws Exception { + public void testToggleCaseToUpper() { init("a\n" + "BBb\n" + "ccccc"); @@ -365,7 +363,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { 2, 4, 2, 4); } - public void testSeparatedCarets() throws Exception { + public void testSeparatedCarets() { init("\n" + "\n" + "\n" + @@ -439,7 +437,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { ""); } - public void testPageMovementsInteroperateWithLineMovements() throws Exception { + public void testPageMovementsInteroperateWithLineMovements() { init("abc\nabc\nabc\nabc\nabc"); executeAction(IdeActions.ACTION_EDITOR_MOVE_CARET_PAGE_DOWN_WITH_SELECTION); checkResultByText("abc\nabc\nabc\nabc\nabc"); @@ -451,7 +449,7 @@ public class EditorMultiCaretColumnModeTest extends AbstractEditorTest { checkResultByText("abc\nabc\nabc\nabc\nabc"); } - private void init(String text) throws IOException { + private void init(String text) { configureFromFileText(getTestName(false) + ".txt", text); setEditorVisibleSize(1000, 1000); ((EditorEx)myEditor).setColumnMode(true); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretPerformanceTest.java index 72df52e41f11..92cfb5aa4f34 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretPerformanceTest.java @@ -20,7 +20,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.testFramework.PlatformTestUtil; public class EditorMultiCaretPerformanceTest extends AbstractEditorTest { - public void testTyping() throws Exception { + public void testTyping() { int caretCount = 1000; int charactersToType = 100; String initialText = StringUtil.repeat("\n", caretCount); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretStateRestoreTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretStateRestoreTest.java index 4f1771020885..3c1c436ac6df 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretStateRestoreTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretStateRestoreTest.java @@ -25,7 +25,7 @@ import com.intellij.psi.PsiFile; import com.intellij.testFramework.EditorTestUtil; public class EditorMultiCaretStateRestoreTest extends HeavyFileEditorManagerTestCase { - public void testRestoreState() throws Exception { + public void testRestoreState() { String text = "some text\n" + "some other text\n" + "another line"; diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java index 72a6e23ac91a..152114fa0ca0 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java @@ -49,7 +49,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { } } - public void testCaretAddingAndRemoval() throws Exception { + public void testCaretAddingAndRemoval() { initText("some text\n" + "another line"); @@ -95,7 +95,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { }); } - public void testAltDragStartingFromWithinLine() throws Exception { + public void testAltDragStartingFromWithinLine() { initText("line\n" + "long line\n" + "very long line\n" + @@ -133,7 +133,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "line"); } - public void testMiddleButtonDragStartingFromVirtualSpace() throws Exception { + public void testMiddleButtonDragStartingFromVirtualSpace() { initText("line\n" + "long line\n" + "very long line\n" + @@ -171,7 +171,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "line"); } - public void testAltOnOffWhileDragging() throws Exception { + public void testAltOnOffWhileDragging() { initText("line1\n" + "line2\n" + "line3"); @@ -192,7 +192,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "line3"); } - public void testTyping() throws Exception { + public void testTyping() { initText("some text\n" + "some other text\n" + "another line"); @@ -202,7 +202,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "A line"); } - public void testCopyPaste() throws Exception { + public void testCopyPaste() { initText("one two \n" + "three four "); executeAction("EditorCopy"); @@ -212,7 +212,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "three fourthree "); } - public void testCutAndPaste() throws Exception { + public void testCutAndPaste() { initText("one two \n" + "three four "); executeAction("EditorCut"); @@ -222,7 +222,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { " fourthree "); } - public void testPasteSingleItem() throws Exception { + public void testPasteSingleItem() { initText("one two \n" + "three four "); executeAction("EditorCopy"); @@ -233,7 +233,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "three fourone "); } - public void testCutAndPasteMultiline() throws Exception { + public void testCutAndPasteMultiline() { initText("one two \n" + "three four \n" + "five six \n" + @@ -247,7 +247,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "seven"); } - public void testCopyMultilineFromOneCaretPasteIntoTwo() throws Exception { + public void testCopyMultilineFromOneCaretPasteIntoTwo() { initText("one\n" + "two\n" + "three\n" + @@ -264,7 +264,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "four"); } - public void testCopyPasteDoesNothingWithUnevenSelection() throws Exception { + public void testCopyPasteDoesNothingWithUnevenSelection() { initText("one\n" + "two\n" + "three\n" + @@ -277,7 +277,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "four"); } - public void testPastingAtDifferentNumberOfCarets() throws Exception { + public void testPastingAtDifferentNumberOfCarets() { initText("one\n" + "two\n" + "three\n" + @@ -296,7 +296,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "four"); } - public void testPastingLineWithBreakFromOutside() throws Exception { + public void testPastingLineWithBreakFromOutside() { initText("\n" + ""); CopyPasteManager.getInstance().setContents(new StringSelection("abc\n")); @@ -305,7 +305,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "abc"); } - public void testEscapeAfterDragDown() throws Exception { + public void testEscapeAfterDragDown() { initText("line1\n" + "line2"); setEditorVisibleSize(1000, 1000); @@ -316,7 +316,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "line2"); } - public void testEscapeAfterDragUp() throws Exception { + public void testEscapeAfterDragUp() { initText("line1\n" + "line2"); setEditorVisibleSize(1000, 1000); @@ -327,19 +327,19 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "line2"); } - public void testAltShiftDoubleClick() throws Exception { + public void testAltShiftDoubleClick() { initText("quick brown fox"); mouse().alt().shift().doubleClickAt(0, 8); checkResultByText("quick brown fox"); } - public void testAltShiftDoubleClickAtExistingCaret() throws Exception { + public void testAltShiftDoubleClickAtExistingCaret() { initText("quick brown fox"); mouse().alt().shift().doubleClickAt(0, 8); checkResultByText("quick brown fox"); } - public void testAltShiftTripleClick() throws Exception { + public void testAltShiftTripleClick() { initText("quick\n" + "brown\n" + "fox"); @@ -349,7 +349,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "fox"); } - public void testAltShiftTripleClickAtExistingCaret() throws Exception { + public void testAltShiftTripleClickAtExistingCaret() { initText("quick\n" + "brown\n" + "fox"); @@ -359,7 +359,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "fox"); } - public void testCaretPositionsRecalculationOnDocumentChange() throws Exception { + public void testCaretPositionsRecalculationOnDocumentChange() { initText("\n" + "word\n" + "some long prefix word-suffix"); @@ -373,7 +373,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { verifySoftWrapPositions(19); } - public void testCreateRectangularSelectionWithMouseClicks() throws Exception { + public void testCreateRectangularSelectionWithMouseClicks() { initText("line\n" + "long line\n" + "very long line\n" + @@ -387,7 +387,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "line"); } - public void testCreateRectangularSelectionExtendsSelection() throws Exception { + public void testCreateRectangularSelectionExtendsSelection() { initText("line\n" + "long line\n" + "very long line\n" + @@ -407,14 +407,14 @@ public class EditorMultiCaretTest extends AbstractEditorTest { "line"); } - public void testAddingMultipleSelectionsUsingMouse() throws Exception { + public void testAddingMultipleSelectionsUsingMouse() { initText("some text\nother text"); setEditorVisibleSize(1000, 1000); mouse().alt().shift().pressAt(0, 5).dragTo(1, 2).release(); checkResultByText("some text\nother text"); } - public void testAddingMultipleSelectionsUsingMouseInColumnSelectionMode() throws Exception { + public void testAddingMultipleSelectionsUsingMouseInColumnSelectionMode() { initText("some text\nother text"); setEditorVisibleSize(1000, 1000); ((EditorEx)myEditor).setColumnMode(true); @@ -422,21 +422,21 @@ public class EditorMultiCaretTest extends AbstractEditorTest { checkResultByText("some text\nother text"); } - public void testAltShiftDragAfterRemovingCaret() throws Exception { + public void testAltShiftDragAfterRemovingCaret() { initText("abracadabra"); setEditorVisibleSize(1000, 1000); mouse().alt().shift().pressAt(0, 2).dragTo(0, 3).release(); checkResultByText("abracadabra"); } - public void testAddingRectangualSelectionUsingMouse() throws Exception { + public void testAddingRectangualSelectionUsingMouse() { initText("some text\nother text"); setEditorVisibleSize(1000, 1000); mouse().ctrl().alt().shift().pressAt(0, 7).dragTo(1, 5).release(); checkResultByText("some text\nother text"); } - public void testCaretPositionUpdateOnFolding() throws Exception { + public void testCaretPositionUpdateOnFolding() { initText("line1\n" + "line2\n" + "line3\n" + @@ -446,7 +446,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { 2, 4, 4, 4); } - public void testCaretStaysPrimaryOnMerging() throws Exception { + public void testCaretStaysPrimaryOnMerging() { initText("word\n" + "word word\n" + ""); @@ -473,7 +473,7 @@ public class EditorMultiCaretTest extends AbstractEditorTest { } } - public void testTypingAdjacentSpaces() throws Exception { + public void testTypingAdjacentSpaces() { initText("\t\t"); rightWithSelection(); type(' '); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretUndoRedoTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretUndoRedoTest.java index a96f00e7ef17..1937822809e2 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretUndoRedoTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretUndoRedoTest.java @@ -29,8 +29,6 @@ import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider; import com.intellij.testFramework.TestFileType; import org.jetbrains.annotations.NotNull; -import java.io.IOException; - public class EditorMultiCaretUndoRedoTest extends AbstractEditorTest { private CurrentEditorProvider mySavedCurrentEditorProvider; @@ -46,7 +44,7 @@ public class EditorMultiCaretUndoRedoTest extends AbstractEditorTest { @Override // disabling execution of tests in command - protected void runTest() throws Throwable { + protected void runTest() { new WriteAction() { @Override protected void run(@NotNull Result result) throws Throwable { @@ -55,7 +53,7 @@ public class EditorMultiCaretUndoRedoTest extends AbstractEditorTest { }.execute(); } - public void testUndoRedo() throws Exception { + public void testUndoRedo() { init("some text\n" + "some other text\n" + "another line"); @@ -78,7 +76,7 @@ public class EditorMultiCaretUndoRedoTest extends AbstractEditorTest { "A line"); } - public void testBlockSelectionStateAfterUndo() throws Exception { + public void testBlockSelectionStateAfterUndo() { init("a"); ((EditorEx)myEditor).setColumnMode(true); mouse().clickAt(0, 2); @@ -88,7 +86,7 @@ public class EditorMultiCaretUndoRedoTest extends AbstractEditorTest { verifyCaretsAndSelections(0, 3, 2, 3); } - public void testBlockSelectionStateAfterUndo2() throws Exception { + public void testBlockSelectionStateAfterUndo2() { init("a"); ((EditorEx)myEditor).setColumnMode(true); mouse().pressAt(0, 0).dragTo(0, 2).release(); @@ -97,7 +95,7 @@ public class EditorMultiCaretUndoRedoTest extends AbstractEditorTest { verifyCaretsAndSelections(0, 2, 0, 2); } - public void testPrimaryCaretPositionAfterUndo() throws Exception { + public void testPrimaryCaretPositionAfterUndo() { init("line1\n" + "line2"); mouse().alt().pressAt(1, 1).dragTo(0, 0).release(); @@ -126,7 +124,7 @@ public class EditorMultiCaretUndoRedoTest extends AbstractEditorTest { return TextEditorProvider.getInstance().getTextEditor(myEditor); } - private void init(String text) throws IOException { + private void init(String text) { init(text, TestFileType.TEXT); setEditorVisibleSize(1000, 1000); getUndoManager().setEditorProvider(new CurrentEditorProvider() { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingPerformanceTest.java index 47a2eff5107c..f68fb97c9527 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorPaintingPerformanceTest.java @@ -26,13 +26,13 @@ import java.awt.*; public class EditorPaintingPerformanceTest extends AbstractEditorTest { private static final int EDITOR_WIDTH_PX = 1000; - public void testScrollingThroughLongTextFile() throws Exception { + public void testScrollingThroughLongTextFile() { initText(StringUtil.repeat(LOREM_IPSUM + '\n', 15000)); doTestScrollingPerformance("scrolling through text file with many lines", 3600); } - public void testScrollingThroughLongSoftWrappedLine() throws Exception { + public void testScrollingThroughLongSoftWrappedLine() { initText(StringUtil.repeat(LOREM_IPSUM + ' ', 15000)); EditorTestUtil.configureSoftWraps(myEditor, EDITOR_WIDTH_PX, TEST_CHAR_WIDTH); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingStressTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingStressTest.java index 2cd578519274..e7564b9a8675 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingStressTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/FoldingStressTest.java @@ -23,13 +23,13 @@ import com.intellij.testFramework.PlatformTestUtil; public class FoldingStressTest extends LightPlatformTestCase { - public void testStressFoldingFromZeroOffset() throws Exception { + public void testStressFoldingFromZeroOffset() { for (int len = 2; len < 25; len++) { stress(len); } } - public void testStress8() throws Exception { + public void testStress8() { DocumentImpl doc = new DocumentImpl("0123456789\n123456789\n23456789"); Editor editor = EditorFactory.getInstance().createEditor(doc); try { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java index c67816f1cb9e..ce021f6dc942 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/AbstractRegionToKillRingTest.java @@ -26,22 +26,22 @@ import org.jetbrains.annotations.NotNull; */ public abstract class AbstractRegionToKillRingTest extends LightPlatformCodeInsightTestCase { - public void testNoSelection() throws Exception { + public void testNoSelection() { doTest("this is a test string"); } - public void testSingleLineSelection() throws Exception { + public void testSingleLineSelection() { doTest("this is a test string"); } - public void testMultiLineSelection() throws Exception { + public void testMultiLineSelection() { doTest( "this is the first string\n" + "this is the second string" ); } - protected abstract void doTest(@NotNull String text) throws Exception; + protected abstract void doTest(@NotNull String text); /** * Checks current editor and returns tuple of {@code (selected text; text over than selected)}. diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CopyActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CopyActionTest.java index 254437d71254..bcc1b4960327 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CopyActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CopyActionTest.java @@ -20,10 +20,9 @@ import com.intellij.testFramework.EditorTestUtil; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; import java.awt.datatransfer.DataFlavor; -import java.io.IOException; public class CopyActionTest extends LightPlatformCodeInsightTestCase { - public void testCopyWithoutSelection() throws Exception { + public void testCopyWithoutSelection() { prepare("first line\n" + "second line\n" + "third line"); @@ -35,7 +34,7 @@ public class CopyActionTest extends LightPlatformCodeInsightTestCase { ); } - public void testCopyWithoutSelectionWithSoftWraps() throws Exception { + public void testCopyWithoutSelectionWithSoftWraps() { prepare("first line\n" + "second line\n" + // this line will be wrapped and caret is positioned after the wrap "third line"); @@ -48,7 +47,7 @@ public class CopyActionTest extends LightPlatformCodeInsightTestCase { ); } - private void prepare(String documentContents) throws IOException { + private void prepare(String documentContents) { configureFromFileText(getTestName(false) + ".txt", documentContents); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java index d3afe5be6e5d..5bc8bb583951 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineBackwardActionTest.java @@ -18,22 +18,20 @@ package com.intellij.openapi.editor.actions; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; import org.jetbrains.annotations.NotNull; -import java.io.IOException; - /** * @author Denis Zhdanov * @since 4/18/11 3:39 PM */ public class CutLineBackwardActionTest extends LightPlatformCodeInsightTestCase { - public void testZeroPosition() throws IOException { + public void testZeroPosition() { String text = "class Test {\n" + "}"; doTest(text, text); } - public void testNonZeroPositionOfFirstLine() throws IOException { + public void testNonZeroPositionOfFirstLine() { doTest( "class Test {\n" + "}", @@ -42,7 +40,7 @@ public class CutLineBackwardActionTest extends LightPlatformCodeInsightTestCase ); } - public void testZeroPositionNonFirstLine() throws IOException { + public void testZeroPositionNonFirstLine() { doTest( "class Test {\n" + " // This is comment string\n" + @@ -52,7 +50,7 @@ public class CutLineBackwardActionTest extends LightPlatformCodeInsightTestCase ); } - public void testNonZeroPositionNonFirstLine() throws IOException { + public void testNonZeroPositionNonFirstLine() { doTest( "class Test {\n" + " // This is the comment string\n" + @@ -64,7 +62,7 @@ public class CutLineBackwardActionTest extends LightPlatformCodeInsightTestCase ); } - private void doTest(@NotNull String before, @NotNull String after) throws IOException { + private void doTest(@NotNull String before, @NotNull String after) { configureFromFileText(getTestName(false) + ".txt", before); cutLineBackward(); checkResultByText(after); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java index e570e9d2445b..6d62732725db 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/CutLineEndActionsTest.java @@ -18,15 +18,13 @@ package com.intellij.openapi.editor.actions; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; import org.jetbrains.annotations.NotNull; -import java.io.IOException; - /** * @author Denis Zhdanov * @since 4/18/11 2:47 PM */ public class CutLineEndActionsTest extends LightPlatformCodeInsightTestCase { - public void testNonEmptyLineEnd() throws IOException { + public void testNonEmptyLineEnd() { doTest( "class Test {\n" + " // This is a comment string\n" + @@ -37,7 +35,7 @@ public class CutLineEndActionsTest extends LightPlatformCodeInsightTestCase { ); } - public void testEmptyLineEnd() throws IOException { + public void testEmptyLineEnd() { doTest( "class Test {\n" + " \n" + @@ -49,7 +47,7 @@ public class CutLineEndActionsTest extends LightPlatformCodeInsightTestCase { ); } - public void testAtLineEnd() throws IOException { + public void testAtLineEnd() { doTest( "class Test {\n" + " // This is a comment string1\n" + @@ -61,14 +59,14 @@ public class CutLineEndActionsTest extends LightPlatformCodeInsightTestCase { ); } - public void testAtDocumentEnd() throws IOException { + public void testAtDocumentEnd() { String text = "class Test{\n" + "}"; doTest(text, text); } - public void testEmptyLastLineEnd() throws IOException { + public void testEmptyLastLineEnd() { doTest( "class Test {\n" + "} ", @@ -77,7 +75,7 @@ public class CutLineEndActionsTest extends LightPlatformCodeInsightTestCase { ); } - private void doTest(@NotNull String before, @NotNull String after) throws IOException { + private void doTest(@NotNull String before, @NotNull String after) { configureFromFileText(getTestName(false) + ".txt", before); cutToLineEnd(); checkResultByText(after); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/DeleteToLineStartAndEndActionsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/DeleteToLineStartAndEndActionsTest.java index 441c9b1080f1..44f2a3438d9a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/DeleteToLineStartAndEndActionsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/DeleteToLineStartAndEndActionsTest.java @@ -21,19 +21,17 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; - public class DeleteToLineStartAndEndActionsTest extends AbstractEditorTest { - public void testEmpty() throws IOException { + public void testEmpty() { doTestDeleteToStart("", ""); doTestDeleteToEnd("", ""); } - public void testEmptyLine() throws IOException { + public void testEmptyLine() { doTestDeleteToStart("\n\n\n", "\n\n\n"); doTestDeleteToEnd("\n\n\n", "\n\n"); } - public void testEndOfNonEmptyLine() throws IOException { + public void testEndOfNonEmptyLine() { doTestDeleteToStart("\n a a a \n\n", "\n\n\n"); doTestDeleteToEnd("\n a a a \n\n", "\n a a a \n"); @@ -41,7 +39,7 @@ public class DeleteToLineStartAndEndActionsTest extends AbstractEditorTest { doTestDeleteToEnd(" a a a ", " a a a "); } - public void testBeginningOfNonEmptyLine() throws IOException { + public void testBeginningOfNonEmptyLine() { doTestDeleteToStart("\n a a a \n\n", "\n a a a \n\n"); doTestDeleteToEnd("\n a a a \n\n", "\n\n\n"); @@ -49,7 +47,7 @@ public class DeleteToLineStartAndEndActionsTest extends AbstractEditorTest { doTestDeleteToEnd(" a a a ", ""); } - public void testMiddleOfNonEmptyLine() throws IOException { + public void testMiddleOfNonEmptyLine() { doTestDeleteToStart("\n a a b b \n\n", "\n b b \n\n"); doTestDeleteToEnd("\n a a b b \n\n", "\n a a \n\n"); @@ -57,7 +55,7 @@ public class DeleteToLineStartAndEndActionsTest extends AbstractEditorTest { doTestDeleteToEnd(" a a b b ", " a a "); } - public void testMoveCaretFromVirtualSpaceToRealOffset() throws IOException { + public void testMoveCaretFromVirtualSpaceToRealOffset() { boolean virtualSpacesBefore = EditorSettingsExternalizable.getInstance().isVirtualSpace(); EditorSettingsExternalizable.getInstance().setVirtualSpace(true); @@ -78,32 +76,32 @@ public class DeleteToLineStartAndEndActionsTest extends AbstractEditorTest { } } - public void testDeleteSelectionFirst() throws IOException { + public void testDeleteSelectionFirst() { doTestDeleteToStart("aaa bbb \n ccc ddd", "aaa ddd"); doTestDeleteToEnd("aaa bbb \n ccc ddd", "aaa ddd"); } - private void doTestDeleteToStart(@NotNull String before, @NotNull String after) throws IOException { + private void doTestDeleteToStart(@NotNull String before, @NotNull String after) { doTestDelete(true, before, null, after, null); } private void doTestDeleteToStart(@NotNull String before, @Nullable VisualPosition positionBefore, - @NotNull String after, @Nullable VisualPosition positionAfter) throws IOException { + @NotNull String after, @Nullable VisualPosition positionAfter) { doTestDelete(true, before, positionBefore, after, positionAfter); } - private void doTestDeleteToEnd(@NotNull String before, @NotNull String after) throws IOException { + private void doTestDeleteToEnd(@NotNull String before, @NotNull String after) { doTestDelete(false, before, null, after, null); } private void doTestDeleteToEnd(@NotNull String before, @Nullable VisualPosition positionBefore, - @NotNull String after, @Nullable VisualPosition positionAfter) throws IOException { + @NotNull String after, @Nullable VisualPosition positionAfter) { doTestDelete(false, before, positionBefore, after, positionAfter); } private void doTestDelete(boolean toStart, @NotNull String before, @Nullable VisualPosition positionBefore, - @NotNull String after, @Nullable VisualPosition positionAfter) throws IOException { + @NotNull String after, @Nullable VisualPosition positionAfter) { configureFromFileText(getTestName(false) + ".txt", before); if (positionBefore != null) mouse().clickAt(positionBefore.line, positionBefore.column); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorActionTest.java index 51e8e6b11601..9c8262892c31 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorActionTest.java @@ -25,10 +25,9 @@ import com.intellij.testFramework.EditorTestUtil; import com.intellij.testFramework.TestFileType; import java.awt.datatransfer.StringSelection; -import java.io.IOException; public class EditorActionTest extends AbstractEditorTest { - public void testDownWithSelectionWhenCaretsAreAllowedInsideTabs() throws Exception { + public void testDownWithSelectionWhenCaretsAreAllowedInsideTabs() { init("text", TestFileType.TEXT); @@ -43,7 +42,7 @@ public class EditorActionTest extends AbstractEditorTest { editorSettings.setCaretInsideTabs(old); } } - public void testPageDownWithSelectionWhenCaretsAreAllowedInsideTabs() throws Exception { + public void testPageDownWithSelectionWhenCaretsAreAllowedInsideTabs() { init("line 1\n" + "line 2", TestFileType.TEXT); @@ -62,7 +61,7 @@ public class EditorActionTest extends AbstractEditorTest { } } - public void testDuplicateFirstLineWhenSoftWrapsAreOn() throws Exception { + public void testDuplicateFirstLineWhenSoftWrapsAreOn() { init("long long text", TestFileType.TEXT); EditorTestUtil.configureSoftWraps(myEditor, 10); @@ -71,13 +70,13 @@ public class EditorActionTest extends AbstractEditorTest { "long long text"); } - public void testTabWithSelection() throws Exception { + public void testTabWithSelection() { init("some text", TestFileType.TEXT); executeAction("EditorTab"); checkResultByText("some text"); } - public void testLineDeleteWithSelectionEndAtLineStart() throws IOException { + public void testLineDeleteWithSelectionEndAtLineStart() { String text = "line 1\n" + "line 2\n" + @@ -90,7 +89,7 @@ public class EditorActionTest extends AbstractEditorTest { ); } - public void testDeleteLastLine() throws IOException { + public void testDeleteLastLine() { String text = "1\n" + "2\n" + @@ -102,13 +101,13 @@ public class EditorActionTest extends AbstractEditorTest { checkResultByText("1"); } - public void testDeleteLastNonEmptyLine() throws IOException { + public void testDeleteLastNonEmptyLine() { init("1\n", TestFileType.TEXT); deleteLine(); checkResultByText(""); } - public void testDeleteLineHonorSelection() throws Exception { + public void testDeleteLineHonorSelection() { init("xxxx\n" + "bla bla\n" + "bla bla\n" + @@ -119,13 +118,13 @@ public class EditorActionTest extends AbstractEditorTest { "yyy"); } - public void testIndentWhitespaceLineWithCaretAtLineStart() throws Exception { + public void testIndentWhitespaceLineWithCaretAtLineStart() { init(" ", TestFileType.TEXT); executeAction("EditorIndentLineOrSelection"); checkResultByText(" "); } - public void testBackspaceWithStickySelection() throws Exception { + public void testBackspaceWithStickySelection() { init("text", TestFileType.TEXT); executeAction(IdeActions.ACTION_EDITOR_TOGGLE_STICKY_SELECTION); executeAction(IdeActions.ACTION_EDITOR_MOVE_CARET_RIGHT); @@ -134,21 +133,21 @@ public class EditorActionTest extends AbstractEditorTest { assertFalse(((EditorEx)myEditor).isStickySelection()); } - public void testMoveRightAtFoldedLineEnd() throws Exception { + public void testMoveRightAtFoldedLineEnd() { init("line1\nline2\nline3", TestFileType.TEXT); addCollapsedFoldRegion(5, 7, "..."); executeAction(IdeActions.ACTION_EDITOR_MOVE_CARET_RIGHT); assertEquals(new VisualPosition(0, 6), myEditor.getCaretModel().getVisualPosition()); } - public void testEnterOnLastLineInOverwriteMode() throws Exception { + public void testEnterOnLastLineInOverwriteMode() { init("text", TestFileType.TEXT); executeAction(IdeActions.ACTION_EDITOR_TOGGLE_OVERWRITE_MODE); executeAction(IdeActions.ACTION_EDITOR_ENTER); checkResultByText("text\n"); } - public void testPasteInOneLineMode() throws Exception { + public void testPasteInOneLineMode() { init("", TestFileType.TEXT); ((EditorEx)myEditor).setOneLineMode(true); CopyPasteManager.getInstance().setContents(new StringSelection("a\rb")); @@ -156,19 +155,19 @@ public class EditorActionTest extends AbstractEditorTest { checkResultByText("a b"); } - public void testDeleteToWordStartWithEscapeChars() throws Exception { + public void testDeleteToWordStartWithEscapeChars() { init("class Foo { String s = \"a\\nb\"; }", TestFileType.JAVA); executeAction(IdeActions.ACTION_EDITOR_DELETE_TO_WORD_START); checkResultByText("class Foo { String s = \"a\\n\"; }"); } - public void testDeleteToWordEndWithEscapeChars() throws Exception { + public void testDeleteToWordEndWithEscapeChars() { init("class Foo { String s = \"a\\nb\"; }", TestFileType.JAVA); executeAction(IdeActions.ACTION_EDITOR_DELETE_TO_WORD_END); checkResultByText("class Foo { String s = \"a\\b\"; }"); } - public void testUpWithSelectionOnCaretInsideSelection() throws Exception { + public void testUpWithSelectionOnCaretInsideSelection() { initText("blah blah\n" + "blah blah\n" + "blah blah"); @@ -178,7 +177,7 @@ public class EditorActionTest extends AbstractEditorTest { "blah blah"); } - public void testDownWithSelectionOnCaretInsideSelection() throws Exception { + public void testDownWithSelectionOnCaretInsideSelection() { initText("blah blah\n" + "blah blah\n" + "blah blah"); @@ -188,20 +187,20 @@ public class EditorActionTest extends AbstractEditorTest { "blah blah"); } - public void testCaretComesBeforeTextOnUnindent() throws IOException { + public void testCaretComesBeforeTextOnUnindent() { initText(" text"); unindent(); checkResultByText(" text"); } - public void testSwapSelectionBoundaries() throws IOException { + public void testSwapSelectionBoundaries() { initText("abc"); executeAction(IdeActions.ACTION_EDITOR_SWAP_SELECTION_BOUNDARIES); left(); checkResultByText("abc"); } - public void testSwapSelectionBoundariesWithStickySelection() throws IOException { + public void testSwapSelectionBoundariesWithStickySelection() { initText("abc"); ((EditorEx)myEditor).setStickySelection(true); executeAction(IdeActions.ACTION_EDITOR_SWAP_SELECTION_BOUNDARIES); @@ -209,13 +208,13 @@ public class EditorActionTest extends AbstractEditorTest { checkResultByText("abc"); } - public void testDuplicateLinesWhenSelectionEndsAtLineStart() throws IOException { + public void testDuplicateLinesWhenSelectionEndsAtLineStart() { initText("a\nb\nc"); executeAction(IdeActions.ACTION_EDITOR_DUPLICATE_LINES); checkResultByText("a\nb\nb\nc"); } - public void testSmartHomeAfterFoldedRegion() throws IOException { + public void testSmartHomeAfterFoldedRegion() { initText(" text with [multiline\nfold region]"); foldOccurrences("(?s)\\[.*\\]", "..."); myEditor.getSettings().setSmartHome(true); @@ -223,38 +222,38 @@ public class EditorActionTest extends AbstractEditorTest { checkResultByText(" text with [multiline\nfold region]"); } - public void testToggleCaseForTextAfterEscapedSlash() throws IOException { + public void testToggleCaseForTextAfterEscapedSlash() { init("class C { String s = \"ab\\\\cd\"; }", TestFileType.JAVA); executeAction(IdeActions.ACTION_EDITOR_TOGGLE_CASE); checkResultByText("class C { String s = \"AB\\\\CD\"; }"); } - public void testToggleCaseForEscapedChar() throws IOException { + public void testToggleCaseForEscapedChar() { init("class C { String s = \"ab\\ncd\"; }", TestFileType.JAVA); executeAction(IdeActions.ACTION_EDITOR_TOGGLE_CASE); checkResultByText("class C { String s = \"AB\\nCD\"; }"); } - public void testJoinSeveralLinesAtDocumentEnd() throws Exception { + public void testJoinSeveralLinesAtDocumentEnd() { initText("a\nb\nc"); executeAction(IdeActions.ACTION_SELECT_ALL); executeAction(IdeActions.ACTION_EDITOR_JOIN_LINES); checkResultByText("a b c"); } - public void testDeleteAtSurrogatePair() throws Exception { + public void testDeleteAtSurrogatePair() { initText("a" + SURROGATE_PAIR + "b"); delete(); checkResultByText("ab"); } - public void testBackspaceAtSurrogatePair() throws Exception { + public void testBackspaceAtSurrogatePair() { initText("a" + SURROGATE_PAIR + "b"); backspace(); checkResultByText("ab"); } - public void testCaretMovementNearSurrogatePair() throws Exception { + public void testCaretMovementNearSurrogatePair() { initText("a" + SURROGATE_PAIR + "b"); right(); checkResultByText("a" + SURROGATE_PAIR + "b"); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/ForwardBackwardParagraphActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/ForwardBackwardParagraphActionTest.java index 748c3dfdddb0..0a06bc83db74 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/ForwardBackwardParagraphActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/ForwardBackwardParagraphActionTest.java @@ -108,13 +108,13 @@ public class ForwardBackwardParagraphActionTest extends AbstractEditorTest { "abc"); } - private void doTestForward(String initialText, String resultText) throws Exception { + private void doTestForward(String initialText, String resultText) { initText(initialText); executeAction(IdeActions.ACTION_EDITOR_FORWARD_PARAGRAPH); checkResultByText(resultText); } - private void doTestBackward(String initialText, String resultText) throws Exception { + private void doTestBackward(String initialText, String resultText) { initText(initialText); executeAction(IdeActions.ACTION_EDITOR_BACKWARD_PARAGRAPH); checkResultByText(resultText); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/IndentSelectionActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/IndentSelectionActionTest.java index e86f0538e96f..7d9eb7f902f6 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/IndentSelectionActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/IndentSelectionActionTest.java @@ -19,27 +19,27 @@ import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCa public class IndentSelectionActionTest extends LightPlatformCodeInsightFixtureTestCase { - public void testWithoutSelection() throws Exception { + public void testWithoutSelection() { verifyAction("some text", null); } - public void testWithInlineSelection() throws Exception { + public void testWithInlineSelection() { verifyAction("some text", " some text"); } - public void testWithInlineWhitespaceOnlySelection() throws Exception { + public void testWithInlineWhitespaceOnlySelection() { verifyAction("some text", null); } - public void testWithLineSelection() throws Exception { + public void testWithLineSelection() { verifyAction("some text", " some text"); } - public void testWithLineSelectionExcludingSpaces() throws Exception { + public void testWithLineSelectionExcludingSpaces() { verifyAction(" some text", " some text"); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java index 2c05207653e1..9ccce1c969a8 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRegionActionTest.java @@ -27,7 +27,7 @@ import java.awt.datatransfer.DataFlavor; */ public class KillRegionActionTest extends AbstractRegionToKillRingTest { - protected void doTest(@NotNull String text) throws Exception { + protected void doTest(@NotNull String text) { configureFromFileText(getTestName(false) + ".txt", text); Pair parseResult = parse(); killRegion(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java index f436175166df..e48897d96a23 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillRingSaveActionTest.java @@ -27,7 +27,7 @@ import java.awt.datatransfer.DataFlavor; */ public class KillRingSaveActionTest extends AbstractRegionToKillRingTest { - protected void doTest(@NotNull String text) throws Exception { + protected void doTest(@NotNull String text) { configureFromFileText(getTestName(false) + ".txt", text); Pair parseResult = parse(); String textBefore = myEditor.getDocument().getText(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java index 1e6ef592ceed..b8e959e5bc34 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordEndActionTest.java @@ -33,35 +33,35 @@ import java.io.IOException; */ public class KillToWordEndActionTest extends LightPlatformCodeInsightTestCase { - public void testAtWordStart() throws IOException { + public void testAtWordStart() { doTest( "this is a string", "this is a " ); } - public void testInTheMiddle() throws IOException { + public void testInTheMiddle() { doTest( "this is a string", "th is a string" ); } - public void testAtWordEnd() throws IOException { + public void testAtWordEnd() { doTest( "this is a string", "this is string" ); } - public void testAtWhiteSpaceBetweenWords() throws IOException { + public void testAtWhiteSpaceBetweenWords() { doTest( "this is a string", "this a string" ); } - public void testAfterLastWordOnTheLineEnd() throws IOException { + public void testAfterLastWordOnTheLineEnd() { doTest( "this is the first string \n" + "this is the second string", @@ -69,21 +69,21 @@ public class KillToWordEndActionTest extends LightPlatformCodeInsightTestCase { ); } - public void testAfterLastWord() throws IOException { + public void testAfterLastWord() { doTest( "this is a string", "this is a string" ); } - public void testAfterLastWordBeforeWhiteSpace() throws IOException { + public void testAfterLastWordBeforeWhiteSpace() { doTest( "this is a string ", "this is a string" ); } - public void testAtWhiteSpaceAtLineEnd() throws IOException { + public void testAtWhiteSpaceAtLineEnd() { doTest( "this is the first string \n" + "this is the second string", @@ -91,13 +91,13 @@ public class KillToWordEndActionTest extends LightPlatformCodeInsightTestCase { ); } - public void testEscapeChars() throws Exception { + public void testEscapeChars() { configureFromFileText(getTestName(false) + ".java", "class Foo { String s = \"a\\nb\"; }"); killToWordEnd(); checkResultByText("class Foo { String s = \"a\\b\"; }"); } - private void doTest(@NotNull String before, @NotNull String after) throws IOException { + private void doTest(@NotNull String before, @NotNull String after) { configureFromFileText(getTestName(false) + ".txt", before); killToWordEnd(); checkResultByText(after); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java index 9daf7c5df508..24034a7f32a7 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/KillToWordStartActionTest.java @@ -19,43 +19,41 @@ import com.intellij.openapi.editor.ex.EditorSettingsExternalizable; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; import org.jetbrains.annotations.NotNull; -import java.io.IOException; - /** * @author Denis Zhdanov * @since 4/19/11 4:21 PM */ public class KillToWordStartActionTest extends LightPlatformCodeInsightTestCase { - public void testAfterWordEnd() throws IOException { + public void testAfterWordEnd() { doTest( "this is a test string ", "this is a test " ); } - public void testAtWordEnd() throws IOException { + public void testAtWordEnd() { doTest( "this is a test string", "this is a test " ); } - public void testInTheMiddleOfTheWord() throws IOException { + public void testInTheMiddleOfTheWord() { doTest( "this is a test string", "this is a test ing" ); } - public void testInTheWordStart() throws IOException { + public void testInTheWordStart() { doTest( "this is a test string", "this is a string" ); } - public void testInWhiteSpaceAtLineStart() throws IOException { + public void testInWhiteSpaceAtLineStart() { doTest( "this is the first string \n" + " this is the second string", @@ -63,7 +61,7 @@ public class KillToWordStartActionTest extends LightPlatformCodeInsightTestCase ); } - public void testAtLineStart() throws IOException { + public void testAtLineStart() { doTest( "this is the first string \n" + " this is the second string", @@ -71,27 +69,27 @@ public class KillToWordStartActionTest extends LightPlatformCodeInsightTestCase ); } - public void testInWhiteSpaceAtDocumentStart() throws IOException { + public void testInWhiteSpaceAtDocumentStart() { doTest( " this is the first string", " this is the first string" ); } - public void testAtDocumentStart() throws IOException { + public void testAtDocumentStart() { doTest( " this is the first string", " this is the first string" ); } - public void testEscapeChars() throws Exception { + public void testEscapeChars() { configureFromFileText(getTestName(false) + ".java", "class Foo { String s = \"a\\nb\"; }"); killToWordStart(); checkResultByText("class Foo { String s = \"a\\n\"; }"); } - public void testNearDocumentStartInCamelHumpsMode() throws IOException { + public void testNearDocumentStartInCamelHumpsMode() { EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance(); boolean savedValue = editorSettings.isCamelWords(); editorSettings.setCamelWords(true); @@ -103,7 +101,7 @@ public class KillToWordStartActionTest extends LightPlatformCodeInsightTestCase } } - private void doTest(@NotNull String before, @NotNull String after) throws IOException { + private void doTest(@NotNull String before, @NotNull String after) { configureFromFileText(getTestName(false) + ".txt", before); killToWordStart(); checkResultByText(after); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/MoveLineTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/MoveLineTest.java index 83136242bc28..db36ecd3f396 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/MoveLineTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/MoveLineTest.java @@ -21,7 +21,7 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest; import static org.junit.Assert.assertArrayEquals; public class MoveLineTest extends AbstractEditorTest { - public void testInlaysAreMovedWithText() throws Exception { + public void testInlaysAreMovedWithText() { initText("ab\ncd\n"); addInlay(1); executeAction(IdeActions.ACTION_MOVE_LINE_DOWN_ACTION); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/NextPrevWordTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/NextPrevWordTest.java index 89ffe687d2d2..08c3ff838104 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/NextPrevWordTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/NextPrevWordTest.java @@ -39,19 +39,19 @@ public class NextPrevWordTest extends LightPlatformCodeInsightFixtureTestCase { myFixture.checkResult(""); } - public void testNextWordWithEscapeChars() throws Exception { + public void testNextWordWithEscapeChars() { myFixture.configureByText("Foo.java", "class Foo { String s = \"a\\nb\"; }"); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_NEXT_WORD); myFixture.checkResult("class Foo { String s = \"a\\nb\"; }"); } - public void testPrevWordWithEscapeChars() throws Exception { + public void testPrevWordWithEscapeChars() { myFixture.configureByText("Foo.java", "class Foo { String s = \"a\\nb\"; }"); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_PREVIOUS_WORD); myFixture.checkResult("class Foo { String s = \"a\\nb\"; }"); } - public void testPrevWordWithIllegalEscapeChar() throws Exception { + public void testPrevWordWithIllegalEscapeChar() { myFixture.configureByText("Foo.java", "class Foo { String s = \"a\\xb\"; }"); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_PREVIOUS_WORD); myFixture.checkResult("class Foo { String s = \"a\\xb\"; }"); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectLineActionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectLineActionTest.java index 6ee9d7c837ac..c31ddd13929a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectLineActionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectLineActionTest.java @@ -18,10 +18,8 @@ package com.intellij.openapi.editor.actions; import com.intellij.testFramework.EditorTestUtil; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; -import java.io.IOException; - public class SelectLineActionTest extends LightPlatformCodeInsightTestCase { - public void test() throws Exception { + public void test() { prepare("first line\n" + "second line\n" + "third line"); @@ -32,7 +30,7 @@ public class SelectLineActionTest extends LightPlatformCodeInsightTestCase { ); } - public void testWithSoftWraps() throws Exception { + public void testWithSoftWraps() { prepare("first line\n" + "second line\n" + // this line will be wrapped and caret is positioned after the wrap "third line"); @@ -44,7 +42,7 @@ public class SelectLineActionTest extends LightPlatformCodeInsightTestCase { ); } - private void prepare(String documentContents) throws IOException { + private void prepare(String documentContents) { configureFromFileText(getTestName(false) + ".txt", documentContents); } } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectUnselectOccurrenceActionsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectUnselectOccurrenceActionsTest.java index 38c4fcacb07b..afccf1e51d82 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectUnselectOccurrenceActionsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/SelectUnselectOccurrenceActionsTest.java @@ -43,7 +43,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh ApplicationManager.getApplication().getMessageBus().connect(myFixture.getTestRootDisposable()).subscribe(EditorHintListener.TOPIC, listener); } - public void testAllWithoutInitialSelection() throws Exception { + public void testAllWithoutInitialSelection() { init("some text\n" + "some texts\n" + "another text here" @@ -54,7 +54,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh "another text here"); } - public void testAllWithInitialWholeWordSelection() throws Exception { + public void testAllWithInitialWholeWordSelection() { init("some text\n" + "some texts\n" + "some texts\n" + @@ -67,7 +67,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh assertEquals(0, hintCount); } - public void testNoInitialSelection() throws Exception { + public void testNoInitialSelection() { init("some text\n" + "some texts\n" + "another text here" @@ -83,7 +83,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh assertEquals(0, hintCount); } - public void testInitialWholeWordSelection() throws Exception { + public void testInitialWholeWordSelection() { init("some text\n" + "some texts\n" + "another text here"); @@ -94,7 +94,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh assertEquals(0, hintCount); } - public void testShowingHint() throws Exception { + public void testShowingHint() { init("some text\n" + "another text here"); executeAction(); @@ -107,7 +107,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh "another text here"); } - public void testRevert() throws Exception { + public void testRevert() { init("some text\n" + "another text here"); executeReverseAction(); @@ -116,7 +116,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh assertEquals(0, hintCount); } - public void testRevertSingleSelection() throws Exception { + public void testRevertSingleSelection() { init("some text\n" + "some texts\n" + "another text here"); @@ -127,7 +127,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh assertEquals(0, hintCount); } - public void testSelectAfterHint() throws Exception { + public void testSelectAfterHint() { init("some text\n" + "some texts\n" + "another text here"); @@ -143,7 +143,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh assertEquals(1, hintCount); } - public void testInitialNonWholeWordSelection() throws Exception { + public void testInitialNonWholeWordSelection() { init("some text\n" + "some texts\n" + "another text here"); @@ -158,7 +158,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh assertEquals(0, hintCount); } - public void testOccurrenceInCollapsedRegion() throws Exception { + public void testOccurrenceInCollapsedRegion() { init("normal line\n" + "collapsed line"); final FoldingModel foldingModel = myFixture.getEditor().getFoldingModel(); @@ -176,7 +176,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh assertTrue(foldRegions[0].isExpanded()); } - public void testSelectAfterNotFoundAndUnselect() throws Exception { + public void testSelectAfterNotFoundAndUnselect() { init("text text text"); executeAction(); executeReverseAction(); @@ -184,7 +184,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh checkResult("text text text"); } - public void testEscapeReturnsToInitialPosition() throws Exception { + public void testEscapeReturnsToInitialPosition() { init("line\n" + "another line"); executeAction(); @@ -193,14 +193,14 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh "another line"); } - public void testSelectingAdjacentFragments() throws Exception { + public void testSelectingAdjacentFragments() { init("fragmentfragment"); executeAction(); executeAction(); checkResult("fragmentfragment"); } - public void testSkippingOccurrence() throws Exception { + public void testSkippingOccurrence() { init("fruit\n" + "fruits\n" + "fruit\n" + @@ -216,7 +216,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh "fruit"); } - public void testMovingSelectionBackAndForth() throws Exception { + public void testMovingSelectionBackAndForth() { init("fruit\n" + "fruits\n" + "fruit\n" + @@ -234,7 +234,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh "fruit"); } - public void testSkipDoesNotRemovePreviousSelections() throws Exception { + public void testSkipDoesNotRemovePreviousSelections() { init("fruit\n" + "fruit\n" + "fruit"); @@ -250,7 +250,7 @@ public class SelectUnselectOccurrenceActionsTest extends LightPlatformCodeInsigh "fruit"); } - public void testNearInlays() throws Exception { + public void testNearInlays() { init("cat cat"); EditorTestUtil.addInlay(myFixture.getEditor(), 0); EditorTestUtil.addInlay(myFixture.getEditor(), 4); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/ToggleColumnModeActionMultiCaretTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/ToggleColumnModeActionMultiCaretTest.java index c35017bb74e5..e8c2a26ed1d3 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/ToggleColumnModeActionMultiCaretTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/ToggleColumnModeActionMultiCaretTest.java @@ -19,7 +19,7 @@ import com.intellij.openapi.fileTypes.FileTypes; import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase; public class ToggleColumnModeActionMultiCaretTest extends LightPlatformCodeInsightFixtureTestCase { - public void testSingleCaretWithoutSelection() throws Exception { + public void testSingleCaretWithoutSelection() { doTestToggleOnOff("line1\n" + "line2", @@ -31,7 +31,7 @@ public class ToggleColumnModeActionMultiCaretTest extends LightPlatformCodeInsig ); } - public void testSingleCaretWithForwardSelection() throws Exception { + public void testSingleCaretWithForwardSelection() { doTestToggleOnOff("line1\n" + "line2", @@ -43,7 +43,7 @@ public class ToggleColumnModeActionMultiCaretTest extends LightPlatformCodeInsig ); } - public void testSingleCaretWithBackwardSelection() throws Exception { + public void testSingleCaretWithBackwardSelection() { doTestToggleOnOff("line1\n" + "line2", @@ -55,7 +55,7 @@ public class ToggleColumnModeActionMultiCaretTest extends LightPlatformCodeInsig ); } - public void testSingleCaretWithCrossSelection() throws Exception { + public void testSingleCaretWithCrossSelection() { doTestToggleOnOff("line1\n" + "line2", @@ -67,7 +67,7 @@ public class ToggleColumnModeActionMultiCaretTest extends LightPlatformCodeInsig ); } - public void testSingleCaretWithCrossSelection2() throws Exception { + public void testSingleCaretWithCrossSelection2() { doTestToggleOnOff("line1\n" + "line2", @@ -79,7 +79,7 @@ public class ToggleColumnModeActionMultiCaretTest extends LightPlatformCodeInsig ); } - public void testMultipleCarets() throws Exception { + public void testMultipleCarets() { doTestToggleOnOff("line1\n" + "line2", diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java index 21b1d14331eb..f8f182ed3e29 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java @@ -101,7 +101,7 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { assertEquals(FontPreferences.DEFAULT_FONT_SIZE, myScheme.getConsoleFontSize()); } - public void testSetFontPreferences() throws Exception { + public void testSetFontPreferences() { String fontName1 = getExistingNonDefaultFontName(); String fontName2 = getAnotherExistingNonDefaultFontName(); myScheme.setEditorFontName(fontName1); @@ -144,7 +144,7 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { } - public void testSetName() throws Exception { + public void testSetName() { String fontName1 = getExistingNonDefaultFontName(); String fontName2 = getAnotherExistingNonDefaultFontName(); myScheme.setEditorFontName(fontName1); @@ -167,7 +167,7 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { assertEquals(scaledSize, myScheme.getConsoleFontSize()); } - public void testSetSize() throws Exception { + public void testSetSize() { myScheme.setEditorFontSize(25); myScheme.setConsoleFontSize(21); @@ -187,7 +187,7 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { assertEquals(21, myScheme.getConsoleFontSize()); } - public void testSetNameAndSize() throws Exception { + public void testSetNameAndSize() { String fontName1 = getExistingNonDefaultFontName(); String fontName2 = getAnotherExistingNonDefaultFontName(); myScheme.setEditorFontName(fontName1); @@ -211,7 +211,7 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { assertEquals(21, myScheme.getConsoleFontSize()); } - public void testSetSizeAndName() throws Exception { + public void testSetSizeAndName() { String fontName1 = getExistingNonDefaultFontName(); String fontName2 = getAnotherExistingNonDefaultFontName(); myScheme.setEditorFontSize(25); @@ -265,7 +265,7 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { } - public void testSaveInheritance() throws Exception { + public void testSaveInheritance() { Pair result = doTestWriteRead(DefaultLanguageHighlighterColors.STATIC_METHOD, USE_INHERITED_MARKER); TextAttributes fallbackAttrs = result.first.getAttributes(DefaultLanguageHighlighterColors.STATIC_METHOD.getFallbackAttributeKey()); assertSame(result.second, fallbackAttrs); @@ -279,7 +279,7 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { assertThat(result.second).isEqualTo(fallbackAttrs); } - public void testSaveInheritanceForEmptyAttrs() throws Exception { + public void testSaveInheritanceForEmptyAttrs() { Pair result = doTestWriteRead(DefaultLanguageHighlighterColors.INSTANCE_FIELD, USE_INHERITED_MARKER); TextAttributes fallbackAttrs = result.first.getAttributes(DefaultLanguageHighlighterColors.INSTANCE_FIELD.getFallbackAttributeKey()); TextAttributes directlyDefined = @@ -343,7 +343,7 @@ public class EditorColorsSchemeImplTest extends EditorColorSchemeTestCase { } } - public void testIdea152156() throws Exception { + public void testIdea152156() { EditorColorsScheme defaultScheme = EditorColorsManager.getInstance().getScheme(EditorColorsScheme.DEFAULT_SCHEME_NAME); EditorColorsScheme parentScheme = (EditorColorsScheme)defaultScheme.clone(); parentScheme.setName("DefaultTest"); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/TextAttributesReaderTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/TextAttributesReaderTest.java index a5866deabb4a..51f960a41c23 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/TextAttributesReaderTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/TextAttributesReaderTest.java @@ -21,8 +21,7 @@ import com.intellij.testFramework.LightPlatformTestCase; import org.jdom.Element; import org.jetbrains.annotations.NotNull; -import java.awt.Color; -import java.awt.Font; +import java.awt.*; /** * @author Sergey.Malenkov @@ -161,7 +160,7 @@ public final class TextAttributesReaderTest extends LightPlatformTestCase { return read(Option.element(value)); } - private TextAttributes read(Element element) throws Exception { + private TextAttributes read(Element element) { return myReader.read(TextAttributes.class, element); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/ex/util/EditorUtilTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/ex/util/EditorUtilTest.java index 0b2392452f92..910772fa5768 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/ex/util/EditorUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/ex/util/EditorUtilTest.java @@ -19,7 +19,7 @@ import com.intellij.testFramework.EditorTestUtil; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; public class EditorUtilTest extends LightPlatformCodeInsightTestCase { - public void testGetNotFoldedLineStartEndOffsets() throws Exception { + public void testGetNotFoldedLineStartEndOffsets() { configureFromFileText(getTestName(false) + ".txt", "aaa\nbbb\nccc\nddd"); EditorTestUtil.addFoldRegion(myEditor, 4, 8, "...", true); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorTest.java index 14a6141aa529..550fac75e5f2 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractEditorTest.java @@ -27,7 +27,6 @@ import com.intellij.util.ThrowableRunnable; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; -import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -72,11 +71,11 @@ public abstract class AbstractEditorTest extends LightPlatformCodeInsightTestCas } } - protected void initText(@NotNull @NonNls String fileText) throws IOException { + protected void initText(@NotNull @NonNls String fileText) { init(fileText, TestFileType.TEXT); } - protected void init(@NotNull @NonNls String fileText, @NotNull TestFileType type) throws IOException { + protected void init(@NotNull @NonNls String fileText, @NotNull TestFileType type) { configureFromFileText(getFileName(type), fileText); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractRtlTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractRtlTest.java index 54df8119f3f7..dd8b72e840a3 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractRtlTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/AbstractRtlTest.java @@ -21,7 +21,6 @@ import com.intellij.openapi.editor.VisualPosition; import com.intellij.testFramework.TestFileType; import java.awt.*; -import java.io.IOException; import java.util.ArrayList; /** @@ -32,11 +31,11 @@ public abstract class AbstractRtlTest extends AbstractEditorTest { private static final char RTL_CHAR = '\u05d0'; // Hebrew 'aleph' letter private static final char BIDI_BOUNDARY_MARKER = '|'; - protected void prepareText(String text) throws IOException { + protected void prepareText(String text) { prepare(text, TestFileType.TEXT); } - protected void prepare(String text, TestFileType fileType) throws IOException { + protected void prepare(String text, TestFileType fileType) { init(text.replace(RTL_CHAR_REPRESENTATION, RTL_CHAR), fileType); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/DocumentMarkupModelTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/DocumentMarkupModelTest.java index 95f1a5e1b0c2..8817e0141c38 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/DocumentMarkupModelTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/DocumentMarkupModelTest.java @@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Dmitry Avdeev */ public class DocumentMarkupModelTest extends LightPlatformCodeInsightFixtureTestCase { - public void testInfoTestAttributes() throws Exception { + public void testInfoTestAttributes() { LanguageExtensionPoint extension = new LanguageExtensionPoint<>(); extension.language="TEXT"; extension.implementationClass = TestAnnotator.class.getName(); @@ -72,7 +72,7 @@ public class DocumentMarkupModelTest extends LightPlatformCodeInsightFixtureTest RangeHighlighterEx highlighter = model.addPersistentLineHighlighter(2, 0, null); new WriteCommandAction(getProject()){ @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { document.deleteString(document.getLineStartOffset(1), document.getTextLength()); } }.execute(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorColorsSchemeDelegateTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorColorsSchemeDelegateTest.java index e5e968445141..a8209cdfb390 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorColorsSchemeDelegateTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorColorsSchemeDelegateTest.java @@ -15,7 +15,10 @@ */ package com.intellij.openapi.editor.impl; -import com.intellij.openapi.editor.colors.*; +import com.intellij.openapi.editor.colors.EditorColorsManager; +import com.intellij.openapi.editor.colors.EditorColorsScheme; +import com.intellij.openapi.editor.colors.FontPreferences; +import com.intellij.openapi.editor.colors.ModifiableFontPreferences; import com.intellij.openapi.editor.colors.impl.AppEditorFontOptions; import com.intellij.openapi.editor.colors.impl.DelegateColorScheme; import com.intellij.openapi.editor.colors.impl.EditorColorsManagerImpl; @@ -54,7 +57,7 @@ public class EditorColorsSchemeDelegateTest extends AbstractEditorTest { } } - public void testSecondaryFontIsAvailable() throws Exception { + public void testSecondaryFontIsAvailable() { String secondaryFont = getExistingNonDefaultFontName(); FontPreferences globalPrefs = AppEditorFontOptions.getInstance().getFontPreferences(); FontPreferences tempCopy = new FontPreferencesImpl(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorImplTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorImplTest.java index f30aa775908b..c3a90464bfb1 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorImplTest.java @@ -38,14 +38,14 @@ import java.awt.*; import java.awt.datatransfer.StringSelection; public class EditorImplTest extends AbstractEditorTest { - public void testPositionCalculationForZeroWidthChars() throws Exception { + public void testPositionCalculationForZeroWidthChars() { initText("some\u2044text"); VisualPosition pos = new VisualPosition(0, 6); VisualPosition recalculatedPos = myEditor.xyToVisualPosition(myEditor.visualPositionToXY(pos)); assertEquals(pos, recalculatedPos); } - public void testPositionCalculationOnEmptyLine() throws Exception { + public void testPositionCalculationOnEmptyLine() { initText("text with\n" + "\n" + "empty line"); @@ -54,7 +54,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(pos, recalculatedPos); } - public void testShiftDragAddsToSelection() throws Exception { + public void testShiftDragAddsToSelection() { initText("A quick brown fox"); EditorTestUtil.setEditorVisibleSize(myEditor, 1000, 1000); // enable drag testing mouse().clickAt(0, 1); @@ -62,7 +62,7 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText("A quick brown fox"); } - public void testSoftWrapsRecalculationInASpecificCase() throws Exception { + public void testSoftWrapsRecalculationInASpecificCase() { configureFromFileText(getTestName(false) + ".java", "class Foo {\n" + "\t@Override\n" + @@ -89,7 +89,7 @@ public class EditorImplTest extends AbstractEditorTest { verifySoftWrapPositions(58, 93); } - public void testCorrectVisibleLineCountCalculation() throws Exception { + public void testCorrectVisibleLineCountCalculation() { initText("line containing FOLDED_REGION\n" + "next line\n" + "last line"); @@ -103,7 +103,7 @@ public class EditorImplTest extends AbstractEditorTest { "last line"); } - public void testInsertingFirstTab() throws Exception { + public void testInsertingFirstTab() { initText(" space-indented line"); configureSoftWraps(100); myEditor.getSettings().setUseTabCharacter(true); @@ -112,7 +112,7 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText(" \tspace-indented line"); } - public void testNoExceptionDuringBulkModeDocumentUpdate() throws Exception { + public void testNoExceptionDuringBulkModeDocumentUpdate() { initText("something"); DocumentEx document = (DocumentEx)myEditor.getDocument(); runWriteCommand(() -> { @@ -124,7 +124,7 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText("something\telse"); } - public void testCaretMergeDuringBulkModeDocumentUpdate() throws Exception { + public void testCaretMergeDuringBulkModeDocumentUpdate() { initText("abcdefg\n" + "abcdefg"); runWriteCommand(() -> { @@ -140,7 +140,7 @@ public class EditorImplTest extends AbstractEditorTest { "ag"); } - public void testPositionCalculationForOneCharacterFolds() throws Exception { + public void testPositionCalculationForOneCharacterFolds() { initText("something"); addCollapsedFoldRegion(1, 2, "..."); addCollapsedFoldRegion(3, 4, "..."); @@ -148,7 +148,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new VisualPosition(0, 5), myEditor.logicalToVisualPosition(new LogicalPosition(0, 3))); } - public void testNavigationIntoFoldedRegionWithSoftWrapsEnabled() throws Exception { + public void testNavigationIntoFoldedRegionWithSoftWrapsEnabled() { initText("something"); addCollapsedFoldRegion(4, 8, "..."); configureSoftWraps(1000); @@ -158,7 +158,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new VisualPosition(0, 5), myEditor.getCaretModel().getVisualPosition()); } - public void testPositionCalculationForMultilineFoldingWithEmptyPlaceholder() throws Exception { + public void testPositionCalculationForMultilineFoldingWithEmptyPlaceholder() { initText("line1\n" + "line2\n" + "line3\n" + @@ -169,7 +169,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new LogicalPosition(3, 0), myEditor.visualToLogicalPosition(new VisualPosition(2, 0))); } - public void testNavigationInsideNonNormalizedLineTerminator() throws Exception { + public void testNavigationInsideNonNormalizedLineTerminator() { initText(""); ((DocumentImpl)myEditor.getDocument()).setAcceptSlashR(true); runWriteCommand(() -> myEditor.getDocument().insertString(0, "abc\r\ndef")); @@ -180,7 +180,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new VisualPosition(0, 3), myEditor.getCaretModel().getVisualPosition()); } - public void testSoftWrapModeUpdateDuringBulkModeChange() throws Exception { + public void testSoftWrapModeUpdateDuringBulkModeChange() { initText("long long line"); configureSoftWraps(12); DocumentEx document = (DocumentEx)myEditor.getDocument(); @@ -193,7 +193,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new VisualPosition(1, 5), myEditor.getCaretModel().getVisualPosition()); } - public void testSuccessiveBulkModeOperations() throws Exception { + public void testSuccessiveBulkModeOperations() { initText("some text"); DocumentEx document = (DocumentEx)myEditor.getDocument(); @@ -213,7 +213,7 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText("some+text"); } - public void testCorrectCaretPositionRestorationAfterMultipleFoldRegionsChange() throws Exception { + public void testCorrectCaretPositionRestorationAfterMultipleFoldRegionsChange() { initText("some long text"); final FoldRegion innerRegion = addCollapsedFoldRegion(0, 4, "..."); final FoldRegion outerRegion = addCollapsedFoldRegion(0, 9, "..."); @@ -226,21 +226,21 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText("some long text"); } - public void testEditorSizeCalculationOnOpening() throws Exception { + public void testEditorSizeCalculationOnOpening() { initText("a\nbbb\nccccc"); myEditor.getSettings().setAdditionalColumnsCount(0); myEditor.getSettings().setAdditionalLinesCount(0); assertEquals(new Dimension(50, 30), myEditor.getContentComponent().getPreferredSize()); } - public void testCollapsingRegionContainingSoftWrap() throws Exception { + public void testCollapsingRegionContainingSoftWrap() { initText("abcdef abcdef"); configureSoftWraps(10); addCollapsedFoldRegion(0, 13, "..."); assertEquals(new VisualPosition(0, 3), myEditor.offsetToVisualPosition(13)); } - public void testSizeRecalculationOnTurningSoftWrapsOff() throws Exception { + public void testSizeRecalculationOnTurningSoftWrapsOff() { initText("abc def"); myEditor.getSettings().setAdditionalColumnsCount(0); myEditor.getSettings().setAdditionalLinesCount(0); @@ -249,7 +249,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new Dimension(70, 10), myEditor.getContentComponent().getPreferredSize()); } - public void testUpdatingCaretPositionAfterBulkMode() throws Exception { + public void testUpdatingCaretPositionAfterBulkMode() { initText("abc"); runWriteCommand(() -> { DocumentEx document = (DocumentEx)myEditor.getDocument(); @@ -261,27 +261,27 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText("\n abc"); } - public void testAllowCaretPositioningInsideSoftWrapOnlyIfVirtualSpaceIsEnabled() throws Exception { + public void testAllowCaretPositioningInsideSoftWrapOnlyIfVirtualSpaceIsEnabled() { initText("abcdef abcdef"); configureSoftWraps(10); mouse().clickAt(0, 10); assertEquals(new VisualPosition(0, 7), myEditor.getCaretModel().getVisualPosition()); } - public void testXYToVisualPositionWhenPrefixIsSet() throws Exception { + public void testXYToVisualPositionWhenPrefixIsSet() { initText("abc"); configureSoftWraps(1000); // to make sure soft wrap character width is properly mocked ((EditorEx)myEditor).setPrefixTextAndAttributes(">", new TextAttributes()); assertEquals(new VisualPosition(0, 0), myEditor.xyToVisualPosition(new Point(1, 0))); } - public void testLogicalPositionCacheInvalidationAfterLineDeletion() throws Exception { + public void testLogicalPositionCacheInvalidationAfterLineDeletion() { initText("\n\t"); delete(); assertEquals(new LogicalPosition(0, 4), myEditor.offsetToLogicalPosition(1)); } - public void testSoftWrapsUpdateAfterEditorWasHidden() throws Exception { + public void testSoftWrapsUpdateAfterEditorWasHidden() { initText("long long line"); configureSoftWraps(6); verifySoftWrapPositions(5, 10); @@ -296,7 +296,7 @@ public class EditorImplTest extends AbstractEditorTest { verifySoftWrapPositions(); } - public void testUpDownNearDocumentTopAndBottom() throws Exception { + public void testUpDownNearDocumentTopAndBottom() { initText("abc\ndef\nghi"); up(); checkResultByText("abc\ndef\nghi"); @@ -312,7 +312,7 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText("abc\ndef\nghi"); } - public void testScrollingToCaretAtSoftWrap() throws Exception { + public void testScrollingToCaretAtSoftWrap() { initText("looooooooooooooooong wooooooooooooooooords"); configureSoftWraps(10); end(); @@ -322,7 +322,7 @@ public class EditorImplTest extends AbstractEditorTest { assertTrue(visibleArea.contains(caretPoint)); } - public void testChangingHighlightersInBulkModeListener() throws Exception { + public void testChangingHighlightersInBulkModeListener() { DocumentBulkUpdateListener.Adapter listener = new DocumentBulkUpdateListener.Adapter() { @Override public void updateFinished(@NotNull Document doc) { @@ -345,7 +345,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(8, highlighters[0].getEndOffset()); } - public void testChangingHighlightersAfterClearingFoldingsDuringFoldingBatchUpdate() throws Exception { + public void testChangingHighlightersAfterClearingFoldingsDuringFoldingBatchUpdate() { initText("abc\n\ndef"); addCollapsedFoldRegion(2, 6, "..."); runFoldingOperation(() -> { @@ -359,14 +359,14 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(8, highlighters[0].getEndOffset()); } - public void testShiftPressedBeforeDragOverLineNumbersIsFinished() throws Exception { + public void testShiftPressedBeforeDragOverLineNumbersIsFinished() { initText("abc\ndef\nghi"); EditorTestUtil.setEditorVisibleSize(myEditor, 1000, 1000); // enable drag testing mouse().pressAtLineNumbers(0).dragToLineNumbers(2).shift().release(); checkResultByText("abc\ndef\nghi"); } - public void testScrollingInEditorOfSmallHeight() throws Exception { + public void testScrollingInEditorOfSmallHeight() { initText("abc\n"); int heightInPixels = (int)(myEditor.getLineHeight() * 1.5); EditorTestUtil.setEditorVisibleSizeInPixels(myEditor, @@ -379,7 +379,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(heightInPixels - myEditor.getLineHeight(), myEditor.getScrollingModel().getVerticalScrollOffset()); } - public void testEditorWithSoftWrapsBecomesVisibleAfterDocumentTextRemoval() throws Exception { + public void testEditorWithSoftWrapsBecomesVisibleAfterDocumentTextRemoval() { initText("abc def ghi"); configureSoftWraps(3); JViewport viewport = ((EditorEx)myEditor).getScrollPane().getViewport(); @@ -392,7 +392,7 @@ public class EditorImplTest extends AbstractEditorTest { verifySoftWrapPositions(); } - public void testDocumentChangeAfterEditorDisposal() throws Exception { + public void testDocumentChangeAfterEditorDisposal() { EditorFactory editorFactory = EditorFactory.getInstance(); Document document = editorFactory.createDocument("ab"); @@ -407,12 +407,12 @@ public class EditorImplTest extends AbstractEditorTest { runWriteCommand(() -> document.setText("cd")); // should run without throwing an exception } - public void testLineLengthMatchingLogicalPositionCacheFrequency() throws Exception { + public void testLineLengthMatchingLogicalPositionCacheFrequency() { initText("\t" + StringUtil.repeat(" ", 1023)); assertEquals(new LogicalPosition(0, 1027), myEditor.offsetToLogicalPosition(1024)); } - public void testSpecialCaseOfCaretPositionUpdateOnFolding() throws Exception { + public void testSpecialCaseOfCaretPositionUpdateOnFolding() { initText("abc\ndef\nghi"); FoldRegion region = addCollapsedFoldRegion(1, 11, "..."); runWriteCommand(()-> myEditor.getDocument().deleteString(7, 8)); @@ -421,7 +421,7 @@ public class EditorImplTest extends AbstractEditorTest { assertFalse(region.isExpanded()); } - public void testEditingNearInlayInBulkMode() throws Exception { + public void testEditingNearInlayInBulkMode() { initText("abc"); addInlay(1); runWriteCommand(()-> DocumentUtil.executeInBulk(myEditor.getDocument(), true, @@ -430,7 +430,7 @@ public class EditorImplTest extends AbstractEditorTest { assertTrue(myEditor.getInlayModel().hasInlineElementAt(1)); } - public void testCoordinateConversionsAroundSurrogatePair() throws Exception { + public void testCoordinateConversionsAroundSurrogatePair() { initText("a" + SURROGATE_PAIR + "b"); assertEquals(new LogicalPosition(0, 2), myEditor.offsetToLogicalPosition(3)); assertEquals(3, myEditor.logicalPositionToOffset(new LogicalPosition(0, 2))); @@ -438,7 +438,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new LogicalPosition(0, 2), myEditor.visualToLogicalPosition(new VisualPosition(0, 2))); } - public void testCreationOfSurrogatePairByMergingDividedParts() throws Exception { + public void testCreationOfSurrogatePairByMergingDividedParts() { initText(""); // Cannot set up text with singular surrogate characters directly runWriteCommand(() -> { myEditor.getDocument().setText(HIGH_SURROGATE + " " + LOW_SURROGATE); @@ -448,7 +448,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new LogicalPosition(0, 1), myEditor.offsetToLogicalPosition(2)); } - public void testCaretDoesntGetInsideSurrogatePair() throws Exception { + public void testCaretDoesntGetInsideSurrogatePair() { initText(""); // Cannot set up text with singular surrogate characters directly runWriteCommand(() -> myEditor.getDocument().setText(HIGH_SURROGATE + LOW_SURROGATE + LOW_SURROGATE)); myEditor.getCaretModel().moveToOffset(2); @@ -456,7 +456,7 @@ public class EditorImplTest extends AbstractEditorTest { assertFalse(DocumentUtil.isInsideSurrogatePair(myEditor.getDocument(), myEditor.getCaretModel().getOffset())); } - public void testFoldingBoundaryDoesntGetInsideSurrogatePair() throws Exception { + public void testFoldingBoundaryDoesntGetInsideSurrogatePair() { initText(""); // Cannot set up text with singular surrogate characters directly runWriteCommand(() -> myEditor.getDocument().setText(HIGH_SURROGATE + LOW_SURROGATE + LOW_SURROGATE)); addFoldRegion(2, 3, "..."); @@ -465,7 +465,7 @@ public class EditorImplTest extends AbstractEditorTest { assertFalse(foldRegions.length > 0 && DocumentUtil.isInsideSurrogatePair(myEditor.getDocument(), foldRegions[0].getStartOffset())); } - public void testRemovalOfNonExpandingFoldingRegion() throws Exception { + public void testRemovalOfNonExpandingFoldingRegion() { initText("a\nb"); FoldingModelEx model = (FoldingModelEx)myEditor.getFoldingModel(); Ref regionRef = new Ref<>(); @@ -480,7 +480,7 @@ public class EditorImplTest extends AbstractEditorTest { assertEquals(new VisualPosition(1, 1), myEditor.offsetToVisualPosition(3)); } - public void testPasteWithStickySelection() throws Exception { + public void testPasteWithStickySelection() { initText("abc\ndef"); copy(); down(); @@ -493,7 +493,7 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText("abc\nabc"); } - public void testPasteInVirtualSpaceWhenSelectionExists() throws Exception { + public void testPasteInVirtualSpaceWhenSelectionExists() { initText("foo"); myEditor.getSettings().setVirtualSpace(true); mouse().clickAt(0, 10); @@ -503,7 +503,7 @@ public class EditorImplTest extends AbstractEditorTest { checkResultByText("bar"); } - public void testMoveTextNearInlayAtBrokenSurrogates() throws Exception { + public void testMoveTextNearInlayAtBrokenSurrogates() { initText(""); // Cannot set up text with singular surrogate characters directly runWriteCommand(() -> myEditor.getDocument().setText(LOW_SURROGATE + HIGH_SURROGATE)); Inlay inlay = addInlay(2); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorInlayTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorInlayTest.java index 60a0dfe2f447..446123746972 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorInlayTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorInlayTest.java @@ -30,7 +30,7 @@ import java.util.Arrays; import static org.junit.Assert.assertArrayEquals; public class EditorInlayTest extends AbstractEditorTest { - public void testCaretMovement() throws Exception { + public void testCaretMovement() { initText("ab"); addInlay(1); right(); @@ -47,7 +47,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(0, 0, 0); } - public void testFoldedInlay() throws Exception { + public void testFoldedInlay() { initText("abc"); addInlay(1); addCollapsedFoldRegion(1, 2, "."); @@ -57,7 +57,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(2, 2, 2); } - public void testCaretMovementWithSelection() throws Exception { + public void testCaretMovementWithSelection() { initText("ab"); addInlay(1); rightWithSelection(); @@ -80,7 +80,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPositionAndSelection(2, 2, 3, 2, 2); } - public void testBackspace() throws Exception { + public void testBackspace() { initText("abc"); addInlay(1); backspace(); @@ -94,7 +94,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(0, 0, 0); } - public void testDelete() throws Exception { + public void testDelete() { initText("abc"); addInlay(2); delete(); @@ -108,7 +108,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(1, 1, 2); } - public void testMulticaretDelete() throws Exception { + public void testMulticaretDelete() { initText("ab ab"); addInlay(1); addInlay(4); @@ -119,7 +119,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkResultByText("a a"); } - public void testMulticaretTyping() throws Exception { + public void testMulticaretTyping() { initText("ab ab"); addInlay(1); addInlay(4); @@ -135,21 +135,21 @@ public class EditorInlayTest extends AbstractEditorTest { ContainerUtil.map(myEditor.getCaretModel().getAllCarets(), Caret::getVisualPosition)); } - public void testDocumentEditingWithSoftWraps() throws Exception { + public void testDocumentEditingWithSoftWraps() { initText("long line"); configureSoftWraps(7); Inlay inlay = addInlay(1); assertNotNull(myEditor.getSoftWrapModel().getSoftWrap(5)); new WriteCommandAction.Simple(ourProject) { @Override - protected void run() throws Throwable { + protected void run() { myEditor.getDocument().setText(" "); } }.execute(); assertFalse(inlay.isValid()); } - public void testInlayDoesntGetInsideSurrogatePair() throws Exception { + public void testInlayDoesntGetInsideSurrogatePair() { initText(""); // Cannot set up text with singular surrogate characters directly runWriteCommand(() -> myEditor.getDocument().setText(HIGH_SURROGATE + LOW_SURROGATE + LOW_SURROGATE)); Inlay inlay = addInlay(2); @@ -159,7 +159,7 @@ public class EditorInlayTest extends AbstractEditorTest { assertFalse(inlay.isValid() && DocumentUtil.isInsideSurrogatePair(myEditor.getDocument(), inlay.getOffset())); } - public void testTwoInlaysAtSameOffset() throws Exception { + public void testTwoInlaysAtSameOffset() { initText("ab"); addInlay(1); addInlay(1); @@ -181,7 +181,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(0, 0, 0); } - public void testTypingBetweenInlaysAtSameOffset() throws Exception { + public void testTypingBetweenInlaysAtSameOffset() { initText("ab"); Inlay inlay1 = addInlay(1); Inlay inlay2 = addInlay(1); @@ -196,14 +196,14 @@ public class EditorInlayTest extends AbstractEditorTest { assertEquals(2, inlay2.getOffset()); } - public void testHasInlayAtVisualPosition() throws Exception { + public void testHasInlayAtVisualPosition() { initText("ab"); addInlay(1); addInlay(1); assertTrue(myEditor.getInlayModel().hasInlineElementAt(new VisualPosition(0, 2))); } - public void testBackspaceWithTwoInlaysAtSameOffset() throws Exception { + public void testBackspaceWithTwoInlaysAtSameOffset() { initText("abc"); addInlay(1); addInlay(1); @@ -221,7 +221,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(0, 0, 0); } - public void testDeleteWithTwoInlaysAtSameOffset() throws Exception { + public void testDeleteWithTwoInlaysAtSameOffset() { initText("abc"); addInlay(2); addInlay(2); @@ -239,7 +239,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(1, 1, 3); } - public void testSelectionWithTwoInlaysAtSameOffset() throws Exception { + public void testSelectionWithTwoInlaysAtSameOffset() { initText("ab"); addInlay(1); addInlay(1); @@ -263,7 +263,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPositionAndSelection(2, 2, 4, 2, 2); } - public void testDeleteBetweenInlays() throws Exception { + public void testDeleteBetweenInlays() { initText("abc"); addInlay(1); addInlay(2); @@ -275,7 +275,7 @@ public class EditorInlayTest extends AbstractEditorTest { assertInlaysPositions(1, 1); } - public void testCaretPositionAfterInlayDisposalToTheLeft() throws Exception { + public void testCaretPositionAfterInlayDisposalToTheLeft() { initText("ab"); Inlay inlay = addInlay(1); addInlay(1); @@ -285,7 +285,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(1, 1, 1); } - public void testCaretPositionAfterInlayDisposalToTheRight() throws Exception { + public void testCaretPositionAfterInlayDisposalToTheRight() { initText("ab"); addInlay(1); Inlay inlay = addInlay(1); @@ -295,7 +295,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(1, 1, 2); } - public void testPositionConversionForAdjacentInlays() throws Exception { + public void testPositionConversionForAdjacentInlays() { initText("ab"); addInlay(1); addInlay(1); @@ -304,7 +304,7 @@ public class EditorInlayTest extends AbstractEditorTest { assertFalse(lp.leansForward); } - public void testFoldingOperationDoesntMoveCaretFromBetweenInlays() throws Exception { + public void testFoldingOperationDoesntMoveCaretFromBetweenInlays() { initText("abc"); addInlay(2); addInlay(2); @@ -315,7 +315,7 @@ public class EditorInlayTest extends AbstractEditorTest { checkCaretPosition(2, 2, 5); } - public void testBehaviourOnTextInsertion() throws Exception { + public void testBehaviourOnTextInsertion() { initText("abc"); Inlay i1 = addInlay(1, false); Inlay i2 = addInlay(2, true); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorLastActionTrackerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorLastActionTrackerTest.java index f5b5b3be9e5c..3506dec34ad1 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorLastActionTrackerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorLastActionTrackerTest.java @@ -52,21 +52,21 @@ public class EditorLastActionTrackerTest extends LightPlatformCodeInsightFixture super.tearDown(); } - public void testLastActionIsAvailable() throws Exception { + public void testLastActionIsAvailable() { assertEquals(SAMPLE_ACTION, myTracker.getLastActionId()); } - public void testMouseClickClearsLastAction() throws Exception { + public void testMouseClickClearsLastAction() { new EditorMouseFixture((EditorImpl)myFixture.getEditor()).clickAt(0, 1); assertNull(myTracker.getLastActionId()); } - public void testTypingClearsLastAction() throws Exception { + public void testTypingClearsLastAction() { myFixture.type('A'); assertNull(myTracker.getLastActionId()); } - public void testTwoEditors() throws Exception { + public void testTwoEditors() { myFixture.configureByText(getTestName(true) + "-other.txt", "doesn't matter as well"); myFixture.performEditorAction(SAMPLE_ACTION); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorRtlTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorRtlTest.java index f5808f60b9aa..d0afdf20256c 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorRtlTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorRtlTest.java @@ -469,7 +469,7 @@ public class EditorRtlTest extends AbstractRtlTest { checkResult("RR"); } - public void testUsingLexerForBidiLayout() throws Exception { + public void testUsingLexerForBidiLayout() { prepare("class Foo {\n int R = 1;\n}", TestFileType.JAVA); right(); right(); @@ -477,7 +477,7 @@ public class EditorRtlTest extends AbstractRtlTest { checkResult("class Foo {\n int R = 1;\n}"); } - public void testJavadocTokensAreMergedForBidiLayoutPurposes() throws Exception { + public void testJavadocTokensAreMergedForBidiLayoutPurposes() { prepare("/**R R*/ class Foo {}", TestFileType.JAVA); for (int i = 0; i < 4; i++) { right(); @@ -486,7 +486,7 @@ public class EditorRtlTest extends AbstractRtlTest { checkResult("/**R R*/ class Foo {}"); } - public void testXmlTextIsLaidOutCorrectly() throws Exception { + public void testXmlTextIsLaidOutCorrectly() { prepare("R R", TestFileType.XML); for (int i = 0; i < 4; i++) { right(); @@ -558,21 +558,21 @@ public class EditorRtlTest extends AbstractRtlTest { checkResult("R\tRR"); } - public void testEscapedBackslashInStringLiteral() throws Exception { + public void testEscapedBackslashInStringLiteral() { prepare("class C {\n String s = \"R\\\\R\";\n}", TestFileType.JAVA); right(); right(); checkResult("class C {\n String s = \"R\\\\R\";\n}"); } - public void testRtlLayoutPersistsAfterEditing() throws Exception { + public void testRtlLayoutPersistsAfterEditing() { prepare("\nRR", TestFileType.TEXT); delete(); checkResult("RR"); assertTrue(myEditor.getCaretModel().getPrimaryCaret().isAtBidiRunBoundary()); } - public void testTokenOrderIsAlwaysLtr() throws Exception { + public void testTokenOrderIsAlwaysLtr() { BidiTextDirection savedValue = EditorSettingsExternalizable.getInstance().getBidiTextDirection(); try { EditorSettingsExternalizable.getInstance().setBidiTextDirection(BidiTextDirection.RTL); @@ -585,13 +585,13 @@ public class EditorRtlTest extends AbstractRtlTest { } } - public void testLineCommentLayout() throws Exception { + public void testLineCommentLayout() { prepare("// R", TestFileType.JAVA); right(); checkResult("// R"); } - public void testIndentIsTreatedSeparately() throws Exception { + public void testIndentIsTreatedSeparately() { checkBidiRunBoundaries(" |R", "txt"); } } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorStressTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorStressTest.java index a94518748726..dc90507e1259 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorStressTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/EditorStressTest.java @@ -99,7 +99,7 @@ public class EditorStressTest extends AbstractEditorTest { int offset = random.nextInt(document.getTextLength() + 1); new WriteCommandAction.Simple(getProject()) { @Override - protected void run() throws Throwable { + protected void run() { document.insertString(offset, myText); } }.execute().throwException(); @@ -115,7 +115,7 @@ public class EditorStressTest extends AbstractEditorTest { int offset = random.nextInt(textLength); new WriteCommandAction.Simple(getProject()) { @Override - protected void run() throws Throwable { + protected void run() { document.deleteString(offset, offset + 1); } }.execute().throwException(); @@ -133,7 +133,7 @@ public class EditorStressTest extends AbstractEditorTest { if (targetOffset < offset || targetOffset > offset + 1) { new WriteCommandAction.Simple(getProject()) { @Override - protected void run() throws Throwable { + protected void run() { ((DocumentEx)document).moveText(offset, offset + 1, targetOffset); } }.execute().throwException(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/FoldingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/FoldingTest.java index 2e5d03a46a1c..443633ae6f9b 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/FoldingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/FoldingTest.java @@ -65,7 +65,7 @@ public class FoldingTest extends AbstractEditorTest { assertSize(1, myModel.getAllFoldRegions()); } - public void testIntersects () throws Exception { + public void testIntersects () { myModel.runBatchFoldingOperation(() -> { FoldRegion region = myModel.addFoldRegion(5, 10, "."); assertNotNull(region); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java index d441c61209ce..17d09e1b5898 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/GuardBlockTest.java @@ -15,7 +15,7 @@ public class GuardBlockTest extends LightPlatformCodeInsightFixtureTestCase { return document.createGuardedBlock(start, end); } - public void testZero() throws Exception { + public void testZero() { myFixture.configureByText("x.txt", "xxxx"); RangeMarker guard = createGuard(0, 0); guard.setGreedyToLeft(true); @@ -24,14 +24,14 @@ public class GuardBlockTest extends LightPlatformCodeInsightFixtureTestCase { checkCanTypeIn(1); } - public void testInTheMiddle() throws Exception { + public void testInTheMiddle() { myFixture.configureByText("x.txt", "xxxxxxxx"); createGuard(1, 4); checkUnableToTypeIn(2); checkCanTypeIn(0); } - public void testGreedy() throws Exception { + public void testGreedy() { myFixture.configureByText("x.txt", "012345678"); { RangeMarker guard = createGuard(0, 5); @@ -46,7 +46,7 @@ public class GuardBlockTest extends LightPlatformCodeInsightFixtureTestCase { checkCanTypeIn(5); checkUnableToTypeIn(0); } - public void testGreedyEnd() throws Exception { + public void testGreedyEnd() { myFixture.configureByText("x.txt", "012345678"); { RangeMarker guard = createGuard(0, 5); @@ -75,7 +75,7 @@ public class GuardBlockTest extends LightPlatformCodeInsightFixtureTestCase { myFixture.type("yy"); } - public void testNoCompletion() throws Exception { + public void testNoCompletion() { String text = "abc abd a abx"; myFixture.configureByText("x.txt", text); int offset = myFixture.getEditor().getCaretModel().getOffset(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/ImmediatePainterTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/ImmediatePainterTest.java index 75fb3e03344d..5bc17644b148 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/ImmediatePainterTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/ImmediatePainterTest.java @@ -208,7 +208,7 @@ public class ImmediatePainterTest extends AbstractEditorTest { // assertTypedCorrectly(1, '+'); //} - protected void init(String text) throws IOException { + protected void init(String text) { init(text, TestFileType.TEXT); myEditor.getSettings().setAdditionalLinesCount(0); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeMarkerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeMarkerTest.java index 5f909a63ce97..bd43522b26f6 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeMarkerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/RangeMarkerTest.java @@ -95,7 +95,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { super.tearDown(); } - public void testCreation() throws Exception { + public void testCreation() { RangeMarker marker = createMarker("0123456789", 2, 5); assertEquals(2, marker.getStartOffset()); @@ -103,7 +103,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testDeleteBeforeStart() throws Exception { + public void testDeleteBeforeStart() { RangeMarker marker = createMarker("01[234]56789"); marker.getDocument().deleteString(0, 1); @@ -113,7 +113,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testInsertIntoRange() throws Exception { + public void testInsertIntoRange() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().insertString(4, "xxx"); @@ -123,7 +123,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testInsertIntoPoint() throws Exception { + public void testInsertIntoPoint() { RangeMarker marker = createMarker("0123456789", 2, 2); marker.getDocument().insertString(2, "xxx"); @@ -133,7 +133,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testDeletePoint() throws Exception { + public void testDeletePoint() { RangeMarker marker = createMarker("0123456789", 2, 2); marker.getDocument().deleteString(1, 3); @@ -141,7 +141,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertFalse(marker.isValid()); } - public void testDeleteRangeInside() throws Exception { + public void testDeleteRangeInside() { RangeMarker marker = createMarker("0123456789", 1, 7); marker.getDocument().deleteString(2, 5); @@ -149,7 +149,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testReplaceRangeToSingleChar() throws Exception { + public void testReplaceRangeToSingleChar() { RangeMarker marker = createMarker("0123456789", 1, 7); marker.getDocument().replaceString(2, 5, " "); @@ -157,13 +157,13 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testReplaceWholeRange() throws Exception { + public void testReplaceWholeRange() { RangeMarker marker = createMarker("0123456789", 1, 7); marker.getDocument().replaceString(1, 7, "abc"); assertValidMarker(marker, 1, 4); } - public void testUpdateInvalid() throws Exception { + public void testUpdateInvalid() { RangeMarker marker = createMarker("01[]23456789"); marker.getDocument().deleteString(1, 3); @@ -176,7 +176,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertFalse(marker.isValid()); } - public void testInsertAfterEnd() throws Exception { + public void testInsertAfterEnd() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().insertString(6, "xxx"); @@ -187,7 +187,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { } - public void testDeleteEndPart() throws Exception { + public void testDeleteEndPart() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().deleteString(4, 6); @@ -195,7 +195,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 2, 4); } - public void testDeleteStartPart() throws Exception { + public void testDeleteStartPart() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().deleteString(0, 4); @@ -203,7 +203,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 0, 1); } - public void testReplaceStartPartInvalid() throws Exception { + public void testReplaceStartPartInvalid() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().replaceString(0, 4, "xxxx"); @@ -211,7 +211,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 4, 5); } - public void testDeleteFirstChar() throws Exception { + public void testDeleteFirstChar() { RangeMarker marker = createMarker("0123456789", 0, 5); marker.getDocument().deleteString(0, 1); @@ -219,7 +219,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 0, 4); } - public void testInsertBeforeStart() throws Exception { + public void testInsertBeforeStart() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().insertString(0, "xxx"); @@ -229,7 +229,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testInsertIntoStart() throws Exception { + public void testInsertIntoStart() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().insertString(2, "xxx"); @@ -237,7 +237,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 5, 8); } - public void testInsertIntoStartExpandToLeft() throws Exception { + public void testInsertIntoStartExpandToLeft() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.setGreedyToLeft(true); @@ -249,7 +249,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testInsertIntoEnd() throws Exception { + public void testInsertIntoEnd() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().insertString(5, "xxx"); @@ -259,7 +259,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testInsertIntoEndExpandRight() throws Exception { + public void testInsertIntoEndExpandRight() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.setGreedyToRight(true); @@ -271,7 +271,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertTrue(marker.isValid()); } - public void testNoNegative() throws Exception { + public void testNoNegative() { RangeMarker marker = createMarker("package safd;\n\n[import javax.swing.JPanel;]\nimport java.util.ArrayList;\n\nclass T{}"); marker.getDocument() @@ -280,7 +280,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertEquals(15, marker.getStartOffset()); } - public void testReplaceRightIncludingFirstChar() throws Exception { + public void testReplaceRightIncludingFirstChar() { String s = "12345\n \n12345"; RangeMarker marker = createMarker(s, 6, 8); @@ -289,7 +289,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 6, 7); } - public void testDeleteRightPart() throws Exception { + public void testDeleteRightPart() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().deleteString(4, 6); @@ -297,7 +297,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 2, 4); } - public void testDeleteRightPart2() throws Exception { + public void testDeleteRightPart2() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().deleteString(4, 5); @@ -305,7 +305,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 2, 4); } - public void testReplaceRightPartInvalid() throws Exception { + public void testReplaceRightPartInvalid() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().replaceString(4, 6, "xxx"); @@ -313,34 +313,34 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 2, 4); } - public void testDeleteWholeRange() throws Exception { + public void testDeleteWholeRange() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().deleteString(1, 6); assertFalse(marker.isValid()); } - public void testDeleteExactRange() throws Exception { + public void testDeleteExactRange() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().deleteString(2, 5); assertValidMarker(marker, 2, 2); } - public void testDeleteJustBeforeStart() throws Exception { + public void testDeleteJustBeforeStart() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().deleteString(0, 2); assertValidMarker(marker, 0, 3); } - public void testDeleteRightAfterEnd() throws Exception { + public void testDeleteRightAfterEnd() { RangeMarker marker = createMarker("0123456789", 2, 2); marker.getDocument().deleteString(2, 5); assertValidMarker(marker, 2, 2); } - public void testReplacementWithOldTextOverlap() throws Exception { + public void testReplacementWithOldTextOverlap() { RangeMarker marker = createMarker("0123456789", 2, 5); marker.getDocument().replaceString(0, 10, "0123456789"); @@ -349,7 +349,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { // Psi -> Document synchronization - public void testPsi2Doc1() throws Exception { + public void testPsi2Doc1() { StringBuilder buffer = new StringBuilder("0123456789"); RangeMarker marker = createMarker(buffer.toString(), 2, 5); synchronizer.startTransaction(getProject(), document, psiFile); @@ -364,7 +364,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 2, 6); } - public void testDocSynchronizerPrefersLineBoundaryChanges() throws Exception { + public void testDocSynchronizerPrefersLineBoundaryChanges() { String text = "import java.awt.List;\n" + "[import java.util.ArrayList;\n]" + "import java.util.HashMap;\n" + @@ -389,7 +389,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertEquals("DocumentEventImpl[myOffset=22, myOldLength=28, myNewLength=0, myOldString='import java.util.ArrayList;\n', myNewString=''].", event.toString()); } - public void testPsi2DocReplaceAfterAdd() throws Exception { + public void testPsi2DocReplaceAfterAdd() { StringBuilder buffer = new StringBuilder("0123456789"); RangeMarker marker = createMarker(buffer.toString(), 2, 5); synchronizer.startTransaction(getProject(), document, psiFile); @@ -426,7 +426,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertEquals("xxx", document.getText()); } - public void testPsi2DocMergeReplaceAfterAdd() throws Exception { + public void testPsi2DocMergeReplaceAfterAdd() { StringBuilder buffer = new StringBuilder("0123456789"); RangeMarker marker = createMarker(buffer.toString(), 2, 5); synchronizer.startTransaction(getProject(), document, psiFile); @@ -449,7 +449,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 3, 6); } - public void testPsi2DocMergeReplaceWithMultipleAdditions() throws Exception { + public void testPsi2DocMergeReplaceWithMultipleAdditions() { StringBuilder buffer = new StringBuilder("0123456789"); RangeMarker marker = createMarker(buffer.toString(), 2, 5); synchronizer.startTransaction(getProject(), document, psiFile); @@ -472,7 +472,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 2, 5); } - public void testPsi2DocMergeMultipleAdditionsWithReplace() throws Exception { + public void testPsi2DocMergeMultipleAdditionsWithReplace() { StringBuilder buffer = new StringBuilder("0123456789"); RangeMarker marker = createMarker(buffer.toString(), 2, 5); synchronizer.startTransaction(getProject(), document, psiFile); @@ -497,7 +497,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 2, 5); } - public void testPsi2DocSurround() throws Exception { + public void testPsi2DocSurround() { StringBuilder buffer = new StringBuilder("0123456789"); RangeMarker marker = createMarker(buffer.toString(), 2, 5); synchronizer.startTransaction(getProject(), document, psiFile); @@ -521,7 +521,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker, 2, 7); } - public void testPsi2DocForwardRangesChanges() throws Exception { + public void testPsi2DocForwardRangesChanges() { StringBuilder buffer = new StringBuilder("0123456789"); RangeMarker marker = createMarker(buffer.toString(), 2, 5); synchronizer.startTransaction(getProject(), document, psiFile); @@ -893,7 +893,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { final DocumentEx finalDocument = document; new WriteCommandAction(getProject()) { @Override - protected void run(@NotNull Result result) throws Exception { + protected void run(@NotNull Result result) { List> adds = new ArrayList<>(); List> dels = new ArrayList<>(); List> edits = new ArrayList<>(); @@ -977,7 +977,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { return createMarker(string, start, end); } - public void testRangeMarkersAreWeakReferenced_NoCommand() throws Exception { + public void testRangeMarkersAreWeakReferenced_NoCommand() { final Document document = EditorFactory.getInstance().createDocument("[xxxxxxxxxxxxxx]"); Set markers = ContainerUtil.newHashSet(); for (int i = 0; i < 10; i++) { @@ -987,7 +987,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { LeakHunter.checkLeak(document, RangeMarker.class, markers::contains); } - public void testRangeMarkersAreLazyCreated() throws Exception { + public void testRangeMarkersAreLazyCreated() { final Document document = EditorFactory.getInstance().createDocument("[xxxxxxxxxxxxxx]"); RangeMarker m1 = document.createRangeMarker(2, 4); RangeMarker m2 = document.createRangeMarker(2, 4); @@ -1015,7 +1015,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertEquals(2, ((DocumentImpl)document).getRangeMarkersSize()); assertEquals(2, ((DocumentImpl)document).getRangeMarkersNodeSize()); } - public void testRangeHighlightersRecreateBug() throws Exception { + public void testRangeHighlightersRecreateBug() { Document document = EditorFactory.getInstance().createDocument("[xxxxxxxxxxxxxx]"); MarkupModel markupModel = DocumentMarkupModel.forDocument(document, ourProject, true); @@ -1029,7 +1029,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertFalse(m3.isValid()); } } - public void testValidationBug() throws Exception { + public void testValidationBug() { Document document = EditorFactory.getInstance().createDocument("[xxxxxxxxxxxxxx]"); final Editor editor = EditorFactory.getInstance().createEditor(document); @@ -1046,7 +1046,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { EditorFactory.getInstance().releaseEditor(editor); } } - public void testPersistent() throws Exception { + public void testPersistent() { String text = "xxx\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"; Document document = EditorFactory.getInstance().createDocument(text); int startOffset = text.indexOf('z'); @@ -1069,7 +1069,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertFalse(normal.isValid()); } - public void testMoveTextRetargetsMarkers() throws Exception { + public void testMoveTextRetargetsMarkers() { RangeMarkerEx marker1 = createMarker("01234567890", 1, 3); DocumentEx document = (DocumentEx)marker1.getDocument(); RangeMarker marker2 = document.createRangeMarker(2, 4); @@ -1081,7 +1081,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker2, 5, 7); } - public void testMoveText2() throws Exception { + public void testMoveText2() { RangeMarkerEx marker1 = createMarker(StringUtil.repeat(" ",100), 0, 0); DocumentEx document = (DocumentEx)marker1.getDocument(); RangeMarker marker2 = document.createRangeMarker(49, 49); @@ -1091,7 +1091,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { marker2.dispose(); } - public void testMoveTextToTheBeginningRetargetsMarkers() throws Exception { + public void testMoveTextToTheBeginningRetargetsMarkers() { RangeMarkerEx marker1 = createMarker("01234567890", 5, 5); DocumentEx document = (DocumentEx)marker1.getDocument(); RangeMarker marker2 = document.createRangeMarker(5, 7); @@ -1103,7 +1103,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertValidMarker(marker2, 2, 4); } - public void testRangeHighlighterDisposeVsRemoveAllConflict() throws Exception { + public void testRangeHighlighterDisposeVsRemoveAllConflict() { Document document = EditorFactory.getInstance().createDocument("[xxxxxxxxxxxxxx]"); MarkupModel markupModel = DocumentMarkupModel.forDocument(document, ourProject, true); @@ -1116,7 +1116,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { assertFalse(m.isValid()); } - public void testRangeHighlighterLinesInRangeForLongLinePerformance() throws Exception { + public void testRangeHighlighterLinesInRangeForLongLinePerformance() { final int N = 50000; Document document = EditorFactory.getInstance().createDocument(StringUtil.repeatSymbol('x', 2 * N)); @@ -1137,7 +1137,7 @@ public class RangeMarkerTest extends LightPlatformTestCase { }).assertTiming(); } - public void testRangeHighlighterIteratorOrder() throws Exception { + public void testRangeHighlighterIteratorOrder() { Document document = EditorFactory.getInstance().createDocument("1234567890"); final MarkupModelEx markupModel = (MarkupModelEx)DocumentMarkupModel.forDocument(document, ourProject, true); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TrailingSpacesStripperTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TrailingSpacesStripperTest.java index fe203bc351fd..eb8f97f3e471 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TrailingSpacesStripperTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/TrailingSpacesStripperTest.java @@ -68,21 +68,21 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase }); } - public void testDoNotStripModifiedOnCurrentLine() throws IOException { + public void testDoNotStripModifiedOnCurrentLine() { doTest("xxx\n \nyyy", "xxx\n \nyyy"); } - public void testDoStripModifiedOnCurrentLineIfCaretWouldNotJump() throws IOException { + public void testDoStripModifiedOnCurrentLineIfCaretWouldNotJump() { doTest("xxx\n 222 \nyyy", "xxx\n 222\nyyy"); } - public void testStrippingWithMultipleCarets() throws Exception { + public void testStrippingWithMultipleCarets() { doTest("xxx\n \nyyy ", "xxx\n \nyyy"); } - public void testModifyAndAltTabAway() throws IOException { + public void testModifyAndAltTabAway() { configureFromFileText("x.txt", "xxx\nyyy"); type(' '); @@ -96,7 +96,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase checkResultByText("xxx \nyyy"); } - public void testOnlyModifiedLinesGetStripped() throws IOException { + public void testOnlyModifiedLinesGetStripped() { @NonNls String text = "xxx \nyyy "; configureFromFileText("x.txt", text); ((DocumentEx)myEditor.getDocument()).clearLineModificationFlags(); @@ -108,7 +108,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase checkResultByText("xxxz\nyyy "); } - public void testOnlyModifiedLinesWhenDoesNotAllowCaretAfterEndOfLine() throws IOException { + public void testOnlyModifiedLinesWhenDoesNotAllowCaretAfterEndOfLine() { configureFromFileText("x.txt", "xxx \nZ "); type(' '); myEditor.getCaretModel().moveToOffset(myEditor.getDocument().getText().indexOf('Z') + 1); @@ -118,7 +118,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase checkResultByText("xxx\nZZ"); } - public void testModifyLineAndExitApplication_ShouldStripEvenWhenCaretIsAtTheChangedLine() throws IOException { + public void testModifyLineAndExitApplication_ShouldStripEvenWhenCaretIsAtTheChangedLine() { configureFromFileText("x.txt", "xxx \n"); type(' '); @@ -134,7 +134,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase } } - public void testModifyLine_Save_MoveCaret_SaveAgain_ShouldStrip() throws IOException { + public void testModifyLine_Save_MoveCaret_SaveAgain_ShouldStrip() { configureFromFileText("x.txt", "xxx \nyyy\n"); type(' '); FileDocumentManager.getInstance().saveAllDocuments(); @@ -145,7 +145,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase checkResultByText("xxx\nyyy\n"); // now we can strip } - public void testDisableStrip_Modify_Save_EnableOnModifiedLines_Modify_Save_ShouldStripModifiedOnly() throws IOException { + public void testDisableStrip_Modify_Save_EnableOnModifiedLines_Modify_Save_ShouldStripModifiedOnly() { EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance(); settings.setStripTrailingSpaces(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE); @@ -163,7 +163,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase checkResultByText("xxx\nyyy \nzzz \n"); } - public void testDoNotStripModifiedLines_And_EnsureBlankLineAtTheEnd_LeavesWhitespacesAtTheEndOfFileAlone() throws IOException { + public void testDoNotStripModifiedLines_And_EnsureBlankLineAtTheEnd_LeavesWhitespacesAtTheEndOfFileAlone() { EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance(); settings.setStripTrailingSpaces(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE); settings.setEnsureNewLineAtEOF(true); @@ -178,7 +178,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase checkResultByText(" xxx \nyyy\n\t\t\t\n"); } - public void testOverrideStripTrailingSpaces() throws IOException { + public void testOverrideStripTrailingSpaces() { EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance(); settings.setStripTrailingSpaces(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE); configureFromFileText("x.txt", "xxx\n 222 \nyyy"); @@ -189,7 +189,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase checkResultByText("xxx \n 222\nyyy"); } - public void testOverrideEnsureNewline() throws IOException { + public void testOverrideEnsureNewline() { EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance(); settings.setEnsureNewLineAtEOF(false); configureFromFileText("x.txt", "XXX\nYYY"); @@ -199,7 +199,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase checkResultByText("XXX \nYYY\n"); } - public void testModifySameLineInTwoFilesAndSaveAllShouldStripAtLeastOneFile() throws IOException { + public void testModifySameLineInTwoFilesAndSaveAllShouldStripAtLeastOneFile() { EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance(); settings.setStripTrailingSpaces(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_CHANGED); @@ -233,7 +233,7 @@ public class TrailingSpacesStripperTest extends LightPlatformCodeInsightTestCase } @NotNull - private static Editor createHeavyEditor(@NotNull String name, @NotNull String text) throws IOException { + private static Editor createHeavyEditor(@NotNull String name, @NotNull String text) { VirtualFile myVFile = WriteAction.compute(() -> { try { VirtualFile file = getSourceRoot().createChildData(null, name); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/SoftWrapTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/SoftWrapTest.java index 932b6827cf58..9d6c2e953b76 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/SoftWrapTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/SoftWrapTest.java @@ -21,7 +21,6 @@ import com.intellij.openapi.editor.impl.AbstractEditorTest; import com.intellij.testFramework.EditorTestUtil; import com.intellij.testFramework.TestFileType; -import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; @@ -29,21 +28,21 @@ import java.util.regex.Pattern; public class SoftWrapTest extends AbstractEditorTest { - public void testCollapsedRegionWithLongPlaceholderAtLineStart1() throws IOException { + public void testCollapsedRegionWithLongPlaceholderAtLineStart1() { doTestSoftWraps(10, "foo"); } - public void testCollapsedRegionWithLongPlaceholderAtLineStart2() throws IOException { + public void testCollapsedRegionWithLongPlaceholderAtLineStart2() { doTestSoftWraps(10, "foobar"); } - public void testCollapsedRegionWithLongPlaceholderAtLineStart3() throws IOException { + public void testCollapsedRegionWithLongPlaceholderAtLineStart3() { doTestSoftWraps(10, "foo\nvery long text"); } private static final String TAGS_PATTERN = "()|()|"; - private void doTestSoftWraps(int wrapWidth, String text) throws IOException { + private void doTestSoftWraps(int wrapWidth, String text) { List foldRegions = new ArrayList<>(); List wrapPositions = new ArrayList<>(); int foldInsertPosition = 0; diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java index e9d0b5a34c1b..3011b318c030 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java @@ -894,7 +894,7 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT assertEmpty(getSoftWrapModel().getRegisteredSoftWraps()); } - public void testMultiLineFoldRegionBeforeWrapPosition() throws IOException { + public void testMultiLineFoldRegionBeforeWrapPosition() { final String text = "package org.denis;\n" + "\n" + @@ -1043,7 +1043,7 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT assertEquals(new LogicalPosition(0, 0), myEditor.visualToLogicalPosition(new VisualPosition(0, 0))); } - public void testOnlyMinimalRangeIsRecalculatedOnDocumentChange() throws IOException { + public void testOnlyMinimalRangeIsRecalculatedOnDocumentChange() { init("aa bb cc dd ee ff gg hh ii jj", TestFileType.TEXT); EditorTestUtil.configureSoftWraps(myEditor, 8); verifySoftWrapPositions(6, 12, 18, 24); @@ -1065,7 +1065,7 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT assertEquals(19, event[0].getActualEndOffset()); } - public void testPositionsAreCorrectAfterIncrementalRecalculation() throws IOException { + public void testPositionsAreCorrectAfterIncrementalRecalculation() { initText("abra cadabra"); configureSoftWraps(10); type(' '); @@ -1074,7 +1074,7 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT assertEquals(new VisualPosition(1, 1), myEditor.offsetToVisualPosition(6)); } - public void testSoftWrappingWithFoldRegionAndTabs() throws IOException { + public void testSoftWrappingWithFoldRegionAndTabs() { initText("foldA\t\t\t\t"); addCollapsedFoldRegion(0, 4, "."); configureSoftWraps(10); @@ -1082,7 +1082,7 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT assertNull(myEditor.getSoftWrapModel().getSoftWrap(4)); } - public void testSoftWrapsAreNotCreatedInsideFoldRegions() throws Exception { + public void testSoftWrapsAreNotCreatedInsideFoldRegions() { initText("\t\t\taaaaa\t"); addCollapsedFoldRegion(7, 9, "."); configureSoftWraps(10); @@ -1090,14 +1090,14 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT assertNull(myEditor.getSoftWrapModel().getSoftWrap(8)); } - public void testUnbreakableLinesDontAffectFollowingLines() throws Exception { + public void testUnbreakableLinesDontAffectFollowingLines() { initText("unbreakableLine\nshort line"); configureSoftWraps(10); verifySoftWrapPositions(); } - public void testFoldRegionPreventsLaterWrapping() throws Exception { + public void testFoldRegionPreventsLaterWrapping() { initText("unbreakableText.txt"); configureSoftWraps(10); verifySoftWrapPositions(15); @@ -1108,7 +1108,7 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT assertEquals(1, myEditor.offsetToVisualPosition(19).line); } - public void testMoveWithFoldRegionInside() throws Exception { + public void testMoveWithFoldRegionInside() { initText("abc\ndef\nghi\n"); configureSoftWraps(100); addCollapsedFoldRegion(0, 4, "..."); @@ -1127,11 +1127,11 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorT init(visibleWidthInColumns * symbolWidthInPixels, fileText, symbolWidthInPixels); } - private void init(final int visibleWidth, @NotNull String fileText, int symbolWidth) throws IOException { + private void init(final int visibleWidth, @NotNull String fileText, int symbolWidth) { init(visibleWidth, fileText, TestFileType.TEXT, symbolWidth); } - private void init(final int visibleWidth, @NotNull String fileText, @NotNull TestFileType fileType, final int symbolWidth) throws IOException { + private void init(final int visibleWidth, @NotNull String fileText, @NotNull TestFileType fileType, final int symbolWidth) { init(fileText, fileType); EditorTestUtil.configureSoftWraps(myEditor, visibleWidth, symbolWidth); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/view/VisualLinesIteratorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/view/VisualLinesIteratorTest.java index e5de612e9c42..8b786900610f 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/view/VisualLinesIteratorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/impl/view/VisualLinesIteratorTest.java @@ -18,10 +18,8 @@ package com.intellij.openapi.editor.impl.view; import com.intellij.openapi.editor.impl.AbstractEditorTest; import com.intellij.openapi.editor.impl.EditorImpl; -import java.io.IOException; - public class VisualLinesIteratorTest extends AbstractEditorTest { - public void testWrapAfterFolding() throws IOException { + public void testWrapAfterFolding() { initText("abcdefghij"); addCollapsedFoldRegion(1, 8, "..."); configureSoftWraps(4); @@ -38,7 +36,7 @@ public class VisualLinesIteratorTest extends AbstractEditorTest { assertEquals(1, it.getStartFoldingIndex()); } - public void testWrapAtFoldedLineBreak() throws IOException { + public void testWrapAtFoldedLineBreak() { initText("abc\ndef"); addCollapsedFoldRegion(3, 4, "..."); configureSoftWraps(6); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/editor/richcopy/SyntaxInfoConstructionTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/editor/richcopy/SyntaxInfoConstructionTest.java index 8e664e73d044..194c150b3caf 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/editor/richcopy/SyntaxInfoConstructionTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/editor/richcopy/SyntaxInfoConstructionTest.java @@ -219,7 +219,7 @@ public class SyntaxInfoConstructionTest extends LightPlatformCodeInsightFixtureT "text= \n"); } - public void testIndentStrippingWhenFirstLineIsMostIndented() throws Exception { + public void testIndentStrippingWhenFirstLineIsMostIndented() { init("public class Test {\n" + " int field;\n" + "}"); @@ -231,7 +231,7 @@ public class SyntaxInfoConstructionTest extends LightPlatformCodeInsightFixtureT "text=}\n"); } - public void testIndentStrippingWhenSelectionEndIsBeforeNonWsCharactersOnTheLine() throws Exception { + public void testIndentStrippingWhenSelectionEndIsBeforeNonWsCharactersOnTheLine() { init("public class Test {\n" + " int field;\n" + "}"); @@ -241,7 +241,7 @@ public class SyntaxInfoConstructionTest extends LightPlatformCodeInsightFixtureT "\n"); } - public void testSlashRSeparator() throws Exception { + public void testSlashRSeparator() { String text = "package org;\r" + "\r" + "public class TestClass {\r" + @@ -268,7 +268,7 @@ public class SyntaxInfoConstructionTest extends LightPlatformCodeInsightFixtureT "text=}\n"); } - public void testSlashRSlashNSeparator() throws Exception { + public void testSlashRSlashNSeparator() { String text = "package org;\r\n" + "\r\n" + "public class TestClass {\r\n" + @@ -295,7 +295,7 @@ public class SyntaxInfoConstructionTest extends LightPlatformCodeInsightFixtureT "text=}\n"); } - public void testNonPhysicalFile() throws Exception { + public void testNonPhysicalFile() { String fileName = "Test.java"; FileType fileType = FileTypeRegistry.getInstance().getFileTypeByFileName(fileName); PsiFile psiFile = PsiFileFactory.getInstance(getProject()).createFileFromText(fileName, fileType, "class Test {}", 0, false); @@ -335,27 +335,27 @@ public class SyntaxInfoConstructionTest extends LightPlatformCodeInsightFixtureT assertEquals((float)editor.getColorsScheme().getEditorFontSize(), syntaxInfo.getFontSize(), 0.01f); syntaxInfo.processOutputInfo(new MarkupHandler() { @Override - public void handleText(int startOffset, int endOffset) throws Exception { + public void handleText(int startOffset, int endOffset) { builder.append("text=").append(text.substring(startOffset, endOffset)).append('\n'); } @Override - public void handleForeground(int foregroundId) throws Exception { + public void handleForeground(int foregroundId) { builder.append("foreground=").append(colorRegistry.dataById(foregroundId)).append(','); } @Override - public void handleBackground(int backgroundId) throws Exception { + public void handleBackground(int backgroundId) { builder.append("background=").append(colorRegistry.dataById(backgroundId)).append(','); } @Override - public void handleFont(int fontNameId) throws Exception { + public void handleFont(int fontNameId) { assertEquals(1, fontNameId); } @Override - public void handleStyle(int style) throws Exception { + public void handleStyle(int style) { builder.append("fontStyle=").append(style).append(','); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/execution/ParametersListTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/execution/ParametersListTest.java index 5d658ba27a5f..c270bb7000b3 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/execution/ParametersListTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/execution/ParametersListTest.java @@ -209,7 +209,7 @@ public class ParametersListTest { } @Test - public void testParameterListUtil() throws Exception { + public void testParameterListUtil() { final List expected = Arrays.asList( "cmd", "-a", diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java index f95278edf6ae..2eac5846c775 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/FileEditorManagerTest.java @@ -144,7 +144,7 @@ public class FileEditorManagerTest extends FileEditorManagerTestCase { assertEquals("mockEditor", selectedEditors[0].getName()); } - public void testTrackSelectedEditor() throws Exception { + public void testTrackSelectedEditor() { PlatformTestUtil .registerExtension(FileEditorProvider.EP_FILE_EDITOR_PROVIDER, new MyFileEditorProvider(), myFixture.getTestRootDisposable()); VirtualFile file = getFile("/src/1.txt"); @@ -160,7 +160,7 @@ public class FileEditorManagerTest extends FileEditorManagerTestCase { assertEquals("mockEditor", myManager.getSelectedEditor(file).getName()); } - public void testWindowClosingRetainsOtherWindows() throws Exception { + public void testWindowClosingRetainsOtherWindows() { VirtualFile file = getFile("/src/1.txt"); assertNotNull(file); myManager.openFile(file, false); @@ -174,7 +174,7 @@ public class FileEditorManagerTest extends FileEditorManagerTestCase { assertEquals(2, myManager.getWindows().length); } - public void testStoringCaretStateForFileWithFoldingsWithNoTabs() throws Exception { + public void testStoringCaretStateForFileWithFoldingsWithNoTabs() { UISettings.getInstance().setEditorTabPlacement(UISettings.TABS_NONE); VirtualFile file = getFile("/src/Test.java"); assertNotNull(file); @@ -207,7 +207,7 @@ public class FileEditorManagerTest extends FileEditorManagerTestCase { assertEquals(textLength, editor.getSelectionModel().getSelectionEnd()); } - public void testOpenInDumbMode() throws Exception { + public void testOpenInDumbMode() { PlatformTestUtil .registerExtension(FileEditorProvider.EP_FILE_EDITOR_PROVIDER, new MyFileEditorProvider(), myFixture.getTestRootDisposable()); PlatformTestUtil diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NewDocumentHistoryTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NewDocumentHistoryTest.java index 2ffe21e32f0c..ae693884e1d3 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NewDocumentHistoryTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NewDocumentHistoryTest.java @@ -53,7 +53,7 @@ public class NewDocumentHistoryTest extends HeavyFileEditorManagerTestCase { } } - public void testBackNavigationBetweenEditors() throws Exception { + public void testBackNavigationBetweenEditors() { PlatformTestUtil.registerExtension(FileEditorProvider.EP_FILE_EDITOR_PROVIDER, new FileEditorManagerTest.MyFileEditorProvider(), myFixture.getTestRootDisposable()); VirtualFile file = getFile("/src/1.txt"); assertNotNull(file); @@ -68,7 +68,7 @@ public class NewDocumentHistoryTest extends HeavyFileEditorManagerTestCase { assertEquals("mockEditor", myManager.getSelectedEditor(file).getName()); } - public void testSelectFileOnNavigation() throws Exception { + public void testSelectFileOnNavigation() { VirtualFile file1 = getFile("/src/1.txt"); myManager.openFile(file1, true); VirtualFile file2 = getFile("/src/2.txt"); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java index c0fbb4b3edcc..77f464c87004 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java @@ -122,7 +122,7 @@ public class NonProjectFileAccessTest extends HeavyFileEditorManagerTestCase { typeAndCheck(nonProjectFile, false); // original is still locked } - public void testAccessToProjectSystemFiles() throws Exception { + public void testAccessToProjectSystemFiles() { PlatformTestUtil.saveProject(getProject()); VirtualFile fileUnderProjectDir = createFileExternally(new File(getProject().getBaseDir().getPath())); @@ -133,7 +133,7 @@ public class NonProjectFileAccessTest extends HeavyFileEditorManagerTestCase { typeAndCheck(fileUnderProjectDir, false); } - public void testAccessToModuleSystemFiles() throws Exception { + public void testAccessToModuleSystemFiles() { final Module moduleWithoutContentRoot = new WriteCommandAction(getProject()) { @Override protected void run(@NotNull Result result) throws Throwable { @@ -276,7 +276,7 @@ public class NonProjectFileAccessTest extends HeavyFileEditorManagerTestCase { typeAndCheck(nonProjectFile2, false); } - public void testCheckingExtensionsForNonWritableFiles() throws Exception { + public void testCheckingExtensionsForNonWritableFiles() { VirtualFile nonProjectFile1 = createProjectFile(); VirtualFile nonProjectFile2 = createProjectFile(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImplTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImplTest.java index 6454ea8f2e58..41238d243504 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImplTest.java @@ -85,7 +85,7 @@ public class FileDocumentManagerImplTest extends PlatformTestCase { super.tearDown(); } - public void testGetCachedDocument_Cached() throws Exception { + public void testGetCachedDocument_Cached() { final Document cachedDocument = myDocumentManager.getCachedDocument(new MockVirtualFile("test.txt")); assertNull(cachedDocument); } @@ -146,7 +146,7 @@ public class FileDocumentManagerImplTest extends PlatformTestCase { assertTrue(idCode != System.identityHashCode(document)); } - public void testGetUnsavedDocuments_NoDocuments() throws Exception { + public void testGetUnsavedDocuments_NoDocuments() { final Document[] unsavedDocuments = myDocumentManager.getUnsavedDocuments(); assertEquals(0, unsavedDocuments.length); } @@ -307,7 +307,7 @@ public class FileDocumentManagerImplTest extends PlatformTestCase { assertSame(file, myDocumentManager.getFile(document)); } - public void testConvertSeparators() throws Exception { + public void testConvertSeparators() { final VirtualFile file = new MockVirtualFile("test.txt", "test\rtest"); Document document = myDocumentManager.getDocument(file); assertNotNull(file.toString(), document); @@ -358,11 +358,11 @@ public class FileDocumentManagerImplTest extends PlatformTestCase { assertEquals("test\ntest", document.getText()); } - public void testContentChanged_ignoreEventsFromSelfOnSave() throws Exception { + public void testContentChanged_ignoreEventsFromSelfOnSave() { final VirtualFile file = new MockVirtualFile("test.txt", "test\rtest") { @NotNull @Override - public OutputStream getOutputStream(final Object requestor, final long newModificationStamp, long newTimeStamp) throws IOException { + public OutputStream getOutputStream(final Object requestor, final long newModificationStamp, long newTimeStamp) { final VirtualFile self = this; return new ByteArrayOutputStream() { @Override @@ -440,7 +440,7 @@ public class FileDocumentManagerImplTest extends PlatformTestCase { // this test requires changes in idea code to support MockFile as local file system file (FileDocumentManager.needsRefresh). // TODO: think how to test this functionality without hacking production code @SuppressWarnings("UnusedDeclaration") - public void _testContentChanged_reloadChangedDocumentOnSave() throws Exception { + public void _testContentChanged_reloadChangedDocumentOnSave() { final MockVirtualFile file = new MockVirtualFile("test.txt", "test\rtest") { @Override public void refresh(boolean asynchronous, boolean recursive, Runnable postRunnable) { @@ -572,7 +572,7 @@ public class FileDocumentManagerImplTest extends PlatformTestCase { }); } - public void testNoPSIModificationsDuringSave() throws IOException { + public void testNoPSIModificationsDuringSave() { File ioFile = IoTestUtil.createTestFile("test.txt", "some text"); VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(ioFile); assertNotNull(ioFile.getPath(), virtualFile); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryTest.java index d460eb98a5bc..dee9456303e1 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryTest.java @@ -94,7 +94,7 @@ public class IdeDocumentHistoryTest extends PlatformTestCase { super.tearDown(); } - public void testNoHistoryRecording() throws Throwable { + public void testNoHistoryRecording() { myHistory.onCommandStarted(); myHistory.onCommandFinished(null); @@ -102,7 +102,7 @@ public class IdeDocumentHistoryTest extends PlatformTestCase { assertFalse(myHistory.isForwardAvailable()); } - public void testNavigationRecording() throws Throwable { + public void testNavigationRecording() { makeNavigationChange(myState2); assertTrue(myHistory.isBackAvailable()); @@ -111,7 +111,7 @@ public class IdeDocumentHistoryTest extends PlatformTestCase { assertEquals(1, myHistory.getBackPlaces().size()); } - public void testMergingForwardPlaces() throws Throwable { + public void testMergingForwardPlaces() { myEditorState = new MyState(true, "state1"); makeNavigationChange(new MyState(true, "state2")); @@ -121,7 +121,7 @@ public class IdeDocumentHistoryTest extends PlatformTestCase { assertEquals(1, myHistory.getBackPlaces().size()); } - public void testSimpleNavigation() throws Throwable { + public void testSimpleNavigation() { pushTwoStates(); assertFalse(myHistory.isForwardAvailable()); @@ -148,7 +148,7 @@ public class IdeDocumentHistoryTest extends PlatformTestCase { assertSame(myState3, myEditorState); } - public void testQueueCutOff() throws Throwable { + public void testQueueCutOff() { pushTwoStates(); myHistory.back(); @@ -168,7 +168,7 @@ public class IdeDocumentHistoryTest extends PlatformTestCase { assertFalse(myHistory.isBackAvailable()); } - public void testRemoveInvalid() throws Throwable { + public void testRemoveInvalid() { pushTwoStates(); assertTrue(myHistory.isBackAvailable()); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java index 7e537f026287..49c4f63fade5 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java @@ -131,7 +131,7 @@ public class FileTypesTest extends PlatformTestCase { assertFalse(pattern.matcher("x/a\\b").matches()); } - public void testAddNewExtension() throws Exception { + public void testAddNewExtension() { FileTypeAssocTable associations = new FileTypeAssocTable<>(); associations.addAssociation(FileTypeManager.parseFromString("*.java"), FileTypes.ARCHIVE); associations.addAssociation(FileTypeManager.parseFromString("*.xyz"), StdFileTypes.XML); @@ -349,7 +349,7 @@ public class FileTypesTest extends PlatformTestCase { log("T: ensureRedetected: clear"); } - public void testReassignedPredefinedFileType() throws Exception { + public void testReassignedPredefinedFileType() { final FileType perlFileType = myFileTypeManager.getFileTypeByFileName("foo.pl"); assertEquals("Perl", perlFileType.getName()); assertEquals(PlainTextFileType.INSTANCE, myFileTypeManager.getFileTypeByFileName("foo.cgi")); @@ -414,7 +414,7 @@ public class FileTypesTest extends PlatformTestCase { assertEquals(typeFromPlugin, mappings.values().iterator().next().first); } - public void testPreserveUninstalledPluginAssociations() throws Exception { + public void testPreserveUninstalledPluginAssociations() { final FileType typeFromPlugin = new FileType() { @NotNull @Override @@ -528,7 +528,7 @@ public class FileTypesTest extends PlatformTestCase { } } - public void testDefaultFileType() throws Exception { + public void testDefaultFileType() { final String extension = "veryRareExtension"; final FileType idl = myFileTypeManager.findFileTypeByName("IDL"); ApplicationManager.getApplication().runWriteAction(() -> myFileTypeManager.associatePattern(idl, "*." + extension)); @@ -602,7 +602,7 @@ public class FileTypesTest extends PlatformTestCase { } } - public void _testStressPlainTextFileWithEverIncreasingLength() throws IOException, InterruptedException { + public void _testStressPlainTextFileWithEverIncreasingLength() throws IOException { FrequentEventDetector.disableUntil(getTestRootDisposable()); File f = createTempFile("xx.lkjlkjlkjlj", "a"); @@ -664,7 +664,7 @@ public class FileTypesTest extends PlatformTestCase { if (exception.get() != null) throw new RuntimeException(exception.get()); } - public void _testStressPlainTextFileWithEverIncreasingLength2() throws IOException, InterruptedException { + public void _testStressPlainTextFileWithEverIncreasingLength2() throws IOException { FrequentEventDetector.disableUntil(getTestRootDisposable()); File f = createTempFile("xx.asdkjfhlkasjdhf", StringUtil.repeatSymbol(' ', (int)PersistentFSConstants.FILE_LENGTH_TO_CACHE_THRESHOLD - 100)); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcherTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcherTest.java index 4ead4c32d797..dce289347e9d 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcherTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/IdeMouseEventDispatcherTest.java @@ -78,7 +78,7 @@ public class IdeMouseEventDispatcherTest extends LightPlatformTestCase { } } - public void testActionTriggering() throws Exception { + public void testActionTriggering() { assertFalse(myDispatcher.dispatchMouseEvent(new MouseEvent(myEventSource, MouseEvent.MOUSE_PRESSED, 0, 0, 0, 0, 1, false, MouseEvent.BUTTON2))); MouseEvent mouseEvent = new MouseEvent(myEventSource, MouseEvent.MOUSE_RELEASED, 0, 0, 0, 0, 1, false, MouseEvent.BUTTON2); assertTrue(!myDispatcher.dispatchMouseEvent(mouseEvent) && mouseEvent.isConsumed()); @@ -86,7 +86,7 @@ public class IdeMouseEventDispatcherTest extends LightPlatformTestCase { assertEquals(1, myActionExecutionCount); } - public void testActionBlocking() throws Exception { + public void testActionBlocking() { assertFalse(myDispatcher.dispatchMouseEvent(new MouseEvent(myEventSource, MouseEvent.MOUSE_PRESSED, 0, 0, 0, 0, 1, false, MouseEvent.BUTTON2))); MouseEvent dragEvent = new MouseEvent(myEventSource, MouseEvent.MOUSE_DRAGGED, 0, 0, 0, 0, 0, false, MouseEvent.BUTTON2); assertFalse(myDispatcher.dispatchMouseEvent(dragEvent)); @@ -95,7 +95,7 @@ public class IdeMouseEventDispatcherTest extends LightPlatformTestCase { assertEquals(0, myActionExecutionCount); } - public void testModifiersArePickedAtMousePressed() throws Exception { + public void testModifiersArePickedAtMousePressed() { assertFalse(myDispatcher.dispatchMouseEvent(new MouseEvent(myEventSource, MouseEvent.MOUSE_PRESSED, 0, 0, 0, 0, 1, false, MouseEvent.BUTTON1))); assertFalse(myDispatcher.dispatchMouseEvent(new MouseEvent(myEventSource, MouseEvent.MOUSE_RELEASED, 0, InputEvent.CTRL_MASK, 0, 0, 1, false, MouseEvent.BUTTON1))); assertEquals(0, myActionExecutionCount); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/KeymapTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/KeymapTest.java index fc42b267731f..adbbce998b3b 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/KeymapTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/KeymapTest.java @@ -58,7 +58,7 @@ public class KeymapTest extends PlatformTestCase { myChild.addShortcut(ACTION_1, shortcutA); } - public void testParentAndChildShortcuts() throws Exception { + public void testParentAndChildShortcuts() { assertTrue(myParent.hasOwnActionId(ACTION_1)); assertTrue(myParent.hasOwnActionId(ACTION_2)); assertFalse(myParent.hasOwnActionId(ACTION_NON_EXISTENT)); @@ -86,7 +86,7 @@ public class KeymapTest extends PlatformTestCase { assertSameElements(myChild.getActionIds(shortcutB)); } - public void testRemovingShortcutsFromParentAndChild() throws Exception { + public void testRemovingShortcutsFromParentAndChild() { myParent.removeShortcut(ACTION_1, shortcut1); assertFalse(myParent.hasOwnActionId(ACTION_1)); @@ -119,7 +119,7 @@ public class KeymapTest extends PlatformTestCase { assertTrue(myChild.hasOwnActionId(ACTION_2)); // since different from parent list } - public void testRemovingShortcutFromChildWhenInheritedDontChangeTheListIfShortcutIsAbsent() throws Exception { + public void testRemovingShortcutFromChildWhenInheritedDontChangeTheListIfShortcutIsAbsent() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -144,7 +144,7 @@ public class KeymapTest extends PlatformTestCase { assertThat(myChild.getShortcuts(ACTION_2)).containsExactly(shortcut2, shortcutB); } - public void testRemovingShortcutFirst() throws Exception { + public void testRemovingShortcutFirst() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -156,7 +156,7 @@ public class KeymapTest extends PlatformTestCase { assertThat(myChild.getShortcuts(ACTION_2)).containsExactly(shortcutA, shortcutB); } - public void testRemoveMouseShortcut() throws Exception { + public void testRemoveMouseShortcut() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -192,7 +192,7 @@ public class KeymapTest extends PlatformTestCase { // } //} - public void testChangingMouseShortcutInGrandChild() throws Exception { + public void testChangingMouseShortcutInGrandChild() { MouseShortcut mouseShortcut = new MouseShortcut(MouseEvent.BUTTON1, 0, 1); myParent.addShortcut(ACTION_2, mouseShortcut); Keymap grandChild = myChild.deriveKeymap("GrandChild"); @@ -201,7 +201,7 @@ public class KeymapTest extends PlatformTestCase { assertThat(grandChild.getActionIds(mouseShortcut)).containsExactly(ACTION_1); } - public void testRemovingShortcutLast() throws Exception { + public void testRemovingShortcutLast() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -213,7 +213,7 @@ public class KeymapTest extends PlatformTestCase { assertThat(myChild.getShortcuts(ACTION_2)).containsExactly(shortcut2, shortcutA); } - public void testRemovingShortcutFromChildWhenInherited() throws Exception { + public void testRemovingShortcutFromChildWhenInherited() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -233,7 +233,7 @@ public class KeymapTest extends PlatformTestCase { assertSameElements(myChild.getShortcuts(ACTION_1), shortcut2); } - public void testRemovingShortcutFromChildWhenInheritedAndBound() throws Exception { + public void testRemovingShortcutFromChildWhenInheritedAndBound() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -281,7 +281,7 @@ public class KeymapTest extends PlatformTestCase { } } - public void testRemovingShortcutNotInheritedBoundAndNotBound() throws Exception { + public void testRemovingShortcutNotInheritedBoundAndNotBound() { KeymapImpl standalone = new KeymapImpl(); standalone.setName("standalone"); @@ -323,7 +323,7 @@ public class KeymapTest extends PlatformTestCase { } } - public void testResettingMappingInChild() throws Exception { + public void testResettingMappingInChild() { assertSameElements(myChild.getShortcuts(ACTION_1), shortcut1, shortcutA); assertSameElements(myChild.getActionIds(shortcut1), ACTION_1); assertSameElements(myChild.getActionIds(shortcutA), ACTION_1); @@ -346,7 +346,7 @@ public class KeymapTest extends PlatformTestCase { assertFalse(myChild.hasOwnActionId(ACTION_2)); } - public void testChangingAndResettingBoundShortcutsInParentKeymap() throws Exception { + public void testChangingAndResettingBoundShortcutsInParentKeymap() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -471,7 +471,7 @@ public class KeymapTest extends PlatformTestCase { } } - public void testChangingAndResettingBoundShortcutsInChildKeymap() throws Exception { + public void testChangingAndResettingBoundShortcutsInChildKeymap() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -607,7 +607,7 @@ public class KeymapTest extends PlatformTestCase { } } - public void testRemovingChildMappingIsTheSameAsResetting() throws Exception { + public void testRemovingChildMappingIsTheSameAsResetting() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); @@ -686,7 +686,7 @@ public class KeymapTest extends PlatformTestCase { } } - public void testLookingForShortcutsInParentFirstAndOnlyThenConsiderBoundActions() throws Exception { + public void testLookingForShortcutsInParentFirstAndOnlyThenConsiderBoundActions() { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); KeymapImpl myGrandChild = myChild.deriveKeymap("GrandChild"); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/project/impl/RecentProjectsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/project/impl/RecentProjectsTest.java index a1f03b5e4f19..9977c3560dfa 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/project/impl/RecentProjectsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/project/impl/RecentProjectsTest.java @@ -129,7 +129,7 @@ public class RecentProjectsTest extends PlatformTestCase { Assert.assertEquals(Arrays.toString(groups), Arrays.toString(recentGroups.toArray())); } - private static String createAndOpenProject(String name) throws IOException, JDOMException, InterruptedException { + private static String createAndOpenProject(String name) throws IOException, JDOMException { Project project = null; try { File path = PlatformTestCase.createTempDir(name); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/roots/ProjectRootUtilSymlinkedFilesTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/roots/ProjectRootUtilSymlinkedFilesTest.java index be8d8418f828..7fe15023b0bb 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/roots/ProjectRootUtilSymlinkedFilesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/roots/ProjectRootUtilSymlinkedFilesTest.java @@ -27,7 +27,6 @@ import com.intellij.testFramework.PsiTestUtil; import org.jetbrains.annotations.NotNull; import java.io.File; -import java.io.IOException; public class ProjectRootUtilSymlinkedFilesTest extends PlatformTestCase { private File myNonContentDir; @@ -65,19 +64,19 @@ public class ProjectRootUtilSymlinkedFilesTest extends PlatformTestCase { PsiTestUtil.addLibrary(getModule(), myLibraryVDir.getPath()); } - public void testNoFilesInContent() throws Exception { + public void testNoFilesInContent() { assertEquals(myNonContentVFile, ProjectRootUtil.findSymlinkedFileInContent(getProject(), myNonContentVFile)); } - public void testLinkedDirInContent() throws Exception { + public void testLinkedDirInContent() { doTestLinkedDirInProjectRoots(true); } - public void testLinkedDirInLibrary() throws Exception { + public void testLinkedDirInLibrary() { doTestLinkedDirInProjectRoots(false); } - public void doTestLinkedDirInProjectRoots(boolean content) throws Exception { + public void doTestLinkedDirInProjectRoots(boolean content) { String linkedPath = (content ? myContentDir : myLibraryDir).getPath() + "/linked"; IoTestUtil.createSymLink(myNonContentDir.getPath(), linkedPath, true); @@ -87,7 +86,7 @@ public class ProjectRootUtilSymlinkedFilesTest extends PlatformTestCase { } // not supported - public void _testLinkedFileInSources() throws Exception { + public void _testLinkedFileInSources() { String linkedPath = myContentDir.getPath() + "/linked.txt"; IoTestUtil.createSymLink(myNonContentVFile.getPath(), linkedPath, true); @@ -95,7 +94,7 @@ public class ProjectRootUtilSymlinkedFilesTest extends PlatformTestCase { assertEquals(linkedVFile, ProjectRootUtil.findSymlinkedFileInContent(getProject(), myNonContentVFile)); } - public void testFileWithTheSameNotButNotLinked() throws Exception { + public void testFileWithTheSameNotButNotLinked() { new WriteAction() { @Override protected void run(@NotNull Result result) throws Throwable { @@ -106,7 +105,7 @@ public class ProjectRootUtilSymlinkedFilesTest extends PlatformTestCase { assertEquals(myNonContentVFile, ProjectRootUtil.findSymlinkedFileInContent(getProject(), myNonContentVFile)); } - public void testWhenSeveralLinkedAlwaysReturnTheSameFile() throws Exception { + public void testWhenSeveralLinkedAlwaysReturnTheSameFile() { String linkedPath1 = myContentDir.getPath() + "/linked1"; IoTestUtil.createSymLink(myNonContentDir.getPath(), linkedPath1, true); VirtualFile linkedVFile1 = VfsUtil.findFileByIoFile(new File(linkedPath1, myNonContentFile.getName()), true); @@ -124,15 +123,15 @@ public class ProjectRootUtilSymlinkedFilesTest extends PlatformTestCase { } } - public void testLinkedAndCanonicalUnderContent() throws Exception { + public void testLinkedAndCanonicalUnderContent() { doTestLinkedAndCanonicalUnderRoot(true); } - public void testLinkedAndCanonicalUnderLibraryRoot() throws Exception { + public void testLinkedAndCanonicalUnderLibraryRoot() { doTestLinkedAndCanonicalUnderRoot(false); } - private void doTestLinkedAndCanonicalUnderRoot(boolean content) throws InterruptedException, IOException { + private void doTestLinkedAndCanonicalUnderRoot(boolean content) { String linkedPath = myContentDir.getPath() + "/linked"; IoTestUtil.createSymLink(myNonContentDir.getPath(), linkedPath, true); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/util/io/FileUtilPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/util/io/FileUtilPerformanceTest.java index 475cc1155a4c..a2a8f93e054a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/util/io/FileUtilPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/util/io/FileUtilPerformanceTest.java @@ -27,7 +27,7 @@ public class FileUtilPerformanceTest { private String mySimpleTestPath = "file.txt"; @Test - public void toCanonicalPath() throws Exception { + public void toCanonicalPath() { assertEquals(myCanonicalPath, FileUtil.toCanonicalPath(myTestPath)); PlatformTestUtil.startPerformanceTest("toCanonicalPath", 650, () -> { @@ -39,7 +39,7 @@ public class FileUtilPerformanceTest { } @Test - public void toCanonicalPathSimple() throws Exception { + public void toCanonicalPathSimple() { assertEquals(mySimpleTestPath, FileUtil.toCanonicalPath(mySimpleTestPath)); PlatformTestUtil.startPerformanceTest("toCanonicalPathSimple", 210, () -> { @@ -51,7 +51,7 @@ public class FileUtilPerformanceTest { } @Test - public void isAncestor() throws Exception { + public void isAncestor() { assertTrue(FileUtil.isAncestor(myTestPath, myCanonicalPath, false)); PlatformTestUtil.startPerformanceTest("isAncestor", 3000, () -> { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/util/text/StringUtilPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/util/text/StringUtilPerformanceTest.java index 15f0611ccf9d..0626fa02ac44 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/util/text/StringUtilPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/util/text/StringUtilPerformanceTest.java @@ -26,7 +26,7 @@ public class StringUtilPerformanceTest { private static final String TEST_STRING = "0123456789abcdefghijklmnopqrstuvwxyz"; @Test - public void containsAnyChar() throws Exception { + public void containsAnyChar() { assertTrue(StringUtil.containsAnyChar(TEST_STRING, Integer.toString(new Random().nextInt()))); PlatformTestUtil.startPerformanceTest("StringUtil.containsAnyChar()", 300, () -> { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java index c6379fb8ac28..1c95697f9744 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java @@ -32,7 +32,7 @@ import static org.junit.Assert.assertNotNull; public class DummyFileSystemTest extends BareTestFixtureTestCase { @Test - public void testDeletionEvents() throws Exception { + public void testDeletionEvents() { DummyFileSystem fs = new DummyFileSystem(); Pair pair = new WriteAction>() { diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java index 16ae12206f44..cd3b5a4536d9 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java @@ -152,7 +152,7 @@ public class VfsUtilPerformanceTest extends BareTestFixtureTestCase { } @Override - public void run() throws Throwable { + public void run() { for (int i = 0; i < 5_000_000; i++) { checkRootsEqual(); } diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java index 9ebcb117aac8..05a1cc656c29 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java @@ -163,7 +163,7 @@ public class VirtualFilePointerTest extends PlatformTestCase { } } - public void testUrlsHavingOnlyStartingSlashInCommon() throws Exception { + public void testUrlsHavingOnlyStartingSlashInCommon() { VirtualFilePointer p1 = myVirtualFilePointerManager.create("file:///a/p1", disposable, null); VirtualFilePointer p2 = myVirtualFilePointerManager.create("file:///b/p2", disposable, null); final LightVirtualFile root = new LightVirtualFile("/"); @@ -173,7 +173,7 @@ public class VirtualFilePointerTest extends PlatformTestCase { assertSameElements(myVirtualFilePointerManager.getPointersUnder(b, "p2"), p2); } - public void testUrlsHavingOnlyStartingSlashInCommonAndInvalidUrlBetweenThem() throws Exception { + public void testUrlsHavingOnlyStartingSlashInCommonAndInvalidUrlBetweenThem() { VirtualFilePointer p1 = myVirtualFilePointerManager.create("file:///a/p1", disposable, null); myVirtualFilePointerManager.create("file://invalid/path", disposable, null); VirtualFilePointer p2 = myVirtualFilePointerManager.create("file:///b/p2", disposable, null); @@ -608,7 +608,7 @@ public class VirtualFilePointerTest extends PlatformTestCase { assertFalse(pointer.isValid()); } - public void testContainerCreateDeletePerformance() throws Exception { + public void testContainerCreateDeletePerformance() { PlatformTestUtil.startPerformanceTest("VF container create/delete", 100, () -> { Disposable parent = Disposer.newDisposable(); for (int i = 0; i < 10_000; i++) { @@ -759,7 +759,7 @@ public class VirtualFilePointerTest extends PlatformTestCase { }).assertTiming(); } - public void testMultipleCreationOfTheSamePointerPerformance() throws IOException { + public void testMultipleCreationOfTheSamePointerPerformance() { final LoggingListener listener = new LoggingListener(); final String url = VfsUtilCore.pathToUrl("/a/b/c/d/e"); final VirtualFilePointer thePointer = myVirtualFilePointerManager.create(url, disposable, listener); @@ -902,7 +902,7 @@ public class VirtualFilePointerTest extends PlatformTestCase { assertEquals(file, pointer.getFile()); } - public void testAlienVirtualFileSystemPointerRemovedFromUrlToIdentityCacheOnDispose() throws IOException { + public void testAlienVirtualFileSystemPointerRemovedFromUrlToIdentityCacheOnDispose() { VirtualFile mockVirtualFile = new MockVirtualFile("test_name", "test_text"); Disposable disposable1 = Disposer.newDisposable(); final VirtualFilePointer pointer = VirtualFilePointerManager.getInstance().create(mockVirtualFile, disposable1, null); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/local/CanonicalPathMapTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/local/CanonicalPathMapTest.java index fcee8b1ac143..91aa353de56a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/local/CanonicalPathMapTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/local/CanonicalPathMapTest.java @@ -139,7 +139,7 @@ public class CanonicalPathMapTest { } @Test - public void remappedSymLinkReportsOriginalWatchedPath() throws IOException, InterruptedException { + public void remappedSymLinkReportsOriginalWatchedPath() throws IOException { // Tests the situation where the watch root is a symlink AND REMAPPED by the native file watcher. File realDir = myTempDir.newFolder("real"); File symLink = IoTestUtil.createSymLink(realDir.getPath(), myTempDir.getRoot() + "/link"); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarRootsRefreshTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarRootsRefreshTest.java index 53bf6e5c3ccb..85d575ddc79f 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarRootsRefreshTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarRootsRefreshTest.java @@ -36,16 +36,15 @@ import com.intellij.testFramework.PlatformTestCase; import com.intellij.testFramework.PsiTestUtil; import java.io.File; -import java.io.IOException; public class JarRootsRefreshTest extends PlatformTestCase { - public void testJarRefreshOnRenameOrMove() throws IOException { + public void testJarRefreshOnRenameOrMove() { File jar = IoTestUtil.createTestJar(); VirtualFile vFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(jar); assertNotNull(vFile); new WriteCommandAction.Simple(myProject) { @Override - protected void run() throws Throwable { + protected void run() { PsiTestUtil.addContentRoot(myModule, vFile.getParent()); } }.execute(); diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java index 51b77dec3a2a..22b5dd16f93a 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/LocalFileSystemTest.java @@ -265,7 +265,7 @@ public class LocalFileSystemTest extends PlatformTestCase { assertTrue(childFile.delete()); } - public void testFindRoot() throws IOException { + public void testFindRoot() { VirtualFile root = myFS.findFileByPath("wrong_path"); assertNull(root); @@ -371,7 +371,7 @@ public class LocalFileSystemTest extends PlatformTestCase { } } - public void testWindowsHiddenDirectory() throws Exception { + public void testWindowsHiddenDirectory() { if (!SystemInfo.isWindows) { System.err.println(getName() + " skipped: " + SystemInfo.OS_NAME); return; @@ -460,7 +460,7 @@ public class LocalFileSystemTest extends PlatformTestCase { assertNull(vFile); } - public void testNoMoreFakeRoots() throws Exception { + public void testNoMoreFakeRoots() { try { PersistentFS.getInstance().findRoot("", myFS); fail("should fail by assertion in PersistentFsImpl.findRoot()"); @@ -714,7 +714,7 @@ public class LocalFileSystemTest extends PlatformTestCase { }); } - public void testBrokenSymlinkMove() throws IOException, InterruptedException { + public void testBrokenSymlinkMove() throws IOException { if (!SystemInfo.areSymLinksSupported) { System.err.println(getName() + " skipped: " + SystemInfo.OS_NAME); return; diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/PersistentFsTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/PersistentFsTest.java index b2ed234fd8b5..393bbcf11798 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/PersistentFsTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/PersistentFsTest.java @@ -160,13 +160,13 @@ public class PersistentFsTest extends PlatformTestCase { } } - public void testInvalidJarRootsIgnored() throws Exception { + public void testInvalidJarRootsIgnored() { File file = IoTestUtil.createTestFile("file.txt"); String url = "jar://" + FileUtil.toSystemIndependentName(file.getPath()) + "!/"; assertNull(VirtualFileManager.getInstance().findFileByUrl(url)); } - public void testBrokenJarRoots() throws Exception { + public void testBrokenJarRoots() { final File jarFile = IoTestUtil.createTestFile("empty.jar"); final int[] logCount = {0}; @@ -287,7 +287,7 @@ public class PersistentFsTest extends PlatformTestCase { assertFalse(FSRecords.isDirty()); } - public void testProcessEventsMustIgnoreDeleteDuplicates() throws IOException { + public void testProcessEventsMustIgnoreDeleteDuplicates() { VirtualFile vFile = setupFile(); checkEvents("Before:[VFileDeleteEvent->file.txt]\nAfter:[VFileDeleteEvent->file.txt]\n", new VFileDeleteEvent(this, vFile, false), @@ -318,7 +318,7 @@ public class PersistentFsTest extends PlatformTestCase { assertEquals(expectedEvents, log.toString()); } - public void testProcessEventsMustGroupDependentEventsCorrectly() throws IOException { + public void testProcessEventsMustGroupDependentEventsCorrectly() { VirtualFile vFile = setupFile(); checkEvents("Before:[VFileCreateEvent->xx.created, VFileDeleteEvent->file.txt]\n" + "After:[VFileCreateEvent->xx.created, VFileDeleteEvent->file.txt]\n", diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymlinkHandlingTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymlinkHandlingTest.java index ac96f0a3c43e..bef7402325ff 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymlinkHandlingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/SymlinkHandlingTest.java @@ -49,7 +49,7 @@ public class SymlinkHandlingTest extends BareTestFixtureTestCase { } @Test - public void testMissingLink() throws Exception { + public void testMissingLink() { File missingFile = new File(myTempDir.getRoot(), "missing_file"); assertTrue(missingFile.getPath(), !missingFile.exists() || missingFile.delete()); File missingLinkFile = createSymLink(missingFile.getPath(), myTempDir.getRoot() + "/missing_link", false); @@ -60,7 +60,7 @@ public class SymlinkHandlingTest extends BareTestFixtureTestCase { } @Test - public void testSelfLink() throws Exception { + public void testSelfLink() { String target = new File(myTempDir.getRoot(), "self_link").getPath(); File selfLinkFile = createSymLink(target, target, false); VirtualFile selfLinkVFile = refreshAndFind(selfLinkFile); @@ -70,7 +70,7 @@ public class SymlinkHandlingTest extends BareTestFixtureTestCase { } @Test - public void testDotLink() throws Exception { + public void testDotLink() { File dotLinkFile = createSymLink(".", myTempDir.getRoot() + "/dot_link"); VirtualFile dotLinkVFile = refreshAndFind(dotLinkFile); assertNotNull(dotLinkVFile); @@ -317,7 +317,7 @@ public class SymlinkHandlingTest extends BareTestFixtureTestCase { doTestLinkSwitch("text 1", "text 2"); } - private void doTestLinkSwitch(String text1, String text2) throws IOException, InterruptedException { + private void doTestLinkSwitch(String text1, String text2) throws IOException { File target1 = myTempDir.newFile("target1.txt"); FileUtil.writeToFile(target1, text1); File target2 = myTempDir.newFile("target2.txt"); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/NameUtilTest.java b/platform/platform-tests/testSrc/com/intellij/psi/NameUtilTest.java index d5a7e2d49519..92fdf1ad188c 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/NameUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/NameUtilTest.java @@ -27,32 +27,32 @@ import static org.junit.Assert.assertEquals; */ public class NameUtilTest { @Test - public void testSplitIntoWords1() throws Exception { + public void testSplitIntoWords1() { assertSplitEquals(new String[]{"I", "Base"}, "IBase"); } @Test - public void testSplitIntoWords2() throws Exception { + public void testSplitIntoWords2() { assertSplitEquals(new String[]{"Order", "Index"}, "OrderIndex"); } @Test - public void testSplitIntoWords3() throws Exception { + public void testSplitIntoWords3() { assertSplitEquals(new String[]{"order", "Index"}, "orderIndex"); } @Test - public void testSplitIntoWords4() throws Exception { + public void testSplitIntoWords4() { assertSplitEquals(new String[]{"Order", "Index"}, "Order_Index"); } @Test - public void testSplitIntoWords5() throws Exception { + public void testSplitIntoWords5() { assertSplitEquals(new String[]{"ORDER", "INDEX"}, "ORDER_INDEX"); } @Test - public void testSplitIntoWords6() throws Exception { + public void testSplitIntoWords6() { assertSplitEquals(new String[]{"gg", "J"}, "ggJ"); } diff --git a/platform/platform-tests/testSrc/com/intellij/psi/PsiModificationTrackerTreeChangesUpdatesTest.java b/platform/platform-tests/testSrc/com/intellij/psi/PsiModificationTrackerTreeChangesUpdatesTest.java index b26bb9a239eb..f0260559d6a8 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/PsiModificationTrackerTreeChangesUpdatesTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/PsiModificationTrackerTreeChangesUpdatesTest.java @@ -42,7 +42,7 @@ public class PsiModificationTrackerTreeChangesUpdatesTest extends PlatformTestCa super.tearDown(); } - public void testMoveFile() throws Exception { + public void testMoveFile() { new WriteAction() { @Override protected void run(@NotNull Result result) throws Throwable { @@ -61,7 +61,7 @@ public class PsiModificationTrackerTreeChangesUpdatesTest extends PlatformTestCa }.execute(); } - public void testMoveDir() throws Exception { + public void testMoveDir() { new WriteAction() { @Override protected void run(@NotNull Result result) throws Throwable { diff --git a/platform/platform-tests/testSrc/com/intellij/psi/impl/PsiDocumentManagerImplTest.java b/platform/platform-tests/testSrc/com/intellij/psi/impl/PsiDocumentManagerImplTest.java index a13399b18772..643a3894665d 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/impl/PsiDocumentManagerImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/impl/PsiDocumentManagerImplTest.java @@ -98,17 +98,17 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { } } - public void testGetCachedPsiFile_NoFile() throws Exception { + public void testGetCachedPsiFile_NoFile() { final PsiFile file = getPsiDocumentManager().getCachedPsiFile(new MockDocument()); assertNull(file); } - public void testGetPsiFile_NotRegisteredDocument() throws Exception { + public void testGetPsiFile_NotRegisteredDocument() { final PsiFile file = getPsiDocumentManager().getPsiFile(new MockDocument()); assertNull(file); } - public void testGetDocument_FirstGet() throws Exception { + public void testGetDocument_FirstGet() { VirtualFile vFile = createFile(); final PsiFile file = new MockPsiFile(vFile, getPsiManager()); @@ -144,11 +144,11 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { return getPsiManager().findFile(vFile); } - public void testGetUncommittedDocuments_noDocuments() throws Exception { + public void testGetUncommittedDocuments_noDocuments() { assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length); } - public void testGetUncommittedDocuments_documentChanged_DontProcessEvents() throws Exception { + public void testGetUncommittedDocuments_documentChanged_DontProcessEvents() { final PsiFile file = findFile(createFile()); final Document document = getDocument(file); @@ -160,7 +160,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length); } - public void testGetUncommittedDocuments_documentNotRegistered() throws Exception { + public void testGetUncommittedDocuments_documentNotRegistered() { final Document document = new MockDocument(); WriteCommandAction.runWriteCommandAction(null, () -> changeDocument(document, getPsiDocumentManager())); @@ -169,7 +169,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length); } - public void testCommitDocument_RemovesFromUncommittedList() throws Exception { + public void testCommitDocument_RemovesFromUncommittedList() { PsiFile file = findFile(createFile()); final Document document = getDocument(file); @@ -190,7 +190,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { manager.documentChanged(event); } - public void testCommitAllDocument_RemovesFromUncommittedList() throws Exception { + public void testCommitAllDocument_RemovesFromUncommittedList() { PsiFile file = findFile(createFile()); final Document document = getDocument(file); @@ -307,7 +307,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { assertEquals(2, count.get()); } - public void testDocumentCommittedInBackgroundEventuallyEvenDespiteTyping() throws InterruptedException, IOException { + public void testDocumentCommittedInBackgroundEventuallyEvenDespiteTyping() throws IOException { VirtualFile virtualFile = getVirtualFile(createTempFile("X.java", "")); PsiFile file = findFile(virtualFile); assertNotNull(file); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/impl/meta/MetaRegistryTest.java b/platform/platform-tests/testSrc/com/intellij/psi/impl/meta/MetaRegistryTest.java index 6cade77fde03..74735be7837f 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/impl/meta/MetaRegistryTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/impl/meta/MetaRegistryTest.java @@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull; * @author peter */ public class MetaRegistryTest extends LightPlatformTestCase { - public void testChangingMetaData() throws Throwable { + public void testChangingMetaData() { final boolean[] flag = {false}; MetaRegistry.addMetadataBinding(new ElementFilter() { @Override @@ -62,7 +62,7 @@ public class MetaRegistryTest extends LightPlatformTestCase { flag[0] = true; new WriteCommandAction(LightPlatformTestCase.getProject()) { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { tag.setName("b"); } }.execute(); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/search/GlobalSearchScopeTest.java b/platform/platform-tests/testSrc/com/intellij/psi/search/GlobalSearchScopeTest.java index ae001e7dbd94..89d9e9bf9bbe 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/search/GlobalSearchScopeTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/search/GlobalSearchScopeTest.java @@ -60,7 +60,7 @@ public class GlobalSearchScopeTest extends PlatformTestCase { assertSame(s.uniteWith(s), s); } - public void testNotScope() throws Exception { + public void testNotScope() { VirtualFile moduleRoot = new TempFiles(myFilesToDelete).createTempVDir(); ModuleRootModificationUtil.addContentRoot(getModule(), moduleRoot.getPath()); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java b/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java index 82995b944880..c2e9131b8e05 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java @@ -42,7 +42,7 @@ public class IElementTypeTest extends LightPlatformCodeInsightFixtureTestCase { // load all parser definitions, instantiate all lexers & parsers to initialize all IElementType constants @SuppressWarnings("UnusedDeclaration") - public void testCount() throws Exception { + public void testCount() { int count = IElementType.getAllocatedTypesCount(); LOG.debug("Preloaded: " + count +" element types"); LanguageExtensionPoint[] extensions = Extensions.getExtensions(new ExtensionPointName("com.intellij.lang.parserDefinition")); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/tree/TokenSetTest.java b/platform/platform-tests/testSrc/com/intellij/psi/tree/TokenSetTest.java index 19aa2cfb28e2..ed3d402bb54a 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/tree/TokenSetTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/tree/TokenSetTest.java @@ -70,7 +70,7 @@ public class TokenSetTest { } @Test - public void getTypes() throws Exception { + public void getTypes() { assertArrayEquals(IElementType.EMPTY_ARRAY, TokenSet.EMPTY.getTypes()); assertArrayEquals(new IElementType[]{T1, T2}, S12.getTypes()); assertArrayEquals(new IElementType[]{T3, T4}, S34.getTypes()); @@ -92,7 +92,7 @@ public class TokenSetTest { } @Test - public void andNot() throws Exception { + public void andNot() { final TokenSet S123 = TokenSet.orSet(S12, S3); check(TokenSet.andNot(S123, S12), T3); check(TokenSet.andNot(S123, S5), T1, T2, T3); @@ -118,7 +118,7 @@ public class TokenSetTest { @Test - public void performance() throws Exception { + public void performance() { final IElementType[] elementTypes = IElementType.enumerate(IElementType.TRUE); final TokenSet set = TokenSet.create(); final int shift = new Random().nextInt(500000); diff --git a/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilMatchingTest.java b/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilMatchingTest.java index eb35a7648466..0bae7f066b2c 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilMatchingTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/util/NameUtilMatchingTest.java @@ -40,7 +40,7 @@ import java.util.List; */ public class NameUtilMatchingTest extends UsefulTestCase { - public void testSimpleCases() throws Exception { + public void testSimpleCases() { assertMatches("N", "NameUtilTest"); assertMatches("NU", "NameUtilTest"); assertMatches("NUT", "NameUtilTest"); @@ -66,7 +66,7 @@ public class NameUtilMatchingTest extends UsefulTestCase { assertDoesntMatch("ABCD", "AbstractButton.DISABLED_ICON_CHANGED_PROPERTY"); } - public void testSimpleCasesWithFirstLowercased() throws Exception { + public void testSimpleCasesWithFirstLowercased() { assertMatches("N", "nameUtilTest"); assertDoesntMatch("N", "anameUtilTest"); assertMatches("NU", "nameUtilTest"); @@ -80,7 +80,7 @@ public class NameUtilMatchingTest extends UsefulTestCase { assertMatches("NaUtTe", "nameUtilTest"); } - public void testSpaceDelimiters() throws Exception { + public void testSpaceDelimiters() { assertMatches("Na Ut Te", "name util test"); assertMatches("Na Ut Te", "name Util Test"); assertDoesntMatch("Na Ut Ta", "name Util Test"); @@ -91,18 +91,18 @@ public class NameUtilMatchingTest extends UsefulTestCase { assertDoesntMatch("na ti", "name_util_test"); } - public void testXMLCompletion() throws Exception { + public void testXMLCompletion() { assertDoesntMatch("N_T", "NameUtilTest"); assertMatches("ORGS_ACC", "ORGS_POSITION_ACCOUNTABILITY"); assertMatches("ORGS-ACC", "ORGS-POSITION_ACCOUNTABILITY"); assertMatches("ORGS.ACC", "ORGS.POSITION_ACCOUNTABILITY"); } - public void testStarFalsePositive() throws Exception { + public void testStarFalsePositive() { assertDoesntMatch("ar*l*p", "AbstractResponseHandler"); } - public void testUnderscoreStyle() throws Exception { + public void testUnderscoreStyle() { assertMatches("N_U_T", "NAME_UTIL_TEST"); assertMatches("NUT", "NAME_UTIL_TEST"); assertDoesntMatch("NUT", "NameutilTest"); @@ -112,7 +112,7 @@ public class NameUtilMatchingTest extends UsefulTestCase { assertMatches("NOS", "NetOutputStream"); } - public void testCommonFileNameConventions() throws Exception { + public void testCommonFileNameConventions() { // See IDEADEV-12310 assertMatches("BLWN", "base_layout_without_navigation.xhtml"); @@ -159,7 +159,7 @@ public class NameUtilMatchingTest extends UsefulTestCase { assertDoesntMatch("A*.html", "10_after.html"); } - public void testIDEADEV15503() throws Exception { + public void testIDEADEV15503() { assertMatches("AR.jsp", "add_relationship.jsp"); assertMatches("AR.jsp", "advanced_rule.jsp"); assertMatches("AR.jsp", "alarm_reduction.jsp"); @@ -208,23 +208,23 @@ public class NameUtilMatchingTest extends UsefulTestCase { assertMatches("combobox", "comboBox"); } - public void testStartsWithDot() throws Exception { + public void testStartsWithDot() { assertMatches(".foo", ".foo"); } - public void testProperDotEscaping() throws Exception { + public void testProperDotEscaping() { assertMatches("*inspection*.pro", "InspectionsBundle.properties"); assertDoesntMatch("*inspection*.pro", "InspectionsInProgress.png"); } - public void testLeadingUnderscore() throws Exception { + public void testLeadingUnderscore() { assertDoesntMatch("form", "_form.html.erb"); assertMatches("_form", "_form.html.erb"); assertMatches("_form", "__form"); assertTrue(firstLetterMatcher("_form").matches("__form")); } - public void testLowerCaseWords() throws Exception { + public void testLowerCaseWords() { assertMatches("uct", "unit_controller_test"); assertMatches("unictest", "unit_controller_test"); assertMatches("uc", "unit_controller_test"); @@ -232,7 +232,7 @@ public class NameUtilMatchingTest extends UsefulTestCase { assertDoesntMatch("utc", "unit_controller_test"); } - public void testObjectiveCCases() throws Exception { + public void testObjectiveCCases() { assertMatches("h*:", "h:aaa"); assertMatches("h:", "h:aaa"); assertMatches("text:sh", "textField:shouldChangeCharactersInRange:replacementString:"); @@ -358,11 +358,11 @@ public class NameUtilMatchingTest extends UsefulTestCase { return NameUtil.buildMatcher(pattern, NameUtil.MatchingCaseSensitivity.FIRST_LETTER); } - public void testSpaceInCompletionPrefix() throws Exception { + public void testSpaceInCompletionPrefix() { assertTrue(caseInsensitiveMatcher("create ").matches("create module")); } - public void testLong() throws Exception { + public void testLong() { assertMatches("Product.findByDateAndNameGreaterThanEqualsAndQualityGreaterThanEqual", "Product.findByDateAndNameGreaterThanEqualsAndQualityGreaterThanEqualsIntellijIdeaRulezzz"); } diff --git a/platform/platform-tests/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java b/platform/platform-tests/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java index 39d005fa11c4..131354a217ab 100644 --- a/platform/platform-tests/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java +++ b/platform/platform-tests/testSrc/com/intellij/refactoring/rename/naming/NameSuggesterTest.java @@ -22,113 +22,113 @@ import junit.framework.TestCase; * @author dsl */ public class NameSuggesterTest extends TestCase { - public void testChanges1() throws Exception { + public void testChanges1() { doChangesTest("NameSuggesterTest", "NameUnifierTest", "[]"); } - public void testChanges2() throws Exception { + public void testChanges2() { doChangesTest("CompletionContext", "CompletionResult", "[]"); } - public void testChanges3() throws Exception { + public void testChanges3() { doChangesTest("CodeCompletionContext", "CompletionResult", "[, ]"); } - public void testChanges4() throws Exception { + public void testChanges4() { doChangesTest("A", "B", "[]"); } - public void testChanges5() throws Exception { + public void testChanges5() { doChangesTest("PsiManager", "PsiManagerImpl", "[<,Impl>]"); } - public void testChanges6() throws Exception { + public void testChanges6() { doChangesTest("IBase", "IMain", "[]"); } - public void testSuggestions1() throws Exception { + public void testSuggestions1() { doSuggestionTest("NameSuggesterTest", "NameUnifierTest", "suggester", "unifier"); } - public void testSuggestions2() throws Exception { + public void testSuggestions2() { doSuggestionTest("CompletionContext", "CompletionResult", "completionContext", "completionResult"); } - public void testSuggestions3() throws Exception { + public void testSuggestions3() { doSuggestionTest("CompletionContext", "CompletionResult", "context", "result"); } - public void testSuggestions4() throws Exception { + public void testSuggestions4() { doSuggestionTest("CompletionContext", "CompletionResult", "codeCompletionContext", "codeCompletionResult"); } - public void testSuggestions5() throws Exception { + public void testSuggestions5() { doSuggestionTest("CodeCompletionContext", "CompletionResult", "codeCompletionContext", "completionResult"); } - public void testSuggestions6() throws Exception { + public void testSuggestions6() { doSuggestionTest("CodeCompletionContext", "CompletionResult", "context", "result"); } - public void testSuggestions7() throws Exception { + public void testSuggestions7() { doSuggestionTest("CodeCompletionContext", "CompletionResult", "contextWithAdvances", "resultWithAdvances"); } - public void testSuggestions8() throws Exception { + public void testSuggestions8() { doSuggestionTest("CodeCompletionContext", "CompletionResult", "_context", "_result"); } - public void testSuggestions9() throws Exception { + public void testSuggestions9() { doSuggestionTest("CodeCompletionContext", "CompletionResult", "p_context", "p_result"); } - public void testSuggestions10() throws Exception { + public void testSuggestions10() { doSuggestionTest("IBase", "IMain", "base", "main"); } - public void testSuggestions11() throws Exception { + public void testSuggestions11() { doSuggestionTest("Descriptor", "BasicDescriptor", "descriptor", "basicDescriptor"); } - public void testSuggestions12() throws Exception { + public void testSuggestions12() { doSuggestionTest("Provider", "ObjectProvider", "provider", "objectProvider"); } - public void testSuggestions13() throws Exception { + public void testSuggestions13() { doSuggestionTest("SimpleModel", "Model", "simpleModel", "model"); } - public void testSuggestions14() throws Exception { + public void testSuggestions14() { doSuggestionTest("ConfigItem", "Config", "item", "item"); } - public void testSuggestions15() throws Exception { + public void testSuggestions15() { doSuggestionTest("Transaction", "TransactionPolicy", "transaction", "transactionPolicy"); } - public void testSuggestions16() throws Exception { + public void testSuggestions16() { doSuggestionTest("Transaction", "TransactionPolicyHandler", "transaction", "transactionPolicyHandler"); } - public void testSuggestions17() throws Exception { + public void testSuggestions17() { doSuggestionTest("Transaction", "StrictTransactionPolicyHandler", "transaction", "strictTransactionPolicyHandler"); } - public void testSuggestions18() throws Exception { + public void testSuggestions18() { doSuggestionTest("Foo", "FooTask", "fooImpl", "fooTaskImpl"); } - public void testSuggestions19() throws Exception { + public void testSuggestions19() { doSuggestionTest("Foo", "FooTask", "implFoo", "implFooTask"); } - public void testSuggestions20() throws Exception { + public void testSuggestions20() { doSuggestionTest("Foo", "TaskFoo", "fooImpl", "taskFooImpl"); } - public void testSuggestions21() throws Exception { + public void testSuggestions21() { doSuggestionTest("Foo", "TaskFoo", "implFoo", "implTaskFoo"); } diff --git a/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java b/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java index 5f961b791975..92a689e7a731 100644 --- a/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/run/PathMacrosCollectorTest.java @@ -48,7 +48,7 @@ public class PathMacrosCollectorTest extends TestCase { UsefulTestCase.assertSameElements(macros, "MACro1", "macro4", "mac_ro6", "macr.o7", "mac-ro8", "root"); } - public void testWithRecursiveFilter() throws Exception { + public void testWithRecursiveFilter() { Element root = new Element("root"); final Element configuration = new Element("configuration"); configuration.setAttribute("value", "some text$macro5$fdsjfhdskjfsd$MACRO$"); @@ -64,7 +64,7 @@ public class PathMacrosCollectorTest extends TestCase { UsefulTestCase.assertSameElements(macros, "macro5", "MACRO", "root"); } - public void testWithFilter() throws Exception { + public void testWithFilter() { Element root = new Element("root"); final Element testTag = new Element("test"); testTag.setAttribute("path", "$MACRO$"); diff --git a/platform/platform-tests/testSrc/com/intellij/statistics/StatisticsManagerTest.java b/platform/platform-tests/testSrc/com/intellij/statistics/StatisticsManagerTest.java index 6f03aeabc323..e3d7cefdbd57 100644 --- a/platform/platform-tests/testSrc/com/intellij/statistics/StatisticsManagerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/statistics/StatisticsManagerTest.java @@ -32,7 +32,7 @@ public class StatisticsManagerTest extends LightPlatformTestCase { return StatisticsManager.getInstance().getUseCount(new StatisticsInfo(TEST_CONTEXT, value)); } - public void testIncUseCount() throws Throwable { + public void testIncUseCount() { incUseCount("b", 1); assertEquals(1, getUseCount("b")); assertEquals(0, getUseCount("c")); @@ -42,13 +42,13 @@ public class StatisticsManagerTest extends LightPlatformTestCase { assertEquals(1, getUseCount("c")); } - public void testFlexibility() throws Throwable { + public void testFlexibility() { incUseCount("b", 100); incUseCount("c", 4); assertTrue(getUseCount("c") > getUseCount("b")); } - public void testReturn() throws Throwable { + public void testReturn() { incUseCount("b", 100); incUseCount("c", 4); incUseCount("b", 1); diff --git a/platform/platform-tests/testSrc/com/intellij/structureView/SmartTreeStructureTest.java b/platform/platform-tests/testSrc/com/intellij/structureView/SmartTreeStructureTest.java index 8d7d85dd0615..a0759ec64f78 100644 --- a/platform/platform-tests/testSrc/com/intellij/structureView/SmartTreeStructureTest.java +++ b/platform/platform-tests/testSrc/com/intellij/structureView/SmartTreeStructureTest.java @@ -43,7 +43,7 @@ public class SmartTreeStructureTest extends LightPlatformCodeInsightFixtureTestC root.addChild("xxx").addChild("aaa").addChild("bbb"); } - public void testGrouping() throws Exception { + public void testGrouping() { assertStructureEqual("root\n" + ".Group:a\n" + "..Group:d\n" + @@ -74,7 +74,7 @@ public class SmartTreeStructureTest extends LightPlatformCodeInsightFixtureTestC ".....bbb\n", PlatformTestUtil.createComparator(myPrintInfo)); } - public void testFiltering() throws Exception { + public void testFiltering() { myModel.addFlter(new Filter() { @Override @NotNull @@ -115,7 +115,7 @@ public class SmartTreeStructureTest extends LightPlatformCodeInsightFixtureTestC ".xxx\n", PlatformTestUtil.createComparator(myPrintInfo)); } - public void testSorting() throws Exception { + public void testSorting() { myModel.addSorter(new Sorter() { @NotNull @Override diff --git a/platform/platform-tests/testSrc/com/intellij/ui/CustomProtocolHandlerTest.java b/platform/platform-tests/testSrc/com/intellij/ui/CustomProtocolHandlerTest.java index 2df1d0a48f2b..367893ff2bde 100644 --- a/platform/platform-tests/testSrc/com/intellij/ui/CustomProtocolHandlerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ui/CustomProtocolHandlerTest.java @@ -2,7 +2,6 @@ package com.intellij.ui; import junit.framework.TestCase; -import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.util.List; @@ -11,7 +10,7 @@ import java.util.List; * @author Dennis.Ushakov */ public class CustomProtocolHandlerTest extends TestCase { - public void testOpenOurLink() throws URISyntaxException, MalformedURLException { + public void testOpenOurLink() throws URISyntaxException { final URI uri = new URI("x-mine://open?file=/Users/denofevil/RubymineProjects/JRubyRails/app/assets/javascripts/application.js.coffee&line=2"); final List args = new CustomProtocolHandler().getOpenArgs(uri); assertTrue(args.contains("--line")); diff --git a/platform/platform-tests/testSrc/com/intellij/ui/FinderRecursivePanelSelectionUpdateTest.java b/platform/platform-tests/testSrc/com/intellij/ui/FinderRecursivePanelSelectionUpdateTest.java index 954521bc1f36..b46c93a4803d 100644 --- a/platform/platform-tests/testSrc/com/intellij/ui/FinderRecursivePanelSelectionUpdateTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ui/FinderRecursivePanelSelectionUpdateTest.java @@ -29,7 +29,7 @@ import java.util.List; @SkipInHeadlessEnvironment public class FinderRecursivePanelSelectionUpdateTest extends LightPlatformTestCase { - public void testUpdate() throws InterruptedException { + public void testUpdate() { StringFinderRecursivePanel panel_0 = new StringFinderRecursivePanel(getProject()); disposeOnTearDown(panel_0); diff --git a/platform/platform-tests/testSrc/com/intellij/ui/TextTruncationTest.java b/platform/platform-tests/testSrc/com/intellij/ui/TextTruncationTest.java index 955ee1b52244..256374d87ed6 100644 --- a/platform/platform-tests/testSrc/com/intellij/ui/TextTruncationTest.java +++ b/platform/platform-tests/testSrc/com/intellij/ui/TextTruncationTest.java @@ -27,7 +27,7 @@ import java.util.Map; */ public class TextTruncationTest { @Test - public void testVariants() throws Exception { + public void testVariants() { final MyWidthCalculator calculator = new MyWidthCalculator(); testString("this is just a test", "this is just a test", calculator); testString("this is just a test", "this is just a ", calculator); diff --git a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java index c2f4655d6d83..5db5276992d5 100644 --- a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java +++ b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java @@ -50,7 +50,7 @@ import java.io.IOException; * @author max */ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { - public void testNoGroupingRules() throws Exception { + public void testNoGroupingRules() { GroupNode groupNode = buildUsageTree(new int[]{2, 3, 0}, UsageGroupingRule.EMPTY_ARRAY); assertNotNull(groupNode); @@ -60,17 +60,17 @@ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { assertEquals("Root [0, 2, 3]", groupNode.toString()); } - public void testOneGroupingRuleOnly() throws Exception { + public void testOneGroupingRuleOnly() { GroupNode groupNode = buildUsageTree(new int[]{0, 1, 0, 1 , 1}, new UsageGroupingRule[] {new OddEvenGroupingRule()}); assertEquals("Root [Even[0, 0], Odd[1, 1, 1]]", groupNode.toString()); } - public void testNotGroupedItemsComeToEnd() throws Exception { + public void testNotGroupedItemsComeToEnd() { GroupNode groupNode = buildUsageTree(new int[]{0, 1, 0, 1 , 1, 1003, 1002, 1001}, new UsageGroupingRule[] {new OddEvenGroupingRule()}); assertEquals("Root [Even[0, 0], Odd[1, 1, 1], 1001, 1002, 1003]", groupNode.toString()); } - public void test2Groupings() throws Exception { + public void test2Groupings() { GroupNode groupNode = buildUsageTree(new int[]{0, 1, 2, 3, 12, 13, 14, 15, 101, 103, 102, 105, 10001, 10002, 10003}, new UsageGroupingRule[] { new OddEvenGroupingRule(), new LogGroupingRule()}); @@ -78,7 +78,7 @@ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { assertEquals("Root [Even[1[0, 2], 2[12, 14], 3[102]], Odd[1[1, 3], 2[13, 15], 3[101, 103, 105]], 5[10001, 10002, 10003]]", groupNode.toString()); } - public void testDifferentRulesDontDependOnOrder() throws Exception { + public void testDifferentRulesDontDependOnOrder() { GroupNode groupNode = buildUsageTree(new int[]{10003, 0}, new UsageGroupingRule[] { new OddEvenGroupingRule(), new LogGroupingRule()}); @@ -86,7 +86,7 @@ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { assertEquals("Root [Even[1[0]], 5[10003]]", groupNode.toString()); } - public void testGroupsFromDifferentRulesAreCorrectlySorted() throws Exception { + public void testGroupsFromDifferentRulesAreCorrectlySorted() { GroupNode groupNode = buildUsageTree(new int[]{10003, 0, 1, 2, 3, 12, 13, 14, 15, 101, 103, 102, 105, 10001, 10002}, new UsageGroupingRule[] { new OddEvenGroupingRule(), new LogGroupingRule()}); diff --git a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java index f1c6ba91e19d..14cb9f85209e 100644 --- a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java +++ b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewTest.java @@ -50,7 +50,7 @@ import java.util.HashSet; import java.util.Set; public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase { - public void testUsageViewDoesNotHoldPsiFilesOrDocuments() throws Exception { + public void testUsageViewDoesNotHoldPsiFilesOrDocuments() { boolean[] foundLeaksBeforeTest = new boolean[1]; LeakHunter.checkLeak(ApplicationManager.getApplication(), PsiFileImpl.class, file -> { if (!file.isPhysical()) return false; @@ -81,7 +81,7 @@ public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase { LeakHunter.checkLeak(usageView, Document.class); } - public void testUsageViewHandlesDocumentChange() throws Exception { + public void testUsageViewHandlesDocumentChange() { PsiFile psiFile = myFixture.addFileToProject("X.java", "public class X{ int xxx; } //comment"); Usage usage = createUsage(psiFile, psiFile.getText().indexOf("xxx")); @@ -95,7 +95,7 @@ public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase { int navigationOffset = ((UsageInfo2UsageAdapter)usage).getUsageInfo().getNavigationOffset(); assertEquals(psiFile.getText().indexOf("xxx"), navigationOffset); } - public void testTextUsageInfoHandlesDocumentChange() throws Exception { + public void testTextUsageInfoHandlesDocumentChange() { PsiFile psiFile = myFixture.addFileToProject("X.java", "public class X{ int xxx; } //comment"); Usage usage = new UsageInfo2UsageAdapter(new UsageInfo(psiFile, psiFile.getText().indexOf("xxx"), StringUtil.indexOfSubstringEnd(psiFile.getText(),"xxx"))); @@ -116,7 +116,7 @@ public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase { return new UsageInfo2UsageAdapter(new UsageInfo(element)); } - public void testUsageViewCanRerunAfterTargetWasInvalidatedAndRestored() throws Exception { + public void testUsageViewCanRerunAfterTargetWasInvalidatedAndRestored() { PsiFile psiFile = myFixture.addFileToProject("X.java", "public class X{" + " void foo() {\n" + " bar();\n" + @@ -164,7 +164,7 @@ public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase { assertEquals(2, usages.size()); } - public void testExcludeUsageMustExcludeChildrenAndParents() throws Exception { + public void testExcludeUsageMustExcludeChildrenAndParents() { PsiFile psiFile = myFixture.addFileToProject("X.java", "public class X{ int xxx; } //comment"); Usage usage = new UsageInfo2UsageAdapter(new UsageInfo(psiFile, psiFile.getText().indexOf("xxx"), StringUtil.indexOfSubstringEnd(psiFile.getText(),"xxx"))); @@ -216,7 +216,7 @@ public class UsageViewTest extends LightPlatformCodeInsightFixtureTestCase { " 1 public class X{ int xxx; } //comment\n", StringUtil.convertLineSeparators(text)); } - public void testExcludeNodeMustExcludeChildrenAndParents() throws Exception { + public void testExcludeNodeMustExcludeChildrenAndParents() { PsiFile psiFile = myFixture.addFileToProject("X.java", "public class X{ int xxx; } //comment"); Usage usage = new UsageInfo2UsageAdapter(new UsageInfo(psiFile, psiFile.getText().indexOf("xxx"), StringUtil.indexOfSubstringEnd(psiFile.getText(),"xxx"))); diff --git a/platform/platform-tests/testSrc/com/intellij/util/AlarmTest.java b/platform/platform-tests/testSrc/com/intellij/util/AlarmTest.java index 4c3c8f2cfec4..83f423317f7c 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/AlarmTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/AlarmTest.java @@ -53,7 +53,7 @@ public class AlarmTest extends PlatformTestCase { assertRequestsExecuteSequentially(alarm); } - private static void assertRequestsExecuteSequentially(@NotNull Alarm alarm) throws InterruptedException, ExecutionException, TimeoutException { + private static void assertRequestsExecuteSequentially(@NotNull Alarm alarm) throws InterruptedException, ExecutionException { int N = 10000; StringBuffer log = new StringBuffer(N*4); StringBuilder expected = new StringBuilder(N * 4); @@ -81,7 +81,7 @@ public class AlarmTest extends PlatformTestCase { assertEquals(expected.toString(), log.toString()); } - public void testOneAlarmDoesNotStartTooManyThreads() throws InterruptedException, ExecutionException, TimeoutException { + public void testOneAlarmDoesNotStartTooManyThreads() { Alarm alarm = new Alarm(getTestRootDisposable()); Map before = Thread.getAllStackTraces(); AtomicInteger executed = new AtomicInteger(); @@ -96,7 +96,7 @@ public class AlarmTest extends PlatformTestCase { assertTrue("before: "+before.size()+"; after: "+after.size(), after.size() - before.size() < 10); } - public void testManyAlarmsDoNotStartTooManyThreads() throws InterruptedException, ExecutionException, TimeoutException { + public void testManyAlarmsDoNotStartTooManyThreads() { Map before = Thread.getAllStackTraces(); AtomicInteger executed = new AtomicInteger(); int N = 100000; diff --git a/platform/platform-tests/testSrc/com/intellij/util/JdkBundleListTest.java b/platform/platform-tests/testSrc/com/intellij/util/JdkBundleListTest.java index acfecabae9c2..336792f7fd91 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/JdkBundleListTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/JdkBundleListTest.java @@ -26,7 +26,7 @@ import static com.intellij.testFramework.UsefulTestCase.assertSameElements; public class JdkBundleListTest { @Test - public void testAddBundle() throws Exception { + public void testAddBundle() { JdkBundle jb0 = new JdkBundle(new File("/jb0"), "java", Pair.create(new Version(1, 8, 0), new Integer(0)), true, false); JdkBundle jb1 = new JdkBundle(new File("/jb1"), "java", Pair.create(new Version(1, 8, 0), new Integer(1)), false, false); JdkBundle jb2 = new JdkBundle(new File("/jb2"), "java", Pair.create(new Version(1, 8, 0), new Integer(2)), false, false); diff --git a/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java b/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java index f86bafaeaeee..cb95c3773180 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import static junit.framework.Assert.assertNotNull; import static junit.framework.Assert.assertTrue; -import static junit.framework.TestCase.*; +import static junit.framework.TestCase.assertFalse; public class JdkBundleTest { @@ -41,7 +41,7 @@ public class JdkBundleTest { } @Test - public void testJdk6OnMac() throws Exception { + public void testJdk6OnMac() { if (!SystemInfo.isMac) return; boolean testPassed; @@ -84,7 +84,7 @@ public class JdkBundleTest { } @Test - public void testJre7OnMac() throws Exception { + public void testJre7OnMac() { if (!SystemInfo.isMac || !"true".equals(System.getProperty("idea.jre.check"))) return; File standardJdkLocationDirectory = new File(STANDARD_JDK_LOCATION_ON_MAC_OS_X); @@ -113,7 +113,7 @@ public class JdkBundleTest { } } - public void doTestCreateBundle(File homeJDK) throws Exception { + public void doTestCreateBundle(File homeJDK) { if (!new File(homeJDK, "lib/tools.jar").exists()) return; // Skip pure jre File bootJDK = SystemInfo.isMac ? homeJDK.getParentFile().getParentFile() : homeJDK; @@ -139,7 +139,7 @@ public class JdkBundleTest { } @Test - public void testCreateBundle() throws Exception { + public void testCreateBundle() { File home = new File(System.getProperty("java.home")); doTestCreateBundle(home); @@ -148,7 +148,7 @@ public class JdkBundleTest { } @Test - public void testCreateBoot() throws Exception { + public void testCreateBoot() { File homeJDK = new File(System.getProperty("java.home")).getParentFile(); if (!new File(homeJDK, "lib/tools.jar").exists()) return; // Skip pure jre diff --git a/platform/platform-tests/testSrc/com/intellij/util/PsiErrorElementUtilTest.java b/platform/platform-tests/testSrc/com/intellij/util/PsiErrorElementUtilTest.java index 0c8abb2e1bed..b73bb987b907 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/PsiErrorElementUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/PsiErrorElementUtilTest.java @@ -30,12 +30,12 @@ public class PsiErrorElementUtilTest extends LightPlatformCodeInsightFixtureTest return PlatformTestUtil.getPlatformTestDataPath(); } - public void testNoErrors() throws Exception { + public void testNoErrors() { PsiFile file = myFixture.configureByText(StdFileTypes.XML, ""); Assert.assertFalse(PsiErrorElementUtil.hasErrors(getProject(), file.getVirtualFile())); } - public void testErrors() throws Exception { + public void testErrors() { PsiFile file = myFixture.configureByText(StdFileTypes.XML, " log = Collections.synchronizedList(new ArrayList<>()); diff --git a/platform/platform-tests/testSrc/com/intellij/util/concurrency/BackgroundTaskQueueTest.java b/platform/platform-tests/testSrc/com/intellij/util/concurrency/BackgroundTaskQueueTest.java index b66b50240a11..3c23dab69d11 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/concurrency/BackgroundTaskQueueTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/concurrency/BackgroundTaskQueueTest.java @@ -52,7 +52,7 @@ public class BackgroundTaskQueueTest extends PlatformTestCase { private Random myRandom; @Override - protected void setUp() throws Exception { + protected void setUp() { EdtTestUtil.runInEdtAndWait(() -> { try { super.setUp(); @@ -69,7 +69,7 @@ public class BackgroundTaskQueueTest extends PlatformTestCase { } @Override - protected void tearDown() throws Exception { + protected void tearDown() { myThreadRunner.finish(); EdtTestUtil.runInEdtAndWait((() -> { diff --git a/platform/platform-tests/testSrc/com/intellij/util/concurrency/BoundedScheduledExecutorTest.java b/platform/platform-tests/testSrc/com/intellij/util/concurrency/BoundedScheduledExecutorTest.java index d89d2ec813d5..27a54938ba65 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/concurrency/BoundedScheduledExecutorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/concurrency/BoundedScheduledExecutorTest.java @@ -111,7 +111,7 @@ public class BoundedScheduledExecutorTest extends TestCase { assertTrue(executor.awaitTermination(100, TimeUnit.SECONDS)); } - public void testEarlyCancelPreventsRunning() throws ExecutionException, InterruptedException { + public void testEarlyCancelPreventsRunning() throws InterruptedException { AtomicBoolean run = new AtomicBoolean(); BoundedScheduledExecutorService executor = createBoundedScheduledExecutor(AppExecutorUtil.getAppExecutorService(), 1); @@ -208,7 +208,7 @@ public class BoundedScheduledExecutorTest extends TestCase { } - public void testShutdownNowMustCancel() throws ExecutionException, InterruptedException { + public void testShutdownNowMustCancel() throws InterruptedException { BoundedScheduledExecutorService executor = createBoundedScheduledExecutor(AppExecutorUtil.getAppExecutorService(), 1); int N = 100000; StringBuffer log = new StringBuffer(N*4); @@ -243,7 +243,7 @@ public class BoundedScheduledExecutorTest extends TestCase { assertTrue(executor.awaitTermination(100, TimeUnit.SECONDS)); } - public void testShutdownMustDisableSubmit() throws ExecutionException, InterruptedException { + public void testShutdownMustDisableSubmit() throws InterruptedException { BoundedScheduledExecutorService executor = createBoundedScheduledExecutor(AppExecutorUtil.getAppExecutorService(), 1); int N = 100000; StringBuffer log = new StringBuffer(N*4); diff --git a/platform/platform-tests/testSrc/com/intellij/util/concurrency/BoundedTaskExecutorTest.java b/platform/platform-tests/testSrc/com/intellij/util/concurrency/BoundedTaskExecutorTest.java index 71b69477a0d4..c473f369ce7d 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/concurrency/BoundedTaskExecutorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/concurrency/BoundedTaskExecutorTest.java @@ -78,7 +78,7 @@ public class BoundedTaskExecutorTest extends TestCase { } } - public void testReallyBound() throws InterruptedException, ExecutionException { + public void testReallyBound() throws InterruptedException { for (int maxTasks=1; maxTasks<5;maxTasks++) { LOG.debug("maxTasks = " + maxTasks); ExecutorService backendExecutor = Executors.newCachedThreadPool(ConcurrencyUtil.newNamedThreadFactory("maxTasks = " + maxTasks)); @@ -146,7 +146,7 @@ public class BoundedTaskExecutorTest extends TestCase { assertTrue(backendExecutor.awaitTermination(100, TimeUnit.SECONDS)); } - public void testStressWhenSomeTasksCallOtherTasksGet() throws ExecutionException, InterruptedException { + public void testStressWhenSomeTasksCallOtherTasksGet() throws InterruptedException { ExecutorService backendExecutor = Executors.newCachedThreadPool(ConcurrencyUtil.newNamedThreadFactory(getName())); for (int maxSimultaneousTasks = 1; maxSimultaneousTasks<20; maxSimultaneousTasks++) { BoundedTaskExecutor executor = new BoundedTaskExecutor(getName(),backendExecutor, maxSimultaneousTasks); @@ -322,7 +322,7 @@ public class BoundedTaskExecutorTest extends TestCase { assertTrue(backendExecutor.awaitTermination(1, TimeUnit.MINUTES)); } - public void testShutdownNowMustCancel() throws ExecutionException, InterruptedException { + public void testShutdownNowMustCancel() throws InterruptedException { ExecutorService executor = new BoundedTaskExecutor(getName(),PooledThreadExecutor.INSTANCE, 1); int N = 100000; StringBuffer log = new StringBuffer(N*4); @@ -397,7 +397,7 @@ public class BoundedTaskExecutorTest extends TestCase { assertTrue(executor.awaitTermination(100, TimeUnit.SECONDS)); } - public void testNoExtraThreadsAreEverCreated() throws ExecutionException, InterruptedException { + public void testNoExtraThreadsAreEverCreated() throws InterruptedException { for (int nMaxThreads=1; nMaxThreads<10; nMaxThreads++) { LOG.debug("nMaxThreads = " + nMaxThreads); ExecutorService executor = AppExecutorUtil.createBoundedApplicationPoolExecutor(getName(),nMaxThreads); @@ -501,7 +501,7 @@ public class BoundedTaskExecutorTest extends TestCase { assertFalse(future.isCancelled()); } - public void testErrorsThrownInFiredAndForgottenTaskMustBeLogged() throws ExecutionException, InterruptedException { + public void testErrorsThrownInFiredAndForgottenTaskMustBeLogged() { ExecutorService executor = new BoundedTaskExecutor(getName(),PooledThreadExecutor.INSTANCE, 1); LoggedErrorProcessor oldInstance = LoggedErrorProcessor.getInstance(); try { diff --git a/platform/platform-tests/testSrc/com/intellij/util/containers/ContainerUtilTest.java b/platform/platform-tests/testSrc/com/intellij/util/containers/ContainerUtilTest.java index b97b34a9aba0..ce3ad3b05a8b 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/containers/ContainerUtilTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/containers/ContainerUtilTest.java @@ -75,7 +75,7 @@ public class ContainerUtilTest { } @Test - public void testIterateWithCondition() throws Exception { + public void testIterateWithCondition() { Condition cond = integer -> integer > 2; assertIterating(Arrays.asList(1, 4, 2, 5), cond, 4, 5); @@ -90,7 +90,7 @@ public class ContainerUtilTest { } @Test - public void testIteratingBackward() throws Exception { + public void testIteratingBackward() { List ss = new ArrayList<>(); ss.add("a"); ss.add("b"); diff --git a/platform/platform-tests/testSrc/com/intellij/util/indexing/FileTypeIndexTest.java b/platform/platform-tests/testSrc/com/intellij/util/indexing/FileTypeIndexTest.java index ce5e2c87407b..d533be814b74 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/indexing/FileTypeIndexTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/indexing/FileTypeIndexTest.java @@ -30,7 +30,7 @@ import org.jetbrains.annotations.NotNull; */ public class FileTypeIndexTest extends LightPlatformCodeInsightFixtureTestCase { - public void testAddFileType() throws Exception { + public void testAddFileType() { addAndRemoveFileType(); } diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/PersistenceStressTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/PersistenceStressTest.java index a2c961f5ba75..a832a1b441b7 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/io/PersistenceStressTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/io/PersistenceStressTest.java @@ -132,18 +132,10 @@ public class PersistenceStressTest extends LightPlatformCodeInsightFixtureTestCa @NotNull private Future submit(final PersistentHashMap map) { - return myThreadPool.submit(() -> { - try { - return doTask(map); - } - catch (IOException e) { - e.printStackTrace(); - return false; - } - }); + return myThreadPool.submit(() -> doTask(map)); } - private boolean doTask(PersistentHashMap map) throws IOException { + private boolean doTask(PersistentHashMap map) { Random random = new Random(); try { for (int i = 0; i < 100000; i++) { diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapTest.java index 84e9d4027e46..876faaeb292f 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/io/PersistentMapTest.java @@ -436,7 +436,7 @@ public class PersistentMapTest extends PersistentMapTestBase { } } - private void closeMapSilently() throws IOException { + private void closeMapSilently() { try { myMap.close(); } catch (IOException ignore) {} diff --git a/platform/platform-tests/testSrc/com/intellij/util/net/ssl/CertificateTest.java b/platform/platform-tests/testSrc/com/intellij/util/net/ssl/CertificateTest.java index 1db4155a971d..370033f742fc 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/net/ssl/CertificateTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/net/ssl/CertificateTest.java @@ -60,7 +60,7 @@ public class CertificateTest extends LightPlatformTestCase { private X509Certificate myAuthorityCertificate; - public void testSetUp() throws Exception { + public void testSetUp() { assertTrue(myTrustManager.containsCertificate(AUTHORITY_CN)); } diff --git a/platform/platform-tests/testSrc/com/intellij/util/ui/update/MergingUpdateQueueTest.java b/platform/platform-tests/testSrc/com/intellij/util/ui/update/MergingUpdateQueueTest.java index 0f90b664d370..e2f4fa7ac2b6 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/ui/update/MergingUpdateQueueTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/ui/update/MergingUpdateQueueTest.java @@ -32,7 +32,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; public class MergingUpdateQueueTest extends UsefulTestCase { - public void testOnShowNotify() throws Exception { + public void testOnShowNotify() { final MyUpdate first = new MyUpdate("first"); final MyUpdate second = new MyUpdate("second"); @@ -52,7 +52,7 @@ public class MergingUpdateQueueTest extends UsefulTestCase { assertAfterProcessing(second, true, true); } - public void testPriority() throws Exception { + public void testPriority() { final boolean[] attemps = new boolean[3]; final MyQueue queue = new MyQueue(); @@ -98,7 +98,7 @@ public class MergingUpdateQueueTest extends UsefulTestCase { assertAfterProcessing(third, true, true); } - public void testDoNoExecuteExpired() throws Throwable { + public void testDoNoExecuteExpired() { final boolean[] expired = new boolean[1]; @@ -128,7 +128,7 @@ public class MergingUpdateQueueTest extends UsefulTestCase { } - public void testOnShowNotifyMerging() throws Exception { + public void testOnShowNotifyMerging() { final MyUpdate twin1 = new MyUpdate("twin"); final MyUpdate twin2 = new MyUpdate("twin"); @@ -147,7 +147,7 @@ public class MergingUpdateQueueTest extends UsefulTestCase { assertAfterProcessing(twin2, true, true); } - public void testExecuteWhenActive() throws Exception { + public void testExecuteWhenActive() { final MyQueue queue = new MyQueue(); queue.showNotify(); @@ -164,7 +164,7 @@ public class MergingUpdateQueueTest extends UsefulTestCase { assertAfterProcessing(second, true, true); } - public void testMergeWhenActive() throws Exception { + public void testMergeWhenActive() { final MyQueue queue = new MyQueue(); queue.showNotify(); @@ -181,15 +181,15 @@ public class MergingUpdateQueueTest extends UsefulTestCase { assertAfterProcessing(twin2, true, true); } - public void testEatByQueue() throws Exception { + public void testEatByQueue() { executeEatingTest(false); } - public void testEatUpdatesInQueue() throws Exception { + public void testEatUpdatesInQueue() { executeEatingTest(true); } - private static void executeEatingTest(boolean foodFirst) throws Exception{ + private static void executeEatingTest(boolean foodFirst) { final MyQueue queue = new MyQueue(); queue.showNotify(); @@ -215,7 +215,7 @@ public class MergingUpdateQueueTest extends UsefulTestCase { assertAfterProcessing(food, false, false); } - public void testConcurrentFlushing() throws Exception { + public void testConcurrentFlushing() { final MyQueue queue = new MyQueue(); queue.showNotify(); @@ -255,7 +255,7 @@ public class MergingUpdateQueueTest extends UsefulTestCase { assertTrue(Boolean.TRUE.equals(executed.get())); } - public void testConcurrentQueueing() throws Exception { + public void testConcurrentQueueing() { final MyQueue queue = new MyQueue(); queue.showNotify(); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputLineSplitterTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputLineSplitterTest.java index 38c47787773f..d3ecba5ce45e 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputLineSplitterTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/OutputLineSplitterTest.java @@ -66,7 +66,7 @@ public class OutputLineSplitterTest extends PlatformTestCase { /** * When tc message is in the middle of line it should reported as separate line like if it has \n before it */ - public void testMessageInTheMiddleOfLine() throws Exception { + public void testMessageInTheMiddleOfLine() { for(String prefix: new String[]{"...", "", "... ", "##", " ##", "##team##teamcity["}) { final String testStarted = ServiceMessageBuilder.testStarted("myTest").toString() + "\n"; final String testEnded = ServiceMessageBuilder.testFinished("myTest").toString() + "\n"; @@ -204,7 +204,7 @@ public class OutputLineSplitterTest extends PlatformTestCase { } } - public void testPerformanceWithLotsOfFragments() throws Exception { + public void testPerformanceWithLotsOfFragments() { PlatformTestUtil.startPerformanceTest("Flushing lot's of fragments", 5, mySplitter::flush) .setup(() -> { for (int i = 0; i < 10_000; i++) { diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java index 0769de64c9ea..eaca233b754b 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertorTest.java @@ -51,14 +51,14 @@ public class GeneralIdBasedToSMTRunnerEventsConvertorTest extends BaseSMTRunnerT assertTrue(myRootProxy.isLeaf()); } - public void testOnTestStarted() throws InterruptedException { + public void testOnTestStarted() { onTestStarted("my test", null, "1", TreeNodeEvent.ROOT_NODE_ID, true); SMTestProxy proxy = validateTest("1", "my test", null, true, myRootProxy); onTestFailed("1", "", 1); validateTestFailure("1", proxy, 1); } - public void testRunningSuite() throws Exception { + public void testRunningSuite() { onSuiteStarted("Code", null, "1", TreeNodeEvent.ROOT_NODE_ID); SMTestProxy suiteProxy = validateSuite("1", "Code", null, myRootProxy); onTestStarted("should work", null, "2", "1", true); @@ -74,7 +74,7 @@ public class GeneralIdBasedToSMTRunnerEventsConvertorTest extends BaseSMTRunnerT assertFalse(bugsSuiteProxy.isInProgress()); } - public void testRunningSuiteWithMetainfo() throws Exception { + public void testRunningSuiteWithMetainfo() { onSuiteStarted("Code", "any:info:string:that:can:help?navigation", "1", TreeNodeEvent.ROOT_NODE_ID); SMTestProxy suiteProxy = validateSuite("1", "Code", "any:info:string:that:can:help?navigation", myRootProxy); onTestStarted("should work", "but is not a part of primary key", "2", "1", true); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java index 9d6adc8df1de..148fe19e2d52 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java @@ -133,7 +133,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase assertEquals("[root]", rootTreeNode.toString()); } - public void testOnTestStarted() throws InterruptedException { + public void testOnTestStarted() { onTestStarted("some_test"); final String fullName = myEventsProcessor.getFullTestName("some_test"); final SMTestProxy proxy = myEventsProcessor.getProxyByFullTestName(fullName); @@ -161,7 +161,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase assertEquals(1, myEventsProcessor.getRunningTestsQuantity()); } - public void testOnTestStarted_WithLocation() throws InterruptedException { + public void testOnTestStarted_WithLocation() { onTestStarted("some_test", "file://some/file.rb:1"); final String fullName = myEventsProcessor.getFullTestName("some_test"); final SMTestProxy proxy = myEventsProcessor.getProxyByFullTestName(fullName); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockRuntimeConfiguration.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockRuntimeConfiguration.java index 94fa7a434d94..3581f3298b73 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockRuntimeConfiguration.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/MockRuntimeConfiguration.java @@ -15,7 +15,6 @@ */ package com.intellij.execution.testframework.sm.runner; -import com.intellij.execution.ExecutionException; import com.intellij.execution.Executor; import com.intellij.execution.configurations.*; import com.intellij.execution.runners.ExecutionEnvironment; @@ -53,7 +52,7 @@ public class MockRuntimeConfiguration extends LocatableConfigurationBase impleme } @Override - public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) throws ExecutionException { + public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) { return null; } diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java index 39f324d601f4..cb50be4a37ce 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java @@ -28,7 +28,6 @@ import com.intellij.execution.testframework.sm.runner.ui.SMTestRunnerResultsForm import com.intellij.execution.testframework.ui.TestsOutputConsolePrinter; import com.intellij.execution.ui.ConsoleViewContentType; import com.intellij.openapi.util.Disposer; -import com.intellij.psi.impl.DebugUtil; import com.intellij.util.concurrency.Semaphore; import org.jetbrains.annotations.NotNull; @@ -539,7 +538,7 @@ public class SMTRunnerConsoleTest extends BaseSMTRunnerTestCase { assertAllOutputs(myMockResettablePrinter, "preved", "","Empty test suite.\n"); } - public void testEnsureOrderedClearFlush() throws Exception { + public void testEnsureOrderedClearFlush() { StringBuffer buf = new StringBuffer(); String expected = ""; for(int i = 0; i < 100; i++) { diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTestProxyTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTestProxyTest.java index 05b5458db4b1..5f3a3e38f0d0 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTestProxyTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTestProxyTest.java @@ -19,14 +19,10 @@ import com.intellij.execution.filters.HyperlinkInfo; import com.intellij.execution.testframework.Filter; import com.intellij.execution.testframework.TestConsoleProperties; import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; -import com.intellij.execution.testframework.stacktrace.DiffHyperlink; import com.intellij.execution.ui.ConsoleViewContentType; import com.intellij.psi.search.GlobalSearchScope; import org.easymock.EasyMock; -import java.util.ArrayList; -import java.util.List; - import static com.intellij.execution.testframework.sm.runner.states.TestStateInfo.Magnitude; /** @@ -86,7 +82,7 @@ public class SMTestProxyTest extends BaseSMTRunnerTestCase { assertFalse(mySuite.isLeaf()); } - public void testAppendedChildToTestShouldMakeItSuite() throws Exception { + public void testAppendedChildToTestShouldMakeItSuite() { mySuite = createTestProxy("unroll spock test"); assertFalse(mySuite.isSuite()); assertFalse(mySuite.isDefect()); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/TestSuiteStackTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/TestSuiteStackTest.java index 303f83c44b28..d9c579e8133a 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/TestSuiteStackTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/TestSuiteStackTest.java @@ -81,7 +81,7 @@ public class TestSuiteStackTest extends BaseSMTRunnerTestCase { }); } - public void testPopEmptySuite_NormalMode() throws Throwable { + public void testPopEmptySuite_NormalMode() { assertNull(myTestSuiteStack.popSuite("some suite")); } @@ -107,7 +107,7 @@ public class TestSuiteStackTest extends BaseSMTRunnerTestCase { assertEquals(4, myTestSuiteStack.getStackSize()); } - public void testPopInconsistentSuite_NormalMode() throws Throwable { + public void testPopInconsistentSuite_NormalMode() { final String suiteName = mySuite.getName(); myTestSuiteStack.pushSuite(createSuiteProxy("0")); @@ -123,7 +123,7 @@ public class TestSuiteStackTest extends BaseSMTRunnerTestCase { assertEquals(1, myTestSuiteStack.getStackSize()); } - public void testPopSuite() throws Throwable { + public void testPopSuite() { final String suiteName = mySuite.getName(); myTestSuiteStack.pushSuite(mySuite); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java index 4587ac036d77..77e5c8d96515 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java @@ -224,7 +224,7 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { assertTrue(focusRequestedRef.get()); } - public void testRuby_1767() throws InterruptedException { + public void testRuby_1767() { TestConsoleProperties.HIDE_PASSED_TESTS.set(myConsoleProperties, true); myEventsProcessor.onStartTesting(); @@ -251,7 +251,7 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { assertEquals(1, myTreeModel.getChildCount(myTreeModel.getChild(myTreeModel.getRoot(), 0))); } - public void testExpandIfOnlyOneRootChild() throws InterruptedException { + public void testExpandIfOnlyOneRootChild() { myEventsProcessor.onStartTesting(); myEventsProcessor.onSuiteStarted(new TestSuiteStartedEvent("suite1", null)); myResultsViewer.performUpdate(); @@ -288,7 +288,7 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase { } //with test tree build before start actual tests - public void testPrependTreeAndSameTestsStartFinish() throws Exception { + public void testPrependTreeAndSameTestsStartFinish() { //send tree myEventsProcessor.onSuiteTreeStarted("suite1", null, "suite1", "0"); myEventsProcessor.onSuiteTreeNodeAdded("test1", null, "test1", "suite1"); diff --git a/platform/smRunner/testSrc/com/intellij/internal/statistic/beans/ConvertUsagesUtilTest.java b/platform/smRunner/testSrc/com/intellij/internal/statistic/beans/ConvertUsagesUtilTest.java index 5590012d4081..1447f31807f7 100644 --- a/platform/smRunner/testSrc/com/intellij/internal/statistic/beans/ConvertUsagesUtilTest.java +++ b/platform/smRunner/testSrc/com/intellij/internal/statistic/beans/ConvertUsagesUtilTest.java @@ -4,7 +4,7 @@ import junit.framework.TestCase; public class ConvertUsagesUtilTest extends TestCase { - public void testEscapeDescriptorName() throws Exception { + public void testEscapeDescriptorName() { ConvertUsagesUtil.assertDescriptorName(ConvertUsagesUtil.escapeDescriptorName("'Copy'_on_Steroids")); ConvertUsagesUtil.assertDescriptorName(ConvertUsagesUtil.escapeDescriptorName("Some config name")); ConvertUsagesUtil.assertDescriptorName(ConvertUsagesUtil.escapeDescriptorName("\"config\"")); diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/OptimizedSearchScanTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/OptimizedSearchScanTest.java index a07415d7f8ef..374569e41d9c 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/OptimizedSearchScanTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/OptimizedSearchScanTest.java @@ -22,7 +22,7 @@ import com.intellij.structuralsearch.impl.matcher.compiler.PatternCompiler; */ public class OptimizedSearchScanTest extends StructuralSearchTestCase { - public void testClassByQName() throws Exception { + public void testClassByQName() { final String plan = findWordsToBeUsedWhenSearchingFor("A.f"); assertEquals("[in code:f][in code:A]", plan); } diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java index 60cdb9217925..8510a448e947 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/SSBasedInspectionTest.java @@ -35,11 +35,11 @@ public class SSBasedInspectionTest extends InspectionTestCase { myWrapper = new LocalInspectionToolWrapper(inspection); } - public void testSimple() throws Exception { + public void testSimple() { doTest(); } - private void doTest() throws Exception { + private void doTest() { doTest("ssBased/" + getTestName(true), myWrapper,"java 1.5"); } diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java index 510a1d3c6c11..f7b52856d74e 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java @@ -1527,7 +1527,7 @@ public class StructuralSearchTest extends StructuralSearchTestCase { findMatchesCount(s9, "java.lang.String.'_method ( '_params* )")); } - public void testAnnotations() throws Exception { + public void testAnnotations() { String s1 = "@MyBean(\"\")\n" + "@MyBean2(\"\")\n" + "public class TestBean {}\n" + @@ -2040,7 +2040,7 @@ public class StructuralSearchTest extends StructuralSearchTestCase { assertEquals(7,findMatchesCount(s3, s4)); } - public void testMultiStatementPatternWithTypedVariable() throws Exception { + public void testMultiStatementPatternWithTypedVariable() { String s = "class X {{ Integer i; i.valueOf(); }}"; assertEquals(1, findMatchesCount(s, "Integer '_i;\n'_i.valueOf();")); @@ -2052,21 +2052,21 @@ public class StructuralSearchTest extends StructuralSearchTestCase { assertEquals(1, findMatchesCount(s, pattern)); } - public void testFindAnnotationDeclarations() throws Exception { + public void testFindAnnotationDeclarations() { String s = "interface Foo {} interface Bar {} @interface X {}"; String s2 = "@interface 'x {}"; assertEquals(1, findMatchesCount(s,s2)); } - public void testFindEnums() throws Exception { + public void testFindEnums() { String s = "class Foo {} class Bar {} enum X {}"; String s2 = "enum 'x {}"; assertEquals(1, findMatchesCount(s,s2)); } - public void testFindDeclaration() throws Exception { + public void testFindDeclaration() { String s = "public class F {\n" + " static Category cat = Category.getInstance(F.class.getName());\n" + " Category cat2 = Category.getInstance(F.class.getName());\n" + diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java index 24a0422f5eb1..3e4f32ba61c2 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java @@ -23,9 +23,7 @@ import com.intellij.structuralsearch.plugin.ui.Configuration; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; /** * @author Bas Leijdekkers @@ -35,7 +33,7 @@ public class StringToConstraintsTransformerTest { private MatchOptions myOptions; @Before - public void setUp() throws Exception { + public void setUp() { myOptions = new MatchOptions(); } diff --git a/platform/util/testSrc/com/intellij/execution/configurations/CommandLineTokenizerTest.java b/platform/util/testSrc/com/intellij/execution/configurations/CommandLineTokenizerTest.java index 98d56bb87dd6..cef1986a44e6 100644 --- a/platform/util/testSrc/com/intellij/execution/configurations/CommandLineTokenizerTest.java +++ b/platform/util/testSrc/com/intellij/execution/configurations/CommandLineTokenizerTest.java @@ -18,7 +18,7 @@ package com.intellij.execution.configurations; import junit.framework.TestCase; public class CommandLineTokenizerTest extends TestCase { - public void testBasic() throws Exception { + public void testBasic() { assertTokens("a b", "a", "b"); assertTokens("\"a b\"", "a b"); assertTokens("a\" b\"", "a b"); @@ -30,7 +30,7 @@ public class CommandLineTokenizerTest extends TestCase { assertTokens("\"-Dquote=\\\\\"", "-Dquote=\\\\"); } - public void testEscape() throws Exception { + public void testEscape() { assertTokens("a\\ b", true, "a b"); assertTokens("a\\ b", false, "a\\", "b"); diff --git a/platform/util/testSrc/com/intellij/openapi/util/BuildNumberTest.java b/platform/util/testSrc/com/intellij/openapi/util/BuildNumberTest.java index cb91d33654c4..fcc44703d581 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/BuildNumberTest.java +++ b/platform/util/testSrc/com/intellij/openapi/util/BuildNumberTest.java @@ -33,7 +33,7 @@ public class BuildNumberTest { } @Test - public void branchBasedBuild() throws Exception { + public void branchBasedBuild() { assertParsed(BuildNumber.fromString("145"), 145, 0, "145.0"); assertParsed(BuildNumber.fromString("145.1"), 145, 1, "145.1"); assertParsed(BuildNumber.fromString("145.1.2"), 145, 1, "145.1.2"); @@ -54,7 +54,7 @@ public class BuildNumberTest { } @Test - public void comparingVersion() throws Exception { + public void comparingVersion() { assertTrue(BuildNumber.fromString("145.1").compareTo(BuildNumber.fromString("145.*")) < 0); assertTrue(BuildNumber.fromString("145.1.1").compareTo(BuildNumber.fromString("145.*")) < 0); assertTrue(BuildNumber.fromString("145.1.1.1.1").compareTo(BuildNumber.fromString("145.*")) < 0); @@ -80,7 +80,7 @@ public class BuildNumberTest { } @Test - public void devSnapshotVersion() throws Exception { + public void devSnapshotVersion() { BuildNumber b = BuildNumber.fromString("__BUILD_NUMBER__"); assertTrue(b.asString(), b.getBaselineVersion() >= 145 && b.getBaselineVersion() <= 3000); assertTrue(b.isSnapshot()); @@ -129,7 +129,7 @@ public class BuildNumberTest { } @Test - public void currentVersion() throws Exception { + public void currentVersion() { BuildNumber current = BuildNumber.currentVersion(); assertTrue(current.isSnapshot()); diff --git a/platform/util/testSrc/com/intellij/openapi/util/ReflectionUtilTest.java b/platform/util/testSrc/com/intellij/openapi/util/ReflectionUtilTest.java index d1a86208d7fd..becdad6a17d9 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/ReflectionUtilTest.java +++ b/platform/util/testSrc/com/intellij/openapi/util/ReflectionUtilTest.java @@ -38,7 +38,7 @@ public class ReflectionUtilTest extends TestCase { fail(); } - public void testResetField() throws Exception { + public void testResetField() { final Reset reset = new Reset(); ReflectionUtil.resetField(reset, String.class, "STRING"); diff --git a/platform/util/testSrc/com/intellij/openapi/util/io/FileAttributesReadingTest.java b/platform/util/testSrc/com/intellij/openapi/util/io/FileAttributesReadingTest.java index 7f2bda12d6d1..3f8d08024d8c 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/io/FileAttributesReadingTest.java +++ b/platform/util/testSrc/com/intellij/openapi/util/io/FileAttributesReadingTest.java @@ -83,7 +83,7 @@ public abstract class FileAttributesReadingTest { } @After - public void tearDown() throws Exception { + public void tearDown() { if (myTempDirectory != null) { FileUtil.delete(myTempDirectory); } @@ -154,7 +154,7 @@ public abstract class FileAttributesReadingTest { } @Test - public void root() throws Exception { + public void root() { final File file = new File(SystemInfo.isWindows ? "C:\\" : "/"); final FileAttributes attributes = getAttributes(file); @@ -183,7 +183,7 @@ public abstract class FileAttributesReadingTest { } @Test - public void special() throws Exception { + public void special() { assumeTrue(SystemInfo.isUnix); final File file = new File("/dev/null"); @@ -325,7 +325,7 @@ public abstract class FileAttributesReadingTest { } @Test - public void hiddenDir() throws Exception { + public void hiddenDir() { assumeTrue(SystemInfo.isWindows); File dir = IoTestUtil.createTestDir(myTempDirectory, "dir"); FileAttributes attributes = getAttributes(dir); @@ -336,7 +336,7 @@ public abstract class FileAttributesReadingTest { } @Test - public void hiddenFile() throws Exception { + public void hiddenFile() { assumeTrue(SystemInfo.isWindows); File file = IoTestUtil.createTestFile(myTempDirectory, "file"); FileAttributes attributes = getAttributes(file); @@ -347,7 +347,7 @@ public abstract class FileAttributesReadingTest { } @Test - public void notSoHiddenRoot() throws Exception { + public void notSoHiddenRoot() { if (SystemInfo.isWindows) { File absRoot = new File("C:\\"); FileAttributes absAttributes = getAttributes(absRoot); @@ -365,7 +365,7 @@ public abstract class FileAttributesReadingTest { } @Test - public void wellHiddenFile() throws Exception { + public void wellHiddenFile() { assumeTrue(SystemInfo.isWindows); final File file = new File("C:\\Documents and Settings\\desktop.ini"); assumeTrue(file.exists()); @@ -507,7 +507,7 @@ public abstract class FileAttributesReadingTest { } @Test - public void notOwned() throws Exception { + public void notOwned() { assumeTrue(SystemInfo.isUnix); File userHome = new File(SystemProperties.getUserHome()); @@ -521,7 +521,7 @@ public abstract class FileAttributesReadingTest { } @Test - public void permissionsCloning() throws Exception { + public void permissionsCloning() { assumeTrue(SystemInfo.isUnix); File donor = IoTestUtil.createTestFile(myTempDirectory, "donor"); diff --git a/platform/util/testSrc/com/intellij/openapi/util/io/FileUtilHeavyTest.java b/platform/util/testSrc/com/intellij/openapi/util/io/FileUtilHeavyTest.java index 49f1f9df6a86..d4b851ff5ca8 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/io/FileUtilHeavyTest.java +++ b/platform/util/testSrc/com/intellij/openapi/util/io/FileUtilHeavyTest.java @@ -194,7 +194,7 @@ public class FileUtilHeavyTest { private int count = 0; @Override - public Boolean execute(boolean lastAttempt) throws IOException { + public Boolean execute(boolean lastAttempt) { count++; return stop(lastAttempt) ? true : null; } diff --git a/platform/util/testSrc/com/intellij/openapi/util/objectTree/DisposerTest.java b/platform/util/testSrc/com/intellij/openapi/util/objectTree/DisposerTest.java index ad769c48a9b4..33ae219980ad 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/objectTree/DisposerTest.java +++ b/platform/util/testSrc/com/intellij/openapi/util/objectTree/DisposerTest.java @@ -70,7 +70,7 @@ public class DisposerTest extends TestCase { } } - public void testDisposalAndAbsenceOfReferences() throws Exception { + public void testDisposalAndAbsenceOfReferences() { Disposer.register(myRoot, myFolder1); Disposer.register(myRoot, myFolder2); Disposer.register(myFolder1, myLeaf1); @@ -88,7 +88,7 @@ public class DisposerTest extends TestCase { Disposer.dispose(myLeaf1); } - public void testDisposalOrder() throws Exception { + public void testDisposalOrder() { Disposer.register(myRoot, myFolder1); Disposer.register(myFolder1, myLeaf1); Disposer.register(myRoot, myFolder2); @@ -104,7 +104,7 @@ public class DisposerTest extends TestCase { assertEquals(expected, myDisposedObjects); } - public void testDirectCallOfDisposable() throws Exception { + public void testDirectCallOfDisposable() { SelDisposable selfDisposable = new SelDisposable("root"); Disposer.register(myRoot, selfDisposable); Disposer.register(selfDisposable, myFolder1); @@ -120,13 +120,13 @@ public class DisposerTest extends TestCase { assertEquals(0, Disposer.getTree().getNodesInExecution().size()); } - public void testDirectCallOfUnregisteredSelfDisposable() throws Exception { + public void testDirectCallOfUnregisteredSelfDisposable() { SelDisposable selfDisposable = new SelDisposable("root"); //noinspection SSBasedInspection selfDisposable.dispose(); } - public void testDisposeAndReplace() throws Exception { + public void testDisposeAndReplace() { Disposer.register(myRoot, myFolder1); Disposer.disposeChildAndReplace(myFolder1, myFolder2); @@ -137,7 +137,7 @@ public class DisposerTest extends TestCase { assertDisposed(myFolder2); } - public void testPostponedParentRegistration() throws Exception { + public void testPostponedParentRegistration() { Disposer.register(myFolder1, myLeaf1); Disposer.register(myLeaf1, myLeaf2); Disposer.register(myRoot, myFolder1); @@ -151,7 +151,7 @@ public class DisposerTest extends TestCase { assertDisposed(myLeaf2); } - public void testDisposalOfParentless() throws Throwable { + public void testDisposalOfParentless() { Disposer.register(myFolder1, myLeaf1); Disposer.register(myFolder1, myFolder2); Disposer.register(myFolder2, myLeaf2); @@ -164,7 +164,7 @@ public class DisposerTest extends TestCase { assertDisposed(myLeaf2); } - public void testDisposalOfParentess2() throws Throwable { + public void testDisposalOfParentess2() { Disposer.register(myFolder1, myLeaf1); Disposer.register(myFolder2, myLeaf2); Disposer.register(myFolder1, myFolder2); @@ -177,7 +177,7 @@ public class DisposerTest extends TestCase { assertDisposed(myLeaf2); } - public void testOverrideParentDisposable() throws Exception { + public void testOverrideParentDisposable() { Disposer.register(myFolder1, myLeaf1); Disposer.register(myFolder2, myFolder1); Disposer.register(myRoot, myFolder1); @@ -193,7 +193,7 @@ public class DisposerTest extends TestCase { assertDisposed(myLeaf1); } - public void testDisposableParentNotify() throws Exception { + public void testDisposableParentNotify() { MyParentDisposable root = new MyParentDisposable("root"); Disposer.register(root, myFolder1); diff --git a/platform/util/testSrc/com/intellij/util/ArrayUtilTest.java b/platform/util/testSrc/com/intellij/util/ArrayUtilTest.java index fb2312e1bf5f..2763a8471f5b 100644 --- a/platform/util/testSrc/com/intellij/util/ArrayUtilTest.java +++ b/platform/util/testSrc/com/intellij/util/ArrayUtilTest.java @@ -76,7 +76,7 @@ public class ArrayUtilTest extends TestCase { assertTrue(Arrays.equals(expected, actual)); } - public void testReverse() throws Exception { + public void testReverse() { checkArrayReverse(new int[]{}, new int[]{}); checkArrayReverse(new int[]{1}, new int[]{1}); checkArrayReverse(new int[]{1, 2, 3, 4}, new int[]{4, 3, 2, 1}); diff --git a/platform/util/testSrc/com/intellij/util/FoundationTest.java b/platform/util/testSrc/com/intellij/util/FoundationTest.java index bea77a006e35..4ea11e590f36 100644 --- a/platform/util/testSrc/com/intellij/util/FoundationTest.java +++ b/platform/util/testSrc/com/intellij/util/FoundationTest.java @@ -32,12 +32,12 @@ public class FoundationTest { } @Test - public void testStrings() throws Exception { + public void testStrings() { assertThat(Foundation.toStringViaUTF8(Foundation.nsString("Test")), equalTo("Test")); } @Test - public void testEncodings() throws Exception { + public void testEncodings() { assertThat(Foundation.getEncodingName(4), equalTo("utf-8")); assertThat(Foundation.getEncodingName(0), nullValue()); assertThat(Foundation.getEncodingName(-1), nullValue()); @@ -60,7 +60,7 @@ public class FoundationTest { } @Test - public void testFindingAppBundle() throws Exception { + public void testFindingAppBundle() { String path; path = NSWorkspace.absolutePathForAppBundleWithIdentifier("com.apple.Finder"); diff --git a/platform/util/testSrc/com/intellij/util/PathMappingSettingsTest.java b/platform/util/testSrc/com/intellij/util/PathMappingSettingsTest.java index c604fedaa3e2..0b2af228c8ee 100644 --- a/platform/util/testSrc/com/intellij/util/PathMappingSettingsTest.java +++ b/platform/util/testSrc/com/intellij/util/PathMappingSettingsTest.java @@ -16,7 +16,7 @@ public class PathMappingSettingsTest { private PathMappingSettings myMappingSettings; @Before - public void setUp() throws Exception { + public void setUp() { myMappingSettings = new PathMappingSettings(); } diff --git a/platform/util/testSrc/com/intellij/util/SystemInfoTest.java b/platform/util/testSrc/com/intellij/util/SystemInfoTest.java index 140b54446ab7..1ff59dd0eaa5 100644 --- a/platform/util/testSrc/com/intellij/util/SystemInfoTest.java +++ b/platform/util/testSrc/com/intellij/util/SystemInfoTest.java @@ -19,7 +19,7 @@ import com.intellij.openapi.util.SystemInfo; import junit.framework.TestCase; public class SystemInfoTest extends TestCase { - public void testMacOsVersions() throws Exception { + public void testMacOsVersions() { // see http://developer.apple.com/library/mac/#documentation/Carbon/Reference/Gestalt_Manager/Reference/reference.html#//apple_ref/doc/uid/TP30000036-CH1g-F01632 // System Version Selectors @@ -31,7 +31,7 @@ public class SystemInfoTest extends TestCase { assertEquals("1.2", SystemInfo.getMacOSMajorVersion("1.2.3.4")); } - public void testMacOsVersionCode() throws Exception { + public void testMacOsVersionCode() { // see http://developer.apple.com/library/mac/#documentation/Carbon/Reference/Gestalt_Manager/Reference/reference.html#//apple_ref/doc/uid/TP30000036-CH1g-F01632 // System Version Selectors diff --git a/platform/util/testSrc/com/intellij/util/VersionUtilTest.java b/platform/util/testSrc/com/intellij/util/VersionUtilTest.java index 73be8fc2b0d9..9726998eb077 100644 --- a/platform/util/testSrc/com/intellij/util/VersionUtilTest.java +++ b/platform/util/testSrc/com/intellij/util/VersionUtilTest.java @@ -55,13 +55,13 @@ public class VersionUtilTest extends TestCase { {"java version \"9-ea\"", new Version(9, 0, 0), 0}, }; - public void testParseVersion() throws Exception { + public void testParseVersion() { for (Object[] aTestData : testDataVersion) { String versionString = (String)aTestData[0]; assertEquals("For \"" + versionString + "\"", aTestData[1], VersionUtil.parseVersion(versionString, VERSION_PATTERNS)); } } - public void testParseVersionAndUpdate() throws Exception { + public void testParseVersionAndUpdate() { for (Object[] aTestData : testDataVersionUpdate) { String versionString = (String)aTestData[0]; Pair versionAndUpdate = VersionUtil.parseNewVersionAndUpdate(versionString, LINE_TO_VERSION_PATTERNS); diff --git a/platform/util/testSrc/com/intellij/util/concurrency/BlockingSetTest.java b/platform/util/testSrc/com/intellij/util/concurrency/BlockingSetTest.java index a8c658cc3ce8..a8a28b792cd4 100644 --- a/platform/util/testSrc/com/intellij/util/concurrency/BlockingSetTest.java +++ b/platform/util/testSrc/com/intellij/util/concurrency/BlockingSetTest.java @@ -13,7 +13,7 @@ import java.util.concurrent.atomic.AtomicBoolean; */ public class BlockingSetTest { @Test - public void testSingleThreadLock() throws Exception { + public void testSingleThreadLock() { BlockingSet lock = new BlockingSet<>(); lock.put("eins"); lock.put("zwei"); @@ -24,7 +24,7 @@ public class BlockingSetTest { } @Test(expected = IllegalStateException.class) - public void testReleaseNotAcquired() throws Exception { + public void testReleaseNotAcquired() { BlockingSet lock = new BlockingSet<>(); lock.put("eins"); lock.put("zwei"); diff --git a/platform/util/testSrc/com/intellij/util/containers/ByteArrayQueueTest.java b/platform/util/testSrc/com/intellij/util/containers/ByteArrayQueueTest.java index 6d0a4d0d7d9a..4debfa178ef9 100644 --- a/platform/util/testSrc/com/intellij/util/containers/ByteArrayQueueTest.java +++ b/platform/util/testSrc/com/intellij/util/containers/ByteArrayQueueTest.java @@ -8,7 +8,7 @@ import junit.framework.Assert; public class ByteArrayQueueTest { @org.junit.Test - public void testSingleAdd() throws Exception { + public void testSingleAdd() { ByteArrayQueue queue = new ByteArrayQueue(0); byte value = 1; queue.add(value); @@ -18,7 +18,7 @@ public class ByteArrayQueueTest { } @org.junit.Test - public void testResize1() throws Exception { + public void testResize1() { ByteArrayQueue queue = new ByteArrayQueue(4); byte[] buf = new byte[] {1, 2, 3, 4, 5}; queue.addAll(buf); @@ -30,7 +30,7 @@ public class ByteArrayQueueTest { } @org.junit.Test - public void testResize2() throws Exception { + public void testResize2() { ByteArrayQueue queue = new ByteArrayQueue(4); byte[] buf = new byte[] {1, 2, 3, 4, 5, 6, 7, 8}; queue.addAll(buf); diff --git a/platform/util/testSrc/com/intellij/util/containers/CircularCharBufferTest.java b/platform/util/testSrc/com/intellij/util/containers/CircularCharBufferTest.java index 9cc31b6a4966..be39e69ea59f 100644 --- a/platform/util/testSrc/com/intellij/util/containers/CircularCharBufferTest.java +++ b/platform/util/testSrc/com/intellij/util/containers/CircularCharBufferTest.java @@ -20,7 +20,7 @@ import org.junit.Test; public class CircularCharBufferTest { @Test - public void testSingleAdd() throws Exception { + public void testSingleAdd() { CircularCharBuffer queue = new CircularCharBuffer(0); char value = '1'; queue.add(value); @@ -30,7 +30,7 @@ public class CircularCharBufferTest { } @Test - public void testResize1() throws Exception { + public void testResize1() { CircularCharBuffer queue = new CircularCharBuffer(4); char[] buf = {'1', '2', '3', '4', '5'}; queue.add(buf); @@ -42,7 +42,7 @@ public class CircularCharBufferTest { } @Test - public void testResize2() throws Exception { + public void testResize2() { CircularCharBuffer queue = new CircularCharBuffer(4, 16); char[] buf = {'1', '2', '3', '4', '5', '6', '7', '8'}; queue.add(buf); @@ -67,7 +67,7 @@ public class CircularCharBufferTest { } @Test - public void testAddString() throws Exception { + public void testAddString() { CircularCharBuffer queue = new CircularCharBuffer(2, 16); queue.add(""); Assert.assertEquals(0, queue.size()); @@ -79,7 +79,7 @@ public class CircularCharBufferTest { } @Test - public void testOverflow() throws Exception { + public void testOverflow() { CircularCharBuffer queue = new CircularCharBuffer(1, 4); queue.add("1"); Assert.assertEquals("1", queue.getText()); @@ -102,7 +102,7 @@ public class CircularCharBufferTest { } @Test - public void testOverflowComplex() throws Exception { + public void testOverflowComplex() { CircularCharBuffer queue = new CircularCharBuffer(1, 10); String alphabet = "abcdefghijklmnopqrstuvwxyz"; queue.add(alphabet); diff --git a/platform/util/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java b/platform/util/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java index df595298c22b..d2fb9979e5be 100644 --- a/platform/util/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java +++ b/platform/util/testSrc/com/intellij/util/containers/ConcurrentBitSetTest.java @@ -70,7 +70,7 @@ public class ConcurrentBitSetTest extends TestCase { assertEquals(bitSet, emptySet); } - public void testStress() throws InterruptedException { + public void testStress() { final ConcurrentBitSet bitSet = new ConcurrentBitSet(); int N = 100; final int L = 100; @@ -91,7 +91,7 @@ public class ConcurrentBitSetTest extends TestCase { assertEquals(-1, bitSet.nextSetBit(0)); } - public void testStress2_Performance() throws InterruptedException { + public void testStress2_Performance() { final ConcurrentBitSet bitSet = new ConcurrentBitSet(); int N = 10; final int L = 1000000; diff --git a/platform/util/testSrc/com/intellij/util/containers/MostlySingularMultiMapTest.java b/platform/util/testSrc/com/intellij/util/containers/MostlySingularMultiMapTest.java index e9178c275765..93d6e357b417 100644 --- a/platform/util/testSrc/com/intellij/util/containers/MostlySingularMultiMapTest.java +++ b/platform/util/testSrc/com/intellij/util/containers/MostlySingularMultiMapTest.java @@ -175,7 +175,7 @@ public class MostlySingularMultiMapTest extends TestCase { map1.get("k3d")); } - public void testAddAllDoesntOwnOriginalValues() throws Exception { + public void testAddAllDoesntOwnOriginalValues() { MostlySingularMultiMap mapEmpty = new MostlySingularMultiMap<>(); MostlySingularMultiMap mapWithOne = new MostlySingularMultiMap<>(); MostlySingularMultiMap mapWithMultiple = new MostlySingularMultiMap<>(); diff --git a/platform/util/testSrc/com/intellij/util/containers/PathInternerTest.java b/platform/util/testSrc/com/intellij/util/containers/PathInternerTest.java index 49494ede6ad7..1c5d547bdb6c 100644 --- a/platform/util/testSrc/com/intellij/util/containers/PathInternerTest.java +++ b/platform/util/testSrc/com/intellij/util/containers/PathInternerTest.java @@ -17,7 +17,6 @@ package com.intellij.util.containers; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.util.io.FileUtil; -import com.intellij.util.Processor; import gnu.trove.THashSet; import junit.framework.TestCase; @@ -67,7 +66,7 @@ public class PathInternerTest extends TestCase { } @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") - public static void main(String[] args) throws InterruptedException, IOException { + public static void main(String[] args) throws IOException { final HashSet hs = new HashSet<>(); FileUtil.processFilesRecursively(new File(PathManager.getHomePath()), file -> { hs.add(file.getPath()); diff --git a/platform/util/testSrc/com/intellij/util/containers/SequenceIteratorTest.java b/platform/util/testSrc/com/intellij/util/containers/SequenceIteratorTest.java index 7f9b4c15265e..fea99312312c 100644 --- a/platform/util/testSrc/com/intellij/util/containers/SequenceIteratorTest.java +++ b/platform/util/testSrc/com/intellij/util/containers/SequenceIteratorTest.java @@ -63,7 +63,7 @@ public class SequenceIteratorTest extends TestCase { } - public void testSimple() throws Exception { + public void testSimple() { final Iterator iterator = compose(Arrays.asList(iter(arr1), iter(arr2), iter(arr3))); int cnt = 0; while (iterator.hasNext()) { @@ -77,7 +77,7 @@ public class SequenceIteratorTest extends TestCase { return ContainerUtil.concatIterators(iterators); } - public void testOne() throws Exception { + public void testOne() { final Iterator iterator = compose(Arrays.asList(iter(arr1))); int cnt = 0; while (iterator.hasNext()) { @@ -87,7 +87,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertEquals(arr1.length, cnt); } - public void testOneOne() throws Exception { + public void testOneOne() { final Iterator iterator = compose(Arrays.asList(iter(new Integer[]{1}))); int cnt = 0; while (iterator.hasNext()) { @@ -97,7 +97,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertEquals(1, cnt); } - public void testEmpty() throws Exception { + public void testEmpty() { final Iterator iterator = compose(Arrays.asList(iter(new Integer[]{}))); int cnt = 0; while (iterator.hasNext()) { @@ -107,7 +107,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertEquals(0, cnt); } - public void testManyEmpty() throws Exception { + public void testManyEmpty() { final Iterator iterator = compose(Arrays.asList(iter(new Integer[]{}), iter(new Integer[]{}), iter(new Integer[]{}))); int cnt = 0; @@ -118,7 +118,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertEquals(0, cnt); } - public void testRemoveSimple() throws Exception { + public void testRemoveSimple() { final ArrayList list1 = new ArrayList<>(Arrays.asList(arr1)); final ArrayList list2 = new ArrayList<>(Arrays.asList(arr2)); final ArrayList list3 = new ArrayList<>(Arrays.asList(arr3)); @@ -138,7 +138,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertTrue(! list3.contains(103)); } - public void testRemoveAfterLast() throws Exception { + public void testRemoveAfterLast() { final ArrayList list1 = new ArrayList<>(Arrays.asList(arr1)); final Iterator it1 = list1.iterator(); while (it1.hasNext()) { @@ -160,7 +160,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertTrue(! list3.contains(105)); } - public void testRemoveOnlyOne() throws Exception { + public void testRemoveOnlyOne() { final ArrayList list1 = new ArrayList<>(Arrays.asList(new Integer[]{1})); final Iterator iterator = compose(Arrays.asList(list1.iterator())); iterator.next(); @@ -168,7 +168,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertTrue(list1.isEmpty()); } - public void testIterateWithEmptyInside() throws Exception { + public void testIterateWithEmptyInside() { final Iterator iterator = compose(Arrays.asList(iter(arr1), iter(new Integer[]{}), iter(arr3))); int cnt = 0; int sum = 0; @@ -181,7 +181,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertEquals(530, sum); } - public void testRemoveIfNextNotCalled() throws Exception { + public void testRemoveIfNextNotCalled() { final ArrayList list1 = new ArrayList<>(Arrays.asList(new Integer[]{1})); final Iterator iterator = compose(Arrays.asList(list1.iterator())); try { @@ -192,7 +192,7 @@ public class SequenceIteratorTest extends TestCase { } } - public void testRemoveTwice() throws Exception { + public void testRemoveTwice() { final ArrayList list1 = new ArrayList<>(Arrays.asList(new Integer[]{1, 2, 3, 4, 5})); final Iterator iterator = compose(Arrays.asList(list1.iterator())); try { @@ -205,7 +205,7 @@ public class SequenceIteratorTest extends TestCase { } } - public void testRemoveAll() throws Exception { + public void testRemoveAll() { final ArrayList list1 = new ArrayList<>(Arrays.asList(1, 2)); final ArrayList list2 = new ArrayList<>(Arrays.asList(3, 4)); final ArrayList list3 = new ArrayList<>(Arrays.asList(5, 6)); @@ -221,7 +221,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertTrue(list3.isEmpty()); } - public void testRemoveAllWithEmptyInside() throws Exception { + public void testRemoveAllWithEmptyInside() { final ArrayList list1 = new ArrayList<>(Arrays.asList(1, 2)); final ArrayList list2 = new ArrayList<>(); final ArrayList list3 = new ArrayList<>(Arrays.asList(5, 6)); @@ -237,7 +237,7 @@ public class SequenceIteratorTest extends TestCase { Assert.assertTrue(list3.isEmpty()); } - public void testRemoveLastAndFirstINNext() throws Exception { + public void testRemoveLastAndFirstINNext() { final ArrayList list1 = new ArrayList<>(Arrays.asList(1, 2)); final ArrayList list2 = new ArrayList<>(Arrays.asList(3, 4)); final ArrayList list3 = new ArrayList<>(Arrays.asList(5, 6)); diff --git a/platform/util/testSrc/com/intellij/util/diff/DiffTreeTest.java b/platform/util/testSrc/com/intellij/util/diff/DiffTreeTest.java index 9f18bce13ed5..992e14646360 100644 --- a/platform/util/testSrc/com/intellij/util/diff/DiffTreeTest.java +++ b/platform/util/testSrc/com/intellij/util/diff/DiffTreeTest.java @@ -154,7 +154,7 @@ public class DiffTreeTest extends TestCase { } } - public void testEmptyEqualRoots() throws Exception { + public void testEmptyEqualRoots() { Node r1 = new Node(0,0); Node r2 = new Node(0,0); final String expected = ""; @@ -162,7 +162,7 @@ public class DiffTreeTest extends TestCase { performTest(r1, r2, expected); } - public void testSingleChildEqualRoots() throws Exception { + public void testSingleChildEqualRoots() { Node r1 = new Node(0,0, new Node(1,0)); Node r2 = new Node(0,0, new Node(1,0)); final String expected = ""; @@ -170,7 +170,7 @@ public class DiffTreeTest extends TestCase { performTest(r1, r2, expected); } - public void testTheOnlyChildRemoved() throws Exception { + public void testTheOnlyChildRemoved() { Node r1 = new Node(0,0, new Node(1,0)); Node r2 = new Node(0,0); String expected = "DELETED from 0: 1"; @@ -178,7 +178,7 @@ public class DiffTreeTest extends TestCase { performTest(r1, r2, expected); } - public void testTheOnlyChildAdded() throws Exception { + public void testTheOnlyChildAdded() { Node r1 = new Node(0,0); Node r2 = new Node(0,0, new Node(1,0)); String expected = "INSERTED to 0: 1 at 0"; @@ -187,7 +187,7 @@ public class DiffTreeTest extends TestCase { } - public void testTheOnlyChildReplaced() throws Exception { + public void testTheOnlyChildReplaced() { Node r1 = new Node(0,0, new Node(1,0)); Node r2 = new Node(0,0, new Node(2,0)); String expected = "REPLACED: 1 to 2"; @@ -195,7 +195,7 @@ public class DiffTreeTest extends TestCase { performTest(r1, r2, expected); } - public void testInsertedIntoTheMiddle() throws Exception { + public void testInsertedIntoTheMiddle() { Node r1 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(3,1))); Node r2 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(4,1), new Node(3,2))); String expected = "INSERTED to 1: 4 at 1"; @@ -203,7 +203,7 @@ public class DiffTreeTest extends TestCase { performTest(r1, r2, expected); } - public void testInsertedFirst() throws Exception { + public void testInsertedFirst() { Node r1 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(4,1))); Node r2 = new Node(0,0, new Node(1,0, new Node(3,0), new Node(2,1), new Node(4,2))); String expected = "INSERTED to 1: 3 at 0"; @@ -211,7 +211,7 @@ public class DiffTreeTest extends TestCase { performTest(r1, r2, expected); } - public void testInsertedLast() throws Exception { + public void testInsertedLast() { Node r1 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(3,1))); Node r2 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(3,1), new Node(4,2))); String expected = "INSERTED to 1: 4 at 2"; @@ -219,21 +219,21 @@ public class DiffTreeTest extends TestCase { performTest(r1, r2, expected); } - public void testInsertedTwoLast() throws Exception { + public void testInsertedTwoLast() { Node r1 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(3,1))); Node r2 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(3,1), new Node(4,2), new Node(5,3))); performTest(r1, r2, "INSERTED to 1: 4 at 2", "INSERTED to 1: 5 at 3"); } - public void testSubtreeAppears() throws Exception { + public void testSubtreeAppears() { Node r1 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(3,1), new Node(4,2))); Node r2 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(3,1, new Node(6,1)), new Node(4,2))); performTest(r1, r2, "INSERTED to 3: 6 at 0"); } - public void testSubtreeChanges() throws Exception { + public void testSubtreeChanges() { Node r1 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(3,1, new Node(6,1)), new Node(4,2))); Node r2 = new Node(0,0, new Node(1,0, new Node(2,0), new Node(5,1, new Node(6,1)), new Node(4,2))); diff --git a/platform/util/testSrc/com/intellij/util/diff/IntLCSNewTest.java b/platform/util/testSrc/com/intellij/util/diff/IntLCSNewTest.java index 647243c5602e..0aa48409953d 100644 --- a/platform/util/testSrc/com/intellij/util/diff/IntLCSNewTest.java +++ b/platform/util/testSrc/com/intellij/util/diff/IntLCSNewTest.java @@ -20,37 +20,37 @@ import junit.framework.TestCase; import java.util.BitSet; public class IntLCSNewTest extends TestCase { - public void testEqual() throws FilesTooBigForDiffException { + public void testEqual() { BitSet[] change = buildChange(new int[]{1, 2, 3}, new int[]{1, 2, 3}); checkChange(change, new int[]{0, 0, 0}, new int[]{0, 0, 0}); } - public void testOneAtBegging() throws FilesTooBigForDiffException { + public void testOneAtBegging() { BitSet[] change = buildChange(new int[]{1, 2}, new int[]{1, 3}); checkChange(change, new int[]{0, 1}, new int[]{0, 1}); } - public void testOneAntEnd() throws FilesTooBigForDiffException { + public void testOneAntEnd() { BitSet[] change = buildChange(new int[]{1, 3}, new int[]{2, 3}); checkChange(change, new int[]{1, 0}, new int[]{1, 0}); } - public void testOneOverAtEnd() throws FilesTooBigForDiffException { + public void testOneOverAtEnd() { BitSet[] change = buildChange(new int[]{1, 2}, new int[]{1, 2, 3}); checkChange(change, new int[]{0, 0}, new int[]{0, 0, 1}); } - public void testOneOverAtBegging() throws FilesTooBigForDiffException { + public void testOneOverAtBegging() { BitSet[] change = buildChange(new int[]{1, 2, 3}, new int[]{2, 3}); checkChange(change, new int[]{1, 0, 0}, new int[]{0, 0}); } - public void testSingleMiddle() throws FilesTooBigForDiffException { + public void testSingleMiddle() { BitSet[] change = buildChange(new int[]{1, 2, 3}, new int[]{4, 2, 5}); checkChange(change, new int[]{1, 0, 1}, new int[]{1, 0, 1}); } - public void testAbsolutelyDifferent() throws FilesTooBigForDiffException { + public void testAbsolutelyDifferent() { BitSet[] change1 = buildChange(new int[]{1, 2}, new int[]{3, 4}); checkChange(change1, new int[]{1, 1}, new int[]{1, 1}); @@ -58,19 +58,19 @@ public class IntLCSNewTest extends TestCase { checkChange(change2, new int[]{1, 1, 1}, new int[]{1, 1, 1}); } - public void testSingleUniqueMoved() throws FilesTooBigForDiffException { + public void testSingleUniqueMoved() { BitSet[] change = buildChange(new int[]{1, 1, 2, 2, 10}, new int[]{10, 1, 1, 2, 2}); checkChange(change, new int[]{0, 0, 0, 0, 1}, new int[]{1, 0, 0, 0, 0}); } - public void testSingleFunctionMoved() throws FilesTooBigForDiffException { + public void testSingleFunctionMoved() { BitSet[] change = buildChange(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 7, 9, 10, 2, 11, 12, 5, 13, 7, 8, 7}, new int[]{10, 2, 11, 12, 5, 13, 7, 8, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 7}); checkChange(change, new int[]{1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1}, new int[]{1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1}); } - private static BitSet[] buildChange(int[] first, int[] second) throws FilesTooBigForDiffException { + private static BitSet[] buildChange(int[] first, int[] second) { MyersLCS myersLCS = new MyersLCS(first, second); myersLCS.execute(); return myersLCS.getChanges(); diff --git a/platform/util/testSrc/com/intellij/util/diff/IntLCSTest.java b/platform/util/testSrc/com/intellij/util/diff/IntLCSTest.java index aa8ee8d2058e..1fb4841616b9 100644 --- a/platform/util/testSrc/com/intellij/util/diff/IntLCSTest.java +++ b/platform/util/testSrc/com/intellij/util/diff/IntLCSTest.java @@ -24,47 +24,47 @@ import java.util.BitSet; * @author dyoma */ public class IntLCSTest extends TestCase { - public void testDiag() throws FilesTooBigForDiffException { + public void testDiag() { Diff.Change change = buildChange(new int[]{1, 2, 3}, new int[]{1, 2, 3}, 0); assertNull(change); } - public void testOneAtBegging() throws FilesTooBigForDiffException { + public void testOneAtBegging() { Diff.Change change = buildChange(new int[]{1, 2}, new int[]{1, 3}, 2); checkLastChange(change, 1, 1, 1, 1); } - public void testOneAntEnd() throws FilesTooBigForDiffException { + public void testOneAntEnd() { Diff.Change change = buildChange(new int[]{1, 3}, new int[]{2, 3}, 2); checkLastChange(change, 0, 0, 1, 1); } - public void testOneOverAtEnd() throws FilesTooBigForDiffException { + public void testOneOverAtEnd() { Diff.Change change = buildChange(new int[]{1, 2}, new int[]{1, 2, 3}, 1); checkLastChange(change, 2, 2, 1, 0); } - public void testOneOverAtBegging() throws FilesTooBigForDiffException { + public void testOneOverAtBegging() { Diff.Change change = buildChange(new int[]{1, 2, 3}, new int[]{2, 3}, 1); checkLastChange(change, 0, 0, 0, 1); } - public void testOneTail() throws FilesTooBigForDiffException { + public void testOneTail() { assertEquals(1, countChanges(new int[]{1, 2}, new int[]{1, 2, 3})); } - public void testSingleMiddle() throws FilesTooBigForDiffException { + public void testSingleMiddle() { Diff.Change change = buildChange(new int[]{1, 2, 3}, new int[]{4, 2, 5}, 4); checkChange(change, 0, 0, 1, 1); checkLastChange(change.link, 2, 2, 1, 1); } - public void testAbsolutelyDifferent() throws FilesTooBigForDiffException { + public void testAbsolutelyDifferent() { assertEquals(4, countChanges(new int[]{1, 2}, new int[]{3, 4})); assertEquals(6, countChanges(new int[]{1, 2, 3}, new int[]{4, 5, 6})); } - private static Diff.Change buildChange(int[] first, int[] second, int expectedNonDiags) throws FilesTooBigForDiffException { + private static Diff.Change buildChange(int[] first, int[] second, int expectedNonDiags) { assertEquals(expectedNonDiags, countChanges(first, second)); MyersLCS intLCS = new MyersLCS(first, second); intLCS.execute(); @@ -89,7 +89,7 @@ public class IntLCSTest extends TestCase { assertNull("Expected last change", change.link); } - private static int countChanges(int[] first, int[] second) throws FilesTooBigForDiffException { + private static int countChanges(int[] first, int[] second) { MyersLCS lcs = new MyersLCS(first, second); lcs.execute(); BitSet[] changes = lcs.getChanges(); diff --git a/platform/util/testSrc/com/intellij/util/diff/PatienceIntLCSTest.java b/platform/util/testSrc/com/intellij/util/diff/PatienceIntLCSTest.java index 4932a3361ddb..80c926356088 100644 --- a/platform/util/testSrc/com/intellij/util/diff/PatienceIntLCSTest.java +++ b/platform/util/testSrc/com/intellij/util/diff/PatienceIntLCSTest.java @@ -98,35 +98,35 @@ public class PatienceIntLCSTest extends TestCase { checkChange(change, new int[]{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, new int[]{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}); } - public void testNotAbortedEqual() throws FilesTooBigForDiffException { + public void testNotAbortedEqual() { checkAborted(false, new int[]{1, 2, 3}, new int[]{1, 2, 3}); } - public void testNotAbortedSimple() throws FilesTooBigForDiffException { + public void testNotAbortedSimple() { checkAborted(false, new int[]{100, 1, 2, 3, 4, 5, 100}, new int[]{1, 2, 3, 4}); } - public void testAbortedNoMatches() throws FilesTooBigForDiffException { + public void testAbortedNoMatches() { checkAborted(true, new int[]{4, 1, 2, 3}, new int[]{500, 100, 600,}); } - public void testAbortedSimple() throws FilesTooBigForDiffException { + public void testAbortedSimple() { checkAborted(true, new int[]{4, 1, 2, 3, 100}, new int[]{5, 1, 6, 8, 9, 10}); } - public void testNotAbortedSecondStep() throws FilesTooBigForDiffException { + public void testNotAbortedSecondStep() { checkAborted(false, new int[]{100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 100}, new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}); } - public void testNotAbortedThirdStep() throws FilesTooBigForDiffException { + public void testNotAbortedThirdStep() { checkAborted(false, new int[]{100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 1, 0, 100}, new int[]{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2}); } - public void testAbortedForthStep() throws FilesTooBigForDiffException { + public void testAbortedForthStep() { checkAborted(true, new int[]{100, 3, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 1, 0, 100}, new int[]{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 2}); diff --git a/platform/util/testSrc/com/intellij/util/diff/ReindexerNewTest.java b/platform/util/testSrc/com/intellij/util/diff/ReindexerNewTest.java index 764515e43c38..bca310fd451a 100644 --- a/platform/util/testSrc/com/intellij/util/diff/ReindexerNewTest.java +++ b/platform/util/testSrc/com/intellij/util/diff/ReindexerNewTest.java @@ -21,37 +21,37 @@ import java.util.BitSet; import java.util.Random; public class ReindexerNewTest extends TestCase { - public void testAllUnique() throws FilesTooBigForDiffException { + public void testAllUnique() { checkCase(new int[]{1, 2, 3}, new int[]{4, 5}); checkCase(new int[]{}, new int[]{4, 5}); checkCase(new int[]{1, 2, 3}, new int[]{}); } - public void testUniqueBeginning() throws FilesTooBigForDiffException { + public void testUniqueBeginning() { checkCase(new int[]{13, 15, 1, 2, 3}, new int[]{17, 1, 3}); } - public void testUniqueEnd() throws FilesTooBigForDiffException { + public void testUniqueEnd() { checkCase(new int[]{1, 2, 3, 13, 15}, new int[]{1, 3, 17}); } - public void testSingleUniqueMoved() throws FilesTooBigForDiffException { + public void testSingleUniqueMoved() { checkCase(new int[]{1, 1, 2, 2, 10}, new int[]{10, 1, 1, 2, 2}); } - public void testSingleFunctionMoved() throws FilesTooBigForDiffException { + public void testSingleFunctionMoved() { checkCase(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 7, 9, 10, 2, 11, 12, 5, 13, 7, 8, 7}, new int[]{10, 2, 11, 12, 5, 13, 7, 8, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 7}); } - public void testInnerChunks() throws FilesTooBigForDiffException { + public void testInnerChunks() { checkCase(new int[]{0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0}, new int[]{1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1}); checkCase(new int[]{0, 2, 3, 0, 4, 5, 0}, new int[]{1, 2, 1, 3, 4, 5, 1}); checkCase(new int[]{15, 1, 2, 3, 1, 4, 5, 1, 15}, new int[]{13, 1, 2, 1, 3, 4, 5, 1, 13}); checkCase(new int[]{15, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 15}, new int[]{13, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 13}); } - public void testRandomExample() throws FilesTooBigForDiffException { + public void testRandomExample() { int[] ints1 = new int[100]; int[] ints2 = new int[100]; Random rng = new Random(); @@ -76,11 +76,11 @@ public class ReindexerNewTest extends TestCase { } } - public static void checkCase(int[] ints1, int[] ints2) throws FilesTooBigForDiffException { + public static void checkCase(int[] ints1, int[] ints2) { checkCase(ints1, ints2, ""); } - public static void checkCase(int[] ints1, int[] ints2, String message) throws FilesTooBigForDiffException { + public static void checkCase(int[] ints1, int[] ints2, String message) { final BitSet[] reindexChanges = new BitSet[]{new BitSet(), new BitSet()}; LCSBuilder builder = new LCSBuilder() { private int myIndex1 = 0; diff --git a/platform/util/testSrc/com/intellij/util/diff/UniqueLCSTest.java b/platform/util/testSrc/com/intellij/util/diff/UniqueLCSTest.java index 231d961c620c..d9a154f4942c 100644 --- a/platform/util/testSrc/com/intellij/util/diff/UniqueLCSTest.java +++ b/platform/util/testSrc/com/intellij/util/diff/UniqueLCSTest.java @@ -18,7 +18,7 @@ package com.intellij.util.diff; import junit.framework.TestCase; public class UniqueLCSTest extends TestCase { - public void testNoUnique() throws FilesTooBigForDiffException { + public void testNoUnique() { int[][] change = buildChange(new int[]{1, 2, 3}, new int[]{4, 5, 6}); assertNull(change); @@ -47,7 +47,7 @@ public class UniqueLCSTest extends TestCase { assertNull(change); } - public void testSingleUnique() throws FilesTooBigForDiffException { + public void testSingleUnique() { int[][] change = buildChange(new int[]{1}, new int[]{1}); checkChange(change, new int[]{0}, new int[]{0}); @@ -67,28 +67,28 @@ public class UniqueLCSTest extends TestCase { checkChange(change, new int[]{1}, new int[]{1}); } - public void testSingleSequence() throws FilesTooBigForDiffException { + public void testSingleSequence() { int[][] change = buildChange(new int[]{2, 4, 6, 1, 8, 3, 8, 2, 6, 5, 2, 4, 7, 11, 13}, new int[]{1, 10, 2, 3, 5, 7, 11, 13, 12}); checkChange(change, new int[]{3, 5, 9, 12, 13, 14}, new int[]{0, 3, 4, 5, 6, 7}); } - public void testLargestLCS1() throws FilesTooBigForDiffException { + public void testLargestLCS1() { checkMaxSequence(new int[]{1, 2, 3}, new int[]{1, 2, 3}); } - public void testLargestLCS2() throws FilesTooBigForDiffException { + public void testLargestLCS2() { checkMaxSequence(new int[]{5, 6, 1, 2, 3}, new int[]{1, 2, 3}); } - public void testLargestLCS3() throws FilesTooBigForDiffException { + public void testLargestLCS3() { checkMaxSequence(new int[]{0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 7, 15}, new int[]{0, 2, 6, 9, 13, 15}); } - public void testLargestLCS4() throws FilesTooBigForDiffException { + public void testLargestLCS4() { checkMaxSequence(new int[]{1, 9, 3, 8, 11, 4, 5, 6, 19, 7}, new int[]{1, 3, 4, 5, 6, 7}); } - private static int[][] buildChange(int[] first, int[] second) throws FilesTooBigForDiffException { + private static int[][] buildChange(int[] first, int[] second) { UniqueLCS uniqueLCS = new UniqueLCS(first, second); return uniqueLCS.execute(); } @@ -102,7 +102,7 @@ public class UniqueLCSTest extends TestCase { } } - private static void checkMaxSequence(int[] sequence, int[] expected) throws FilesTooBigForDiffException { + private static void checkMaxSequence(int[] sequence, int[] expected) { int max = 0; for (int i = 0; i < sequence.length; i++) { max = Math.max(sequence[i] + 1, max); diff --git a/platform/util/testSrc/com/intellij/util/io/UrlUtilTest.java b/platform/util/testSrc/com/intellij/util/io/UrlUtilTest.java index 8c4c1773ff34..a94660900967 100644 --- a/platform/util/testSrc/com/intellij/util/io/UrlUtilTest.java +++ b/platform/util/testSrc/com/intellij/util/io/UrlUtilTest.java @@ -138,7 +138,7 @@ public class UrlUtilTest { } @Test - public void testUrlParsing() throws Exception { + public void testUrlParsing() { doUrlTest("not detecting jetbrains.com", null); doUrlTest("mailto:admin@jetbrains.com;", "mailto:admin@jetbrains.com"); doUrlTest("news://jetbrains.com is good", "news://jetbrains.com"); @@ -167,7 +167,7 @@ public class UrlUtilTest { } @Test - public void testEncodeURIComponent() throws Exception { + public void testEncodeURIComponent() { assertEquals("Test", URLUtil.encodeURIComponent("Test")); assertEquals("%20Test%20%20(~%2Fpath!)", URLUtil.encodeURIComponent(" Test (~/path!)")); StringBuilder str = new StringBuilder(""); diff --git a/platform/util/testSrc/com/intellij/util/pico/IdeaPicoContainerTest.java b/platform/util/testSrc/com/intellij/util/pico/IdeaPicoContainerTest.java index 4f3c00ec50cc..a04f87fdb52e 100644 --- a/platform/util/testSrc/com/intellij/util/pico/IdeaPicoContainerTest.java +++ b/platform/util/testSrc/com/intellij/util/pico/IdeaPicoContainerTest.java @@ -24,12 +24,12 @@ public class IdeaPicoContainerTest { private MutablePicoContainer myContainer; @Before - public void setUp() throws Exception { + public void setUp() { myContainer = new DefaultPicoContainer(); } @Test - public void testUnregister() throws Exception { + public void testUnregister() { String key = "myObject"; MyComponentClass instance = new MyComponentClass(); myContainer.registerComponentInstance(key, instance); diff --git a/platform/util/testSrc/com/intellij/util/text/MarkdownUtilTest.java b/platform/util/testSrc/com/intellij/util/text/MarkdownUtilTest.java index 28757d890b09..9fde738f6ac2 100644 --- a/platform/util/testSrc/com/intellij/util/text/MarkdownUtilTest.java +++ b/platform/util/testSrc/com/intellij/util/text/MarkdownUtilTest.java @@ -28,14 +28,14 @@ import java.util.List; public class MarkdownUtilTest { @Test - public void testReplaceHeaders() throws Exception { + public void testReplaceHeaders() { List markdown = ContainerUtil.newArrayList("# Hello1", "## Hello2##", "### Hello3#"); MarkdownUtil.replaceHeaders(markdown); Assert.assertEquals(ContainerUtil.newArrayList("

Hello1

", "

Hello2

", "

Hello3

"), markdown); } @Test - public void testRemoveImage() throws Exception { + public void testRemoveImage() { List markdown = Arrays.asList( "![logo](http://localhost/logo.png)", "Hello, [node](http://nodejs.org). [![Build Status](https://secure.travis-ci.org/visionmedia/express.png)](http://travis-ci.org/visionmedia/express) [![Dependency Status](https://gemnasium.com/visionmedia/express.png)](https://gemnasium.com/visionmedia/express)" @@ -48,14 +48,14 @@ public class MarkdownUtilTest { } @Test - public void testRemoveImageEdgeCase() throws Exception { + public void testRemoveImageEdgeCase() { List markdown = Arrays.asList("[![logo](http://localhost/logo.png)]"); MarkdownUtil.removeImages(markdown); Assert.assertEquals(Arrays.asList("[]"),markdown); } @Test - public void testReplaceCodeBlocks() throws Exception { + public void testReplaceCodeBlocks() { List markdown = Arrays.asList(" Create the app:", "", " $ npm install -g express", @@ -68,7 +68,7 @@ public class MarkdownUtilTest { } @Test - public void testReplaceCodeBlocks2() throws Exception { + public void testReplaceCodeBlocks2() { List markdown = Arrays.asList( " text", " code block", @@ -98,7 +98,7 @@ public class MarkdownUtilTest { } @Test - public void testReplaceLists1() throws Exception { + public void testReplaceLists1() { List markdown = Arrays.asList( "* Red", "* Green", @@ -116,7 +116,7 @@ public class MarkdownUtilTest { } @Test - public void testReplaceLists2() throws Exception { + public void testReplaceLists2() { List markdown = Arrays.asList( "1. Red", "", @@ -134,7 +134,7 @@ public class MarkdownUtilTest { } @Test - public void testReplaceLists3() throws Exception { + public void testReplaceLists3() { List markdown = Arrays.asList( "1986\\. What a great season." ); @@ -148,7 +148,7 @@ public class MarkdownUtilTest { } @Test - public void testReplaceLists4() throws Exception { + public void testReplaceLists4() { List markdown = Arrays.asList( "+ one two", "three", diff --git a/platform/util/testSrc/com/intellij/util/text/StringUtilTest.java b/platform/util/testSrc/com/intellij/util/text/StringUtilTest.java index cc3acb45e840..c49c78bf17a0 100644 --- a/platform/util/testSrc/com/intellij/util/text/StringUtilTest.java +++ b/platform/util/testSrc/com/intellij/util/text/StringUtilTest.java @@ -21,11 +21,11 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.LineSeparator; import com.intellij.util.containers.ContainerUtil; import com.intellij.xml.util.XmlStringUtil; +import jetCheck.Generator; +import jetCheck.PropertyChecker; import org.jdom.Verifier; import org.jetbrains.annotations.NotNull; import org.junit.Test; -import jetCheck.Generator; -import jetCheck.PropertyChecker; import java.nio.CharBuffer; import java.util.Arrays; @@ -40,7 +40,7 @@ import static org.junit.Assert.*; */ public class StringUtilTest { @Test - public void testTrimLeadingChar() throws Exception { + public void testTrimLeadingChar() { doTestTrimLeading("", ""); doTestTrimLeading("", " "); doTestTrimLeading("", " "); @@ -49,7 +49,7 @@ public class StringUtilTest { } @Test - public void testTrimTrailingChar() throws Exception { + public void testTrimTrailingChar() { doTestTrimTrailing("", ""); doTestTrimTrailing("", " "); doTestTrimTrailing("", " "); @@ -94,7 +94,7 @@ public class StringUtilTest { } @Test - public void testIsEmptyOrSpaces() throws Exception { + public void testIsEmptyOrSpaces() { assertTrue(StringUtil.isEmptyOrSpaces(null)); assertTrue(StringUtil.isEmptyOrSpaces("")); assertTrue(StringUtil.isEmptyOrSpaces(" ")); diff --git a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerUtilTest.java b/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerUtilTest.java index 5214b66928c9..0eeceae97371 100644 --- a/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerUtilTest.java +++ b/platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerUtilTest.java @@ -29,14 +29,14 @@ public class XmlSerializerUtilTest extends TestCase { assertEquals("x", copy.s); } - public void testCopyBeanOfSameClass() throws Exception { + public void testCopyBeanOfSameClass() { BaseBean to = new BaseBean(); XmlSerializerUtil.copyBean(new BaseBean("a", 1), to); assertEquals(1, to.i); assertEquals("a", to.s); } - public void testCopyBeanToInheritor() throws Exception { + public void testCopyBeanToInheritor() { InheritedBean to = new InheritedBean(); to.b = true; XmlSerializerUtil.copyBean(new BaseBean("a", 1), to); diff --git a/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ConvertExcludedToIgnoredTest.java b/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ConvertExcludedToIgnoredTest.java index 3957d425553d..f7959dc9f12d 100644 --- a/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ConvertExcludedToIgnoredTest.java +++ b/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ConvertExcludedToIgnoredTest.java @@ -41,7 +41,7 @@ public class ConvertExcludedToIgnoredTest extends PlatformTestCase { PsiTestUtil.addContentRoot(myModule, myContentRoot); } - public void testExcludedFolder() throws IOException { + public void testExcludedFolder() { VirtualFile excluded = createChildDirectory(myContentRoot, "exc"); PsiTestUtil.addExcludedRoot(myModule, excluded); getChangeListManager().convertExcludedToIgnored(); @@ -50,7 +50,7 @@ public class ConvertExcludedToIgnoredTest extends PlatformTestCase { assertIgnored(excluded); } - public void testModuleOutput() throws IOException { + public void testModuleOutput() { VirtualFile output = createChildDirectory(myContentRoot, "out"); PsiTestUtil.setCompilerOutputPath(myModule, output.getUrl(), false); getChangeListManager().convertExcludedToIgnored(); @@ -78,7 +78,7 @@ public class ConvertExcludedToIgnoredTest extends PlatformTestCase { assertIgnored(output); } - public void testModuleOutputUnderExcluded() throws IOException { + public void testModuleOutputUnderExcluded() { VirtualFile excluded = createChildDirectory(myContentRoot, "target"); PsiTestUtil.addExcludedRoot(myModule, excluded); VirtualFile moduleOutput = createChildDirectory(excluded, "classes"); @@ -89,7 +89,7 @@ public class ConvertExcludedToIgnoredTest extends PlatformTestCase { assertIgnored(excluded); } - public void testDoNotIgnoreInnerModuleExplicitlyMarkedAsExcludedFromOuterModule() throws IOException { + public void testDoNotIgnoreInnerModuleExplicitlyMarkedAsExcludedFromOuterModule() { VirtualFile inner = createChildDirectory(myContentRoot, "inner"); PsiTestUtil.addModule(myProject, ModuleType.EMPTY, "inner", inner); PsiTestUtil.addExcludedRoot(myModule, inner); diff --git a/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ui/HierarchicalFilePathComparatorTest.java b/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ui/HierarchicalFilePathComparatorTest.java index f20adac22f07..d6df64073f76 100644 --- a/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ui/HierarchicalFilePathComparatorTest.java +++ b/platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ui/HierarchicalFilePathComparatorTest.java @@ -29,65 +29,65 @@ import java.util.Collection; import java.util.List; public class HierarchicalFilePathComparatorTest extends TestCase { - public void testInOneDirectory() throws Exception { + public void testInOneDirectory() { assertEquals(-1, compare("~/project/A.java", "~/project/B.java")); assertEquals(1, compare("~/project/Z.java", "~/project/B.java")); } - public void testInDifferentDirs() throws Exception { + public void testInDifferentDirs() { assertEquals(-1, compare("~/project/aaa/A.java", "~/project/bbb/B.java")); assertEquals(-1, compare("~/project/aaa/B.java", "~/project/zzz/A.java")); assertEquals(1, compare("~/project/zzz/A.java", "~/project/aaa/B.java")); } - public void testInSubDir() throws Exception { + public void testInSubDir() { // all folders precede plain files assertEquals("Folders should precede plain files", -1, compare("~/project/dir/subdir/A.java", "~/project/dir/B.java")); assertEquals("Folders should precede plain files", -1, compare("~/project/dir/A.java", "~/project/B.java")); assertEquals("Folders should precede plain files", 1, compare("~/project/B.java", "~/project/dir/subdir/A.java")); } - public void testEqualPaths() throws Exception { + public void testEqualPaths() { assertEquals("Equal paths should compare to 0", 0, compare("~/project/A.java", "~/project/A.java")); assertEquals("Equal paths should compare to 0", 0, compare("~/project/aaa/A.java", "~/project/aaa/A.java")); } - public void testEmptyPaths() throws Exception { + public void testEmptyPaths() { assertEquals(0, compare("", "")); } - public void testSamePrefixFolder() throws Exception { + public void testSamePrefixFolder() { assertEquals(-1, compare("~/project/aaa/", "~/project/aaa-qwe/")); assertEquals(-1, compare("~/project/aaa/A.java", "~/project/aaa-qwe/A.java")); assertEquals(1, compare("~/project/zzz-qwe.java", "~/project/zzz/")); } - public void testRootDirectory() throws Exception { + public void testRootDirectory() { assertEquals(0, compare("A.java", "A.java")); assertEquals(0, compare("/aaa/", "/aaa/")); assertEquals(-1, compare("/aaa/", "/aaa-qwe/")); assertEquals(-1, compare("/aaa/", "/ZZ.java")); } - public void testCaseIgnored() throws Exception { + public void testCaseIgnored() { assertEquals(-1, compare("a.java", "B.java")); assertEquals(-1, compare("A.java", "b.java")); } - public void testAssociativeBug() throws Exception { + public void testAssociativeBug() { assertEquals(1, compare("/folder/aaa-qwerty/", "/folder/aaa/")); assertEquals(1, compare("/folder/aaa/.gitignore", "/folder/aaa/")); assertEquals(-1, compare("/folder/aaa/.gitignore", "/folder/aaa-qwerty/")); assertEquals(1, compare("/folder/aaa-qwerty/qwerty", "/folder/aaa/qwerty/")); } - public void testTransitiveBug() throws Exception { + public void testTransitiveBug() { assertEquals(1, compare("/folder/abd", "/folder/abd/")); assertEquals(1, compare("/folder/abx/", "/folder/abd/")); assertEquals(-1, compare("/folder/abx/", "/folder/abd")); } - public void testTransitive() throws Exception { + public void testTransitive() { Collection paths = ContainerUtil.list( "", "/", diff --git a/platform/vcs-impl/testSrc/com/intellij/testFramework/vcs/MockContentRevision.java b/platform/vcs-impl/testSrc/com/intellij/testFramework/vcs/MockContentRevision.java index 7ae5366baaf6..5a9a132f6dc6 100644 --- a/platform/vcs-impl/testSrc/com/intellij/testFramework/vcs/MockContentRevision.java +++ b/platform/vcs-impl/testSrc/com/intellij/testFramework/vcs/MockContentRevision.java @@ -17,7 +17,6 @@ package com.intellij.testFramework.vcs; import com.intellij.openapi.vcs.FilePath; -import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.changes.ContentRevision; import com.intellij.openapi.vcs.history.VcsRevisionNumber; import org.jetbrains.annotations.NotNull; @@ -37,7 +36,7 @@ public class MockContentRevision implements ContentRevision { @Override @Nullable - public String getContent() throws VcsException { + public String getContent() { return null; } diff --git a/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogRefresherTest.java b/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogRefresherTest.java index f13e73ecb1e8..a1c2f9961ecc 100644 --- a/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogRefresherTest.java +++ b/platform/vcs-log/impl/test/com/intellij/vcs/log/data/VcsLogRefresherTest.java @@ -106,14 +106,14 @@ public class VcsLogRefresherTest extends VcsPlatformTest { myDataWaiter.get(); } - public void test_first_refresh_reports_full_history() throws InterruptedException, ExecutionException, TimeoutException { + public void test_first_refresh_reports_full_history() throws InterruptedException { myLoader.readFirstBlock(); DataPack result = myDataWaiter.get(); assertDataPack(log(myCommits), result.getPermanentGraph().getAllCommits()); } - public void test_first_refresh_waits_for_full_log() throws InterruptedException, ExecutionException, TimeoutException { + public void test_first_refresh_waits_for_full_log() throws InterruptedException { myLogProvider.blockFullLog(); myLoader.readFirstBlock(); assertTimeout("Refresh waiter should have failed on the timeout"); @@ -194,7 +194,7 @@ public class VcsLogRefresherTest extends VcsPlatformTest { assertNoMoreResultsArrive(); } - private void assertTimeout(@NotNull String message) throws InterruptedException, ExecutionException { + private void assertTimeout(@NotNull String message) throws InterruptedException { assertNull(message, myDataWaiter.myQueue.poll(500, TimeUnit.MILLISECONDS)); } diff --git a/platform/vcs-log/impl/test/com/intellij/vcs/log/impl/TestVcsLogProvider.java b/platform/vcs-log/impl/test/com/intellij/vcs/log/impl/TestVcsLogProvider.java index 2db06ffb152d..4b45a6cced30 100644 --- a/platform/vcs-log/impl/test/com/intellij/vcs/log/impl/TestVcsLogProvider.java +++ b/platform/vcs-log/impl/test/com/intellij/vcs/log/impl/TestVcsLogProvider.java @@ -17,7 +17,6 @@ package com.intellij.vcs.log.impl; import com.intellij.openapi.Disposable; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.VcsKey; import com.intellij.openapi.vcs.changes.committed.MockAbstractVcs; import com.intellij.openapi.vfs.VirtualFile; @@ -32,7 +31,6 @@ import org.jetbrains.annotations.Nullable; import java.awt.*; import java.io.DataInput; import java.io.DataOutput; -import java.io.IOException; import java.util.*; import java.util.List; import java.util.concurrent.Semaphore; @@ -88,7 +86,7 @@ public class TestVcsLogProvider implements VcsLogProvider { @NotNull @Override - public DetailedLogData readFirstBlock(@NotNull final VirtualFile root, @NotNull Requirements requirements) throws VcsException { + public DetailedLogData readFirstBlock(@NotNull final VirtualFile root, @NotNull Requirements requirements) { LOG.debug("readFirstBlock began"); if (requirements instanceof VcsLogProviderRequirementsEx && ((VcsLogProviderRequirementsEx)requirements).isRefresh()) { try { @@ -108,7 +106,7 @@ public class TestVcsLogProvider implements VcsLogProvider { @NotNull @Override - public LogData readAllHashes(@NotNull VirtualFile root, @NotNull Consumer commitConsumer) throws VcsException { + public LogData readAllHashes(@NotNull VirtualFile root, @NotNull Consumer commitConsumer) { LOG.debug("readAllHashes"); try { myFullLogSemaphore.acquire(); @@ -125,7 +123,7 @@ public class TestVcsLogProvider implements VcsLogProvider { } @Override - public void readAllFullDetails(@NotNull VirtualFile root, @NotNull Consumer commitConsumer) throws VcsException { + public void readAllFullDetails(@NotNull VirtualFile root, @NotNull Consumer commitConsumer) { throw new UnsupportedOperationException(); } @@ -133,7 +131,7 @@ public class TestVcsLogProvider implements VcsLogProvider { public void readFullDetails(@NotNull VirtualFile root, @NotNull List hashes, @NotNull Consumer commitConsumer, - boolean fast) throws VcsException { + boolean fast) { throw new UnsupportedOperationException(); } @@ -143,8 +141,7 @@ public class TestVcsLogProvider implements VcsLogProvider { @NotNull @Override - public List readShortDetails(@NotNull VirtualFile root, @NotNull List hashes) - throws VcsException { + public List readShortDetails(@NotNull VirtualFile root, @NotNull List hashes) { throw new UnsupportedOperationException(); } @@ -174,20 +171,20 @@ public class TestVcsLogProvider implements VcsLogProvider { @Override public List getCommitsMatchingFilter(@NotNull VirtualFile root, @NotNull VcsLogFilterCollection filterCollection, - int maxCount) throws VcsException { + int maxCount) { if (myFilteredCommitsProvider == null) throw new UnsupportedOperationException(); return myFilteredCommitsProvider.fun(filterCollection); } @Nullable @Override - public VcsUser getCurrentUser(@NotNull VirtualFile root) throws VcsException { + public VcsUser getCurrentUser(@NotNull VirtualFile root) { return DEFAULT_USER; } @NotNull @Override - public Collection getContainingBranches(@NotNull VirtualFile root, @NotNull Hash commitHash) throws VcsException { + public Collection getContainingBranches(@NotNull VirtualFile root, @NotNull Hash commitHash) { throw new UnsupportedOperationException(); } @@ -207,7 +204,7 @@ public class TestVcsLogProvider implements VcsLogProvider { myRefreshSemaphore.unblock(); } - public void blockFullLog() throws InterruptedException { + public void blockFullLog() { myFullLogSemaphore.block(); } @@ -264,12 +261,12 @@ public class TestVcsLogProvider implements VcsLogProvider { } @Override - public void serialize(@NotNull DataOutput out, @NotNull VcsRefType type) throws IOException { + public void serialize(@NotNull DataOutput out, @NotNull VcsRefType type) { } @NotNull @Override - public VcsRefType deserialize(@NotNull DataInput in) throws IOException { + public VcsRefType deserialize(@NotNull DataInput in) { throw new UnsupportedOperationException(); } diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/AnnotationShortNameTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/AnnotationShortNameTest.java index eb9dfb6f1173..069261273a23 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/AnnotationShortNameTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/AnnotationShortNameTest.java @@ -26,7 +26,7 @@ import static com.intellij.openapi.vcs.actions.ShortNameType.LASTNAME; * @author Konstantin Bulenkov */ public class AnnotationShortNameTest extends TestCase { - public void testShortNames() throws Exception { + public void testShortNames() { doTest(FIRSTNAME, "Vasya Pavlovich Pupkin ", "Vasya"); doTest(LASTNAME, "Vasya Pavlovich Pupkin ", "Pupkin"); doTest(FIRSTNAME, "Vasya Pavlovich Pupkin", "Vasya"); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/BaseLineStatusTrackerTestCase.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/BaseLineStatusTrackerTestCase.java index b3f06d89eac6..4bf70b4f6a0f 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/BaseLineStatusTrackerTestCase.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/BaseLineStatusTrackerTestCase.java @@ -116,7 +116,7 @@ public abstract class BaseLineStatusTrackerTestCase extends LightPlatformTestCas } } - protected void checkCantTrim() throws Throwable { + protected void checkCantTrim() { List ranges = myTracker.getRanges(); for (Range range : ranges) { if (range.getType() != Range.MODIFIED) continue; @@ -135,14 +135,14 @@ public abstract class BaseLineStatusTrackerTestCase extends LightPlatformTestCas } } - protected void checkCantMerge() throws Throwable { + protected void checkCantMerge() { List ranges = myTracker.getRanges(); for (int i = 0; i < ranges.size() - 1; i++) { assertFalse(ranges.get(i).getLine2() == ranges.get(i + 1).getLine1()); } } - protected void checkInnerRanges() throws Throwable { + protected void checkInnerRanges() { List ranges = myTracker.getRangesInner(); for (Range range : ranges) { diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.java index aa0c04eb51d8..e83e335995cf 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/DirectoryMappingListTest.java @@ -35,7 +35,6 @@ import junit.framework.Assert; import org.jetbrains.annotations.NonNls; import java.io.File; -import java.io.IOException; import java.util.Arrays; /** @@ -80,7 +79,7 @@ public class DirectoryMappingListTest extends PlatformTestCase { super.tearDown(); } - public void testMappingsFilter() throws Exception { + public void testMappingsFilter() { final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject); ((MockAbstractVcs) vcsManager.findVcsByName("mock")).setAllowNestedRoots(true); @@ -113,7 +112,7 @@ public class DirectoryMappingListTest extends PlatformTestCase { assertEquals(5, filePaths.length); } - public void testSamePrefix() throws Exception { + public void testSamePrefix() { myMappings.setMapping(myRootPath + "/a", "CVS"); myMappings.setMapping(myRootPath + "/a-b", "mock2"); assertEquals(3, myMappings.getDirectoryMappings().size()); @@ -123,12 +122,12 @@ public class DirectoryMappingListTest extends PlatformTestCase { assertEquals("CVS", myMappings.getVcsFor(myProjectRoot.findChild("a"))); } - public void testSamePrefixEmpty() throws Exception { + public void testSamePrefixEmpty() { myMappings.setMapping(myRootPath + "/a", "CVS"); assertEquals("", myMappings.getVcsFor(myProjectRoot.findChild("a-b"))); } - public void testSame() throws Exception { + public void testSame() { myMappings.removeDirectoryMapping(new VcsDirectoryMapping("", "")); myMappings.setMapping(myRootPath + "/parent/path", "CVS"); @@ -149,7 +148,7 @@ public class DirectoryMappingListTest extends PlatformTestCase { } } - public void testHierarchy() throws Exception { + public void testHierarchy() { myMappings.removeDirectoryMapping(new VcsDirectoryMapping("", "")); myMappings.setMapping(myRootPath + "/parent", "CVS"); @@ -165,7 +164,7 @@ public class DirectoryMappingListTest extends PlatformTestCase { } } - public void testNestedInnerCopy() throws Exception { + public void testNestedInnerCopy() { myMappings.removeDirectoryMapping(new VcsDirectoryMapping("", "")); myMappings.setMapping(myRootPath + "/parent", "CVS"); myMappings.setMapping(myRootPath + "/parent/child", "mock"); @@ -188,7 +187,7 @@ public class DirectoryMappingListTest extends PlatformTestCase { } } - private static void createFiles(final String[] paths) throws IOException { + private static void createFiles(final String[] paths) { for (String path : paths) { final File file = new File(FileUtil.toSystemDependentName(path)); assert file.mkdirs() || file.isDirectory() : file; diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/ErrorMessageTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/ErrorMessageTest.java index e7d41027e196..de1b45231ad9 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/ErrorMessageTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/ErrorMessageTest.java @@ -19,7 +19,7 @@ import junit.framework.TestCase; import org.jetbrains.annotations.NonNls; @NonNls public class ErrorMessageTest extends TestCase { - public void test() throws Exception{ + public void test() { doTest(1, 1, "One error and one warning found."); doTest(0, 1, "No errors and one warning found."); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/HackSearchTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/HackSearchTest.java index 2e9e56d37967..a0d7286dc9bc 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/HackSearchTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/HackSearchTest.java @@ -36,25 +36,25 @@ public class HackSearchTest extends TestCase { mySearch = new HackSearch<>(o -> new Z(o.getInt()), o -> new Z(o.getInt()), new ZComparator()); } - public void testSimple() throws Exception { + public void testSimple() { final int idx = mySearch.search(Arrays.asList(new S[]{s(1), s(2), s(4), s(10)}), new T(5)); Assert.assertEquals(3, idx); } - public void testSame() throws Exception { + public void testSame() { final int idx = mySearch.search(Arrays.asList(new S[]{s(1), s(2), s(4), s(5), s(10)}), new T(5)); Assert.assertEquals(3, idx); } - public void testBefore() throws Exception { + public void testBefore() { final int idx = mySearch.search(Arrays.asList(new S[]{s(10), s(20), s(40), s(50), s(60)}), new T(5)); Assert.assertEquals(0, idx); } - public void testFirst() throws Exception { + public void testFirst() { final int idx = mySearch.search(Arrays.asList(new S[]{s(1), s(2), s(4), s(5), s(10)}), new T(1)); Assert.assertEquals(0, idx); } - public void testLast() throws Exception { + public void testLast() { final int idx = mySearch.search(Arrays.asList(new S[]{s(1), s(2), s(4), s(5), s(10)}), new T(15)); Assert.assertEquals(5, idx); } diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/IgnoreIdeaLevelTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/IgnoreIdeaLevelTest.java index d44fa8ad39a8..ddccccdac3f2 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/IgnoreIdeaLevelTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/IgnoreIdeaLevelTest.java @@ -72,7 +72,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { Disposer.register(getTestRootDisposable(), dialog.getDisposable()); } - private void createOutsideModule() throws IOException { + private void createOutsideModule() { final VirtualFile baseDir = myProject.getBaseDir(); assertNotNull(baseDir); final VirtualFile baseParent = baseDir.getParent(); @@ -129,10 +129,10 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { private VirtualFile myF3Outside; private VirtualFile myF4Outside; - private FileStructure(final VirtualFile baseDir, final VirtualFile outsideDir) throws Throwable { + private FileStructure(final VirtualFile baseDir, final VirtualFile outsideDir) { new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { try { myABase = baseDir.createChildDirectory(this, "a"); myBBase = myABase.createChildDirectory(this, "b"); @@ -158,7 +158,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } } - public void testRoots() throws Exception { + public void testRoots() { assertEquals(2, myVcsManager.getAllVcsRoots().length); } @@ -204,7 +204,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testSimple() throws Throwable { + public void testSimple() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); final IgnoredFileBean bean1 = IgnoredBeanFactory.ignoreFile(fs.myF1Base.getPath(), myProject); @@ -223,7 +223,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testSimpleStrasse() throws Throwable { + public void testSimpleStrasse() { final VirtualFile file = createFileInCommand(myProject.getBaseDir(), "Straße", "123"); final VirtualFile file2 = createFileInCommand(myProject.getBaseDir(), "Strasse", "123"); @@ -239,7 +239,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testPatterns() throws Throwable { + public void testPatterns() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); final IgnoredFileBean bean1 = IgnoredBeanFactory.withMask("*1.txt"); @@ -254,7 +254,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testDirs() throws Throwable { + public void testDirs() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); final IgnoredFileBean bean1 = IgnoredBeanFactory.ignoreUnderDirectory(fs.myBBase.getPath(), myProject); @@ -279,7 +279,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testTypedAbsolute() throws Throwable { + public void testTypedAbsolute() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); String baseUnder = myProject.getBaseDir().getPath(); @@ -302,7 +302,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testTypedAbsoluteSeparator() throws Throwable { + public void testTypedAbsoluteSeparator() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); String baseUnder = myProject.getBaseDir().getPath(); @@ -326,7 +326,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testTypedRelativeInsideSeparator() throws Throwable { + public void testTypedRelativeInsideSeparator() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); final IgnoredFileBean bean1 = IgnoredBeanFactory.ignoreUnderDirectory("a" + File.separator + "b", myProject); @@ -344,7 +344,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testTypedRelativeInside() throws Throwable { + public void testTypedRelativeInside() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); final IgnoredFileBean bean1 = IgnoredBeanFactory.ignoreUnderDirectory("a/b", myProject); @@ -362,7 +362,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testTypedRelativeOutsideSeparator() throws Throwable { + public void testTypedRelativeOutsideSeparator() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); String baseUnder = myModuleRoot.getPath(); @@ -386,7 +386,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testTypedRelativeOutside() throws Throwable { + public void testTypedRelativeOutside() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); String baseUnder = myModuleRoot.getPath(); @@ -409,7 +409,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testDoNotAddAlreadyIgnoredDirectory() throws Throwable { + public void testDoNotAddAlreadyIgnoredDirectory() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); myClManager.addDirectoryToIgnoreImplicitly(fs.myABase.getPath()); myClManager.addDirectoryToIgnoreImplicitly(fs.myBBase.getPath()); @@ -418,7 +418,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testRemoveChildIgnoredDirectoryWhenParentIsAdded() throws Throwable { + public void testRemoveChildIgnoredDirectoryWhenParentIsAdded() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); myClManager.addDirectoryToIgnoreImplicitly(fs.myBBase.getPath()); myClManager.addDirectoryToIgnoreImplicitly(fs.myCBase.getPath()); @@ -427,7 +427,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testManuallyRemovedFromIgnored() throws Throwable { + public void testManuallyRemovedFromIgnored() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); myClManager.getIgnoredFilesComponent().setDirectoriesManuallyRemovedFromIgnored(Collections.singleton(fs.myBBase.getPath())); myClManager.addDirectoryToIgnoreImplicitly(fs.myBBase.getPath()); @@ -436,7 +436,7 @@ public class IgnoreIdeaLevelTest extends PlatformTestCase { } @Test - public void testRemovingFromImplicitlyIgnored() throws Throwable { + public void testRemovingFromImplicitlyIgnored() { final FileStructure fs = new FileStructure(myProject.getBaseDir(), myModuleRoot); myClManager.addDirectoryToIgnoreImplicitly(fs.myBBase.getPath()); myClManager.addDirectoryToIgnoreImplicitly(fs.myCBase.getPath()); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerRevertAutoTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerRevertAutoTest.java index ed269c89b94f..de60c38e6c26 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerRevertAutoTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/LineStatusTrackerRevertAutoTest.java @@ -152,7 +152,7 @@ public class LineStatusTrackerRevertAutoTest extends BaseLineStatusTrackerTestCa assertEquals(myDocument.getText(), myUpToDateDocument.getText()); } - private void checkRevertComplex(int iterations) throws Exception { + private void checkRevertComplex(int iterations) { BitSet lines = new BitSet(); for (int i = 0; i < iterations; i++) { diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/PatchAutoInitTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/PatchAutoInitTest.java index c4d2489062b6..78f77bfb2c1d 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/PatchAutoInitTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/PatchAutoInitTest.java @@ -39,7 +39,7 @@ import java.util.List; public class PatchAutoInitTest extends PlatformTestCase { private static final String BINARY_FILENAME = "binary.png"; - public void testSimple() throws Exception { + public void testSimple() { final VirtualFile root = myProject.getBaseDir(); final VirtualFile dir = createChildDirectory(root, "dir"); createChildData(dir, "somefile.txt"); @@ -77,7 +77,7 @@ public class PatchAutoInitTest extends PlatformTestCase { } // 1. several files with different bases; one can be matched to 2 bases - public void testDiffBases() throws Exception { + public void testDiffBases() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); @@ -115,7 +115,7 @@ public class PatchAutoInitTest extends PlatformTestCase { checkPath(result, "c/" + BINARY_FILENAME, Arrays.asList(b, f), 0); } - public void testBestBinaryVariant() throws Exception { + public void testBestBinaryVariant() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); @@ -145,19 +145,19 @@ public class PatchAutoInitTest extends PlatformTestCase { } // inspired by IDEA-109608 - public void testFileAdditionGoesIntoCorrectFolder() throws Exception { + public void testFileAdditionGoesIntoCorrectFolder() { String path = "platform/util/src/com/intellij/util/io/SomeNewFile.java"; TextFilePatch patch = createFileAddition(path); checkSingleFileOperationAmongSimilarFolders(path, patch); } - public void testFileDeletionFromCorrectFolder() throws Exception { + public void testFileDeletionFromCorrectFolder() { String path = "platform/util/src/com/intellij/util/io/G.java"; TextFilePatch patch = createFileDeletion(path); checkSingleFileOperationAmongSimilarFolders(path, patch); } - public void testFileModificationFromCorrectFolder() throws Exception { + public void testFileModificationFromCorrectFolder() { String path = "platform/platform-impl/src/io/B.java"; TextFilePatch patch = create(path); checkSingleFileOperationAmongSimilarFolders(path, patch); @@ -183,7 +183,7 @@ public class PatchAutoInitTest extends PlatformTestCase { } // inspired by IDEA-118644 - public void testFileAdditionToNonexistentSubfolder() throws Exception { + public void testFileAdditionToNonexistentSubfolder() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); VfsTestUtil.createDir(root, "platform/editor-ui-ex/src/com/intellij/openapi/editor/colors"); @@ -200,7 +200,7 @@ public class PatchAutoInitTest extends PlatformTestCase { checkPath(result, path, Collections.singletonList(root), 0); } - public void testFileAdditionGeneratedFromSuperRoot() throws Exception { + public void testFileAdditionGeneratedFromSuperRoot() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); VfsTestUtil.createDir(root, "editor-ui-ex/src/com/intellij/openapi/editor/colors"); @@ -236,7 +236,7 @@ public class PatchAutoInitTest extends PlatformTestCase { } // 2. files can be for 1 dir and 1 strip distance - public void testOneBaseAndStrip() throws Exception { + public void testOneBaseAndStrip() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); @@ -267,7 +267,7 @@ public class PatchAutoInitTest extends PlatformTestCase { } // 3. files can be with 2 base dirs and 1-one distance, 2-different distances - public void testOneBaseAndDifferentStrips() throws Exception { + public void testOneBaseAndDifferentStrips() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); @@ -303,7 +303,7 @@ public class PatchAutoInitTest extends PlatformTestCase { checkPath(result, "h1/c/f2.txt", Collections.singletonList(e), 0); } - public void testPreviousFirstVariantAlsoMatches() throws Exception { + public void testPreviousFirstVariantAlsoMatches() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); @@ -328,7 +328,7 @@ public class PatchAutoInitTest extends PlatformTestCase { checkPath(result, "c/" + BINARY_FILENAME, Collections.singletonList(b), 2); } - public void testDefaultStrategyWorks() throws Exception { + public void testDefaultStrategyWorks() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); @@ -356,7 +356,7 @@ public class PatchAutoInitTest extends PlatformTestCase { checkPath(result, "h1/c/f10.txt", Collections.singletonList(root), 0); } - public void testExactWins() throws Exception { + public void testExactWins() { final VirtualFile root = myProject.getBaseDir(); PsiTestUtil.addContentRoot(myModule, root); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/RollbackTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/RollbackTest.java index 8bdb255d52cd..763277344cfd 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/RollbackTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/RollbackTest.java @@ -103,7 +103,7 @@ public class RollbackTest extends BaseLineStatusTrackerTestCase{ doTestRollback("\n1\n2\n3\n4\n5\n6\n7", () -> deleteString(5, 13), Range.DELETED); } - public void testRollbackEmptyLastLineDeletion() throws FilesTooBigForDiffException { + public void testRollbackEmptyLastLineDeletion() { String text1 = "1\n2\n3\n\n"; String text2 = "1\n2\n3\n"; createDocument(text2, text1); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/BufferedListConsumerTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/BufferedListConsumerTest.java index cab971bfebad..f3ed797d1d63 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/BufferedListConsumerTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/BufferedListConsumerTest.java @@ -29,7 +29,7 @@ import java.util.*; public class BufferedListConsumerTest extends FileBasedTest { @Test - public void testHugeWriteRead() throws Exception { + public void testHugeWriteRead() { List threads = new ArrayList<>(); final Random random = new Random(17); final Set src = new HashSet<>(200); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/CommittedChangesCacheTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/CommittedChangesCacheTest.java index 91300298b9b5..8612206fa319 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/CommittedChangesCacheTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/CommittedChangesCacheTest.java @@ -84,7 +84,7 @@ public class CommittedChangesCacheTest extends PlatformTestCase { } @Override - protected void tearDown() throws Exception { + protected void tearDown() { new RunAll( () -> { if (myConnection != null) myConnection.disconnect(); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/CommittedListsSequencesZipperTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/CommittedListsSequencesZipperTest.java index 24c406fc92da..4181bed52cbb 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/CommittedListsSequencesZipperTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/CommittedListsSequencesZipperTest.java @@ -31,42 +31,42 @@ import static org.junit.Assert.assertTrue; public class CommittedListsSequencesZipperTest { @Test - public void testSimple() throws Exception { + public void testSimple() { long[][] valuesWithCount = {{1, 3}, {2, 2}, {3, 1}, {5, 1}, {7, 2}, {8, 1}, {17, 1}, {18, 1}, {21, 2}}; check(valuesWithCount, list(1, 2, 7, 8, 18, 21), list(1, 2, 5, 7, 21), list(1, 3, 17)); } @Test - public void testVar1() throws Exception { + public void testVar1() { long[][] valuesWithCount = {{1, 1}, {2, 1}, {3, 1}, {5, 1}, {6, 1}, {7, 1}, {11, 1}, {17, 1}, {18, 1}, {22, 1}, {111, 1}}; check(valuesWithCount, list(1, 7, 11, 111), list(2, 6, 18, 22), list(3, 5, 17)); } @Test - public void testVar2() throws Exception { + public void testVar2() { long[][] valuesWithCount = {{1, 1}, {2, 1}, {3, 1}, {5, 1}, {6, 1}, {7, 2}, {11, 1}, {17, 1}, {18, 1}, {22, 1}, {111, 1}}; check(valuesWithCount, list(1, 7, 11, 111), list(2, 6, 7, 18, 22), list(3, 5, 17)); } @Test - public void testVar3() throws Exception { + public void testVar3() { long[][] valuesWithCount = {{1, 2}, {2, 1}, {3, 1}, {5, 1}, {6, 1}, {7, 1}, {11, 1}, {17, 1}, {18, 1}, {22, 1}, {111, 1}}; check(valuesWithCount, list(1, 7, 11, 111), list(1, 2, 6, 18, 22), list(3, 5, 17)); } @Test - public void testVar4() throws Exception { + public void testVar4() { long[][] valuesWithCount = {{1, 1}, {2, 1}, {3, 1}, {5, 1}, {6, 1}, {7, 1}, {11, 1}, {17, 1}, {18, 1}, {22, 1}, {111, 3}}; check(valuesWithCount, list(1, 7, 11, 111), list(2, 6, 18, 22, 111), list(3, 5, 17, 111)); } @Test - public void testSame() throws Exception { + public void testSame() { long[][] valuesWithCount = {{1, 3}, {7, 3}, {11, 3}, {111, 3}}; check(valuesWithCount, list(1, 7, 11, 111), list(1, 7, 11, 111), list(1, 7, 11, 111)); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/ExternalChangesDetectionVcsTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/ExternalChangesDetectionVcsTest.java index 2490c396d6dc..f37c56ccd37c 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/ExternalChangesDetectionVcsTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/ExternalChangesDetectionVcsTest.java @@ -19,7 +19,6 @@ import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.ProjectLevelVcsManager; -import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.changes.*; import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; import com.intellij.openapi.vfs.LocalFileSystem; @@ -53,7 +52,7 @@ public class ExternalChangesDetectionVcsTest extends AbstractJunitVcsTestCase { private File myClientRoot; @Before - public void setUp() throws Exception { + public void setUp() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { try { final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory(); @@ -82,7 +81,7 @@ public class ExternalChangesDetectionVcsTest extends AbstractJunitVcsTestCase { } @After - public void tearDown() throws Exception { + public void tearDown() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { try { myVcsManager.unregisterVcs(myVcs); @@ -189,7 +188,7 @@ public class ExternalChangesDetectionVcsTest extends AbstractJunitVcsTestCase { public void getChanges(@NotNull VcsDirtyScope dirtyScope, @NotNull final ChangelistBuilder builder, @NotNull ProgressIndicator progress, - @NotNull ChangeListManagerGate addGate) throws VcsException { + @NotNull ChangeListManagerGate addGate) { for (FilePath path : dirtyScope.getDirtyFiles()) { builder.processUnversionedFile(path.getVirtualFile()); } diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/FilterDescendantFilesTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/FilterDescendantFilesTest.java index 45f8d0bfd23a..590672cbf3fc 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/FilterDescendantFilesTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/FilterDescendantFilesTest.java @@ -26,13 +26,12 @@ import junit.framework.Assert; import org.junit.Test; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.List; public class FilterDescendantFilesTest extends PlatformTestCase { @Test - public void testSecondModuleSameLevelAsProject() throws Throwable { + public void testSecondModuleSameLevelAsProject() { final File tmpDir = createDir(new File(FileUtil.getTempDirectory()), "tmpDir"); final File child1 = createDir(tmpDir, "child1"); final File child2 = createDir(tmpDir, "child2"); @@ -44,7 +43,7 @@ public class FilterDescendantFilesTest extends PlatformTestCase { } @Test - public void testUsual() throws Throwable { + public void testUsual() { File tmp = new File(FileUtil.getTempDirectory()); final File tmpDir = createDir(tmp, "tmpDir"); final File child1 = createDir(tmpDir, "child1"); @@ -71,7 +70,7 @@ public class FilterDescendantFilesTest extends PlatformTestCase { return result; } - private File createDir(final File parent, final String name) throws IOException { + private File createDir(final File parent, final String name) { final File result = new File(parent, name); for (int i = 0; i < 100; i++) { if (result.mkdirs()) break; diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java index 1eef1f5cfc6e..d63091340c4b 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/MockCommittedChangesProvider.java @@ -71,7 +71,7 @@ public class MockCommittedChangesProvider implements CachingCommittedChangesProv } @Override - public List getCommittedChanges(ChangeBrowserSettings settings, RepositoryLocation location, final int maxCount) throws VcsException { + public List getCommittedChanges(ChangeBrowserSettings settings, RepositoryLocation location, final int maxCount) { myRefreshCount++; return myChangeLists; } @@ -80,8 +80,7 @@ public class MockCommittedChangesProvider implements CachingCommittedChangesProv public void loadCommittedChanges(ChangeBrowserSettings settings, RepositoryLocation location, int maxCount, - AsynchConsumer consumer) - throws VcsException { + AsynchConsumer consumer) { ++ myRefreshCount; for (CommittedChangeListImpl changeList : myChangeLists) { consumer.consume(changeList); @@ -90,7 +89,7 @@ public class MockCommittedChangesProvider implements CachingCommittedChangesProv } @Override - public Pair getOneList(VirtualFile file, VcsRevisionNumber number) throws VcsException { + public Pair getOneList(VirtualFile file, VcsRevisionNumber number) { ++ myRefreshCount; return new Pair<>(myChangeLists.get(0), VcsUtil.getFilePath(file)); } diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/RequestsMergerTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/RequestsMergerTest.java index 18ddf015de5a..7d89b6acd32c 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/RequestsMergerTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/RequestsMergerTest.java @@ -27,7 +27,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; public class RequestsMergerTest extends TestCase { - public void testManyIntoOne() throws Exception { + public void testManyIntoOne() { final MyTestVictim victim = new MyTestVictim(); final RequestsMerger merger = new RequestsMerger(victim, victim); diff --git a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/SelectionManagerTest.java b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/SelectionManagerTest.java index 46d483b34927..d2451102fe6d 100644 --- a/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/SelectionManagerTest.java +++ b/platform/vcs-tests/testSrc/com/intellij/openapi/vcs/changes/committed/SelectionManagerTest.java @@ -55,7 +55,7 @@ public class SelectionManagerTest extends PlatformTestCase { myCm = new SelectionManager(2, 10, MyConvertor.getInstance()); } - public void testSimple() throws Exception { + public void testSimple() { assertClear(); myCm.toggleSelection(myFs.getNode(myFs.myMiddle1)); afterMiddle1(); @@ -63,7 +63,7 @@ public class SelectionManagerTest extends PlatformTestCase { assertClear(); } - public void testSimpleRemove() throws Exception { + public void testSimpleRemove() { assertClear(); myCm.toggleSelection(myFs.getNode(myFs.myMiddle1)); afterMiddle1(); @@ -71,7 +71,7 @@ public class SelectionManagerTest extends PlatformTestCase { assertClear(); } - public void testCannotChangeChild() throws Exception { + public void testCannotChangeChild() { assertClear(); myCm.toggleSelection(myFs.getNode(myFs.myMiddle1)); afterMiddle1(); @@ -111,7 +111,7 @@ public class SelectionManagerTest extends PlatformTestCase { assertNodeState(myFs.myLeaf2, TreeNodeState.HAVE_SELECTED_ABOVE, false); } - public void testLimit() throws Exception { + public void testLimit() { assertClear(); myCm.toggleSelection(myFs.getNode(myFs.myInner11)); @@ -143,7 +143,7 @@ public class SelectionManagerTest extends PlatformTestCase { assertClear(); } - public void testCanExpand() throws Exception { + public void testCanExpand() { assertClear(); myCm.toggleSelection(myFs.getNode(myFs.myInner11)); afterInner11(); @@ -153,7 +153,7 @@ public class SelectionManagerTest extends PlatformTestCase { assertClear(); } - public void testTwoTrees() throws Exception { + public void testTwoTrees() { final Map middle1map = myFs.createNodeMap(myFs.myMiddle1); assertClear(); myCm.toggleSelection(middle1map.get(myFs.myInner11)); diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/UpdateBreakpointsAfterRenameTest.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/UpdateBreakpointsAfterRenameTest.java index 30e0a1e2b09d..a77137b1340a 100644 --- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/UpdateBreakpointsAfterRenameTest.java +++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/UpdateBreakpointsAfterRenameTest.java @@ -28,7 +28,7 @@ import java.io.File; * @author nik */ public class UpdateBreakpointsAfterRenameTest extends XBreakpointsTestCase { - public void testRenameFile() throws Exception { + public void testRenameFile() { final VirtualFile file = createFile("file.txt"); XLineBreakpoint b = putBreakpoint(file); rename(file, "file2.txt"); @@ -36,7 +36,7 @@ public class UpdateBreakpointsAfterRenameTest extends XBreakpointsTestCase { assertSame(b, getBreakpointManager().findBreakpointAtLine(XDebuggerTestCase.MY_LINE_BREAKPOINT_TYPE, file, 0)); } - public void testMoveFile() throws Exception { + public void testMoveFile() { final VirtualFile file = createFile("dir/a.txt"); final VirtualFile targetDir = createFile("dir2/b.txt").getParent(); final XLineBreakpoint b = putBreakpoint(file); @@ -44,7 +44,7 @@ public class UpdateBreakpointsAfterRenameTest extends XBreakpointsTestCase { assertTrue(b.getFileUrl().endsWith("dir2/a.txt")); } - public void testRenameParentDir() throws Exception { + public void testRenameParentDir() { final VirtualFile file = createFile("dir/x.txt"); final XLineBreakpoint b = putBreakpoint(file); rename(file.getParent(), "dir2"); diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerSettingsTest.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerSettingsTest.java index 5d0bc95106dc..4d2a42c91712 100644 --- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerSettingsTest.java +++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerSettingsTest.java @@ -38,7 +38,7 @@ public class XDebuggerSettingsTest extends PlatformLiteFixture { getApplication().registerService(XDebuggerSettingsManager.class, XDebuggerSettingManagerImpl.class); } - public void testSerialize() throws Exception { + public void testSerialize() { XDebuggerSettingManagerImpl settingsManager = XDebuggerSettingManagerImpl.getInstanceImpl(); MyDebuggerSettings settings = MyDebuggerSettings.getInstance(); diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java index bbac804a3065..f340fbfa5cc7 100644 --- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java +++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java @@ -48,7 +48,6 @@ import org.jetbrains.concurrency.Promise; import java.awt.*; import java.io.File; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.util.*; import java.util.List; import java.util.concurrent.Semaphore; @@ -80,7 +79,7 @@ public class XDebuggerTestUtil { public static XLineBreakpoint toggleBreakpoint(Project project, VirtualFile file, int line) { return new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { Promise promise = ((XDebuggerUtilImpl)XDebuggerUtil.getInstance()).toggleAndReturnLineBreakpoint(project, file, line, false); @@ -122,11 +121,11 @@ public class XDebuggerTestUtil { return session.getSuspendContext().getActiveExecutionStack(); } - public static List collectThreads(@NotNull XDebugSession session) throws InterruptedException { + public static List collectThreads(@NotNull XDebugSession session) { return collectThreadsWithErrors(session).first; } - public static Pair, String> collectThreadsWithErrors(@NotNull XDebugSession session) throws InterruptedException { + public static Pair, String> collectThreadsWithErrors(@NotNull XDebugSession session) { XTestExecutionStackContainer container = new XTestExecutionStackContainer(); session.getSuspendContext().computeExecutionStacks(container); return container.waitFor(TIMEOUT_MS); @@ -147,25 +146,25 @@ public class XDebuggerTestUtil { return builder.getBuilder().toString(); } - public static List collectFrames(@NotNull XExecutionStack thread) throws InterruptedException { + public static List collectFrames(@NotNull XExecutionStack thread) { return collectFrames(thread, TIMEOUT_MS * 2); } - public static List collectFrames(XExecutionStack thread, long timeout) throws InterruptedException { + public static List collectFrames(XExecutionStack thread, long timeout) { return collectFramesWithError(thread, timeout).first; } - public static Pair, String> collectFramesWithError(XExecutionStack thread, long timeout) throws InterruptedException { + public static Pair, String> collectFramesWithError(XExecutionStack thread, long timeout) { XTestStackFrameContainer container = new XTestStackFrameContainer(); thread.computeStackFrames(0, container); return container.waitFor(timeout); } - public static Pair, XStackFrame> collectFramesWithSelected(@NotNull XDebugSession session, long timeout) throws InterruptedException { + public static Pair, XStackFrame> collectFramesWithSelected(@NotNull XDebugSession session, long timeout) { return collectFramesWithSelected(getActiveThread(session), timeout); } - public static Pair, XStackFrame> collectFramesWithSelected(XExecutionStack thread, long timeout) throws InterruptedException { + public static Pair, XStackFrame> collectFramesWithSelected(XExecutionStack thread, long timeout) { XTestStackFrameContainer container = new XTestStackFrameContainer(); thread.computeStackFrames(0, container); List all = container.waitFor(timeout).first; @@ -176,11 +175,11 @@ public class XDebuggerTestUtil { * @deprecated use {@link XDebuggerTestUtil#collectChildren(XValueContainer)} */ @Deprecated - public static List collectVariables(XStackFrame frame) throws InterruptedException { + public static List collectVariables(XStackFrame frame) { return collectChildren(frame); } - public static List collectChildren(XValueContainer value) throws InterruptedException { + public static List collectChildren(XValueContainer value) { XTestCompositeNode container = new XTestCompositeNode(); value.computeChildren(container); return container.waitFor(TIMEOUT_MS).first; @@ -208,7 +207,7 @@ public class XDebuggerTestUtil { return callback.waitFor(timeout); } - public static void waitForSwing() throws InterruptedException, InvocationTargetException { + public static void waitForSwing() throws InterruptedException { final com.intellij.util.concurrency.Semaphore s = new com.intellij.util.concurrency.Semaphore(); s.down(); ApplicationManager.getApplication().invokeLater(() -> s.up()); @@ -231,11 +230,11 @@ public class XDebuggerTestUtil { throw new AssertionError("var '" + name + "' not found among " + names); } - public static XTestValueNode computePresentation(@NotNull XValue value) throws InterruptedException { + public static XTestValueNode computePresentation(@NotNull XValue value) { return computePresentation(value, TIMEOUT_MS); } - public static XTestValueNode computePresentation(XValue value, long timeout) throws InterruptedException { + public static XTestValueNode computePresentation(XValue value, long timeout) { XTestValueNode node = new XTestValueNode(); if (value instanceof XNamedValue) { node.myName = ((XNamedValue)value).getName(); @@ -249,7 +248,7 @@ public class XDebuggerTestUtil { @Nullable String name, @Nullable String type, @Nullable String value, - @Nullable Boolean hasChildren) throws InterruptedException { + @Nullable Boolean hasChildren) { XTestValueNode node = computePresentation(var); if (name != null) assertEquals(name, node.myName); @@ -305,7 +304,7 @@ public class XDebuggerTestUtil { @Nullable String name, @Nullable String type, @Nullable @Language("RegExp") String valuePattern, - @Nullable Boolean hasChildren) throws InterruptedException { + @Nullable Boolean hasChildren) { XTestValueNode node = computePresentation(var); if (name != null) assertEquals(name, node.myName); if (type != null) assertEquals(type, node.myType); @@ -323,7 +322,7 @@ public class XDebuggerTestUtil { public static void assertVariableTypeMatches(@NotNull XValue var, @Nullable String name, - @Nullable @Language("RegExp") String typePattern) throws InterruptedException { + @Nullable @Language("RegExp") String typePattern) { XTestValueNode node = computePresentation(var); if (name != null) { assertEquals(name, node.myName); @@ -373,7 +372,7 @@ public class XDebuggerTestUtil { assertVariableFullValue(findVar(vars, name), value); } - public static void assertVariables(List vars, String... names) throws InterruptedException { + public static void assertVariables(List vars, String... names) { List expectedNames = new ArrayList<>(Arrays.asList(names)); List actualNames = new ArrayList<>(); @@ -386,7 +385,7 @@ public class XDebuggerTestUtil { UsefulTestCase.assertOrderedEquals(actualNames, expectedNames); } - public static void assertVariablesContain(List vars, String... names) throws InterruptedException { + public static void assertVariablesContain(List vars, String... names) { List expectedNames = new ArrayList<>(Arrays.asList(names)); List actualNames = new ArrayList<>(); @@ -441,7 +440,7 @@ public class XDebuggerTestUtil { @NotNull public static String getConsoleText(final @NotNull ConsoleViewImpl consoleView) { new WriteAction() { - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { consoleView.flushDeferredText(); } }.execute(); @@ -457,7 +456,7 @@ public class XDebuggerTestUtil { XBreakpointUtil.breakpointTypes().select(exceptionType).findFirst().ifPresent(type -> new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { breakpoint.set(breakpointManager.addBreakpoint(type, properties)); } }.execute() @@ -471,7 +470,7 @@ public class XDebuggerTestUtil { for (final XBreakpoint b : breakpoints) { new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { breakpointManager.removeBreakpoint(b); } }.execute(); @@ -501,7 +500,7 @@ public class XDebuggerTestUtil { if (lineBreakpoint.getLine() == line) { new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { lineBreakpoint.setCondition(condition); } }.execute(); @@ -519,7 +518,7 @@ public class XDebuggerTestUtil { if (lineBreakpoint.getLine() == line) { new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { lineBreakpoint.setLogExpression(logExpression); lineBreakpoint.setLogMessage(true); } @@ -531,7 +530,7 @@ public class XDebuggerTestUtil { public static void disposeDebugSession(final XDebugSession debugSession) { new WriteAction() { - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { XDebugSessionImpl session = (XDebugSessionImpl)debugSession; Disposer.dispose(session.getSessionTab()); Disposer.dispose(session.getConsoleView()); diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDependentBreakpointsTest.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDependentBreakpointsTest.java index 7047a2f06114..f0342d9a1f2f 100644 --- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDependentBreakpointsTest.java +++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDependentBreakpointsTest.java @@ -41,7 +41,7 @@ public class XDependentBreakpointsTest extends XBreakpointsTestCase { super.tearDown(); } - public void testDelete() throws Exception { + public void testDelete() { XLineBreakpoint master = createMaster(); XLineBreakpoint slave = createSlave(); myDependentBreakpointManager.setMasterBreakpoint(slave, master, true); @@ -55,7 +55,7 @@ public class XDependentBreakpointsTest extends XBreakpointsTestCase { assertEmpty(myDependentBreakpointManager.getAllSlaveBreakpoints()); } - public void testSerialize() throws Exception { + public void testSerialize() { XLineBreakpoint master = createMaster(); XLineBreakpoint slave = createSlave(); myDependentBreakpointManager.setMasterBreakpoint(slave, master, true); diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/impl/actions/AttachToLocalProcessActionTest.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/impl/actions/AttachToLocalProcessActionTest.java index ab62cf3588f4..195702baf697 100644 --- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/impl/actions/AttachToLocalProcessActionTest.java +++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/impl/actions/AttachToLocalProcessActionTest.java @@ -15,7 +15,6 @@ */ package com.intellij.xdebugger.impl.actions; -import com.intellij.execution.ExecutionException; import com.intellij.execution.process.ProcessInfo; import com.intellij.openapi.progress.DumbProgressIndicator; import com.intellij.openapi.project.Project; @@ -36,7 +35,7 @@ import java.util.List; import static com.intellij.xdebugger.impl.actions.AttachToLocalProcessAction.*; public class AttachToLocalProcessActionTest extends PlatformTestCase { - public void testCollectingAttachItems_Empty() throws Exception { + public void testCollectingAttachItems_Empty() { // no providers assertItems(""); @@ -44,14 +43,14 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { assertItems("", new TestDebuggerProvider(), new TestDebuggerProvider()); } - public void testCollectingAttachItems_OneDebugger() throws Exception { + public void testCollectingAttachItems_OneDebugger() { assertItems("--------\n" + "1 exec1: dbg\n" + "2 exec2: dbg\n", new TestDebuggerProvider("dbg")); } - public void testCollectingAttachItems_DebuggerPerProcess() throws Exception { + public void testCollectingAttachItems_DebuggerPerProcess() { // from one provider assertItems("--------\n" + "1 exec1: dbg1\n" + @@ -60,7 +59,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { new TestDebuggerProvider(2, XLocalAttachGroup.DEFAULT, "dbg2")); } - public void testCollectingAttachItems_SeveralDebuggers() throws Exception { + public void testCollectingAttachItems_SeveralDebuggers() { // from one provider assertItems("--------\n" + "1 exec1: dbg1\n" + @@ -113,7 +112,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { new TestDebuggerProvider("dbg")); } - public void testCollectingAttachItems_Groups() throws Exception { + public void testCollectingAttachItems_Groups() { // one group assertItems("----group----\n" + "1 exec1: dbg1\n" + @@ -154,7 +153,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { new TestDebuggerProvider(new TestAttachGroup("", 1), "dbg1", "dbg2")); } - public void testCollectingAttachItems_Groups_SortingGroups() throws Exception { + public void testCollectingAttachItems_Groups_SortingGroups() { assertItems("----group1----\n" + "1 exec1: dbg1\n" + " dbg1\n" + @@ -215,7 +214,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { new TestDebuggerProvider(new TestAttachGroup("group2", -1), "dbg1", "dbg2")); } - public void testCollectingAttachItems_Groups_SortingItems() throws Exception { + public void testCollectingAttachItems_Groups_SortingItems() { assertItems("----group----\n" + "1 exec1: dbg1\n" + "2 exec2: dbg1\n", @@ -236,7 +235,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { }, "dbg1")); } - public void testCollectingAttachItems_Groups_CustomItemTitles() throws Exception { + public void testCollectingAttachItems_Groups_CustomItemTitles() { assertItems("----group----\n" + "1 custom: dbg1\n" + "2 custom: dbg1\n", @@ -249,7 +248,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { }, "dbg1")); } - public void testHistory() throws Exception { + public void testHistory() { ProcessInfo info1 = new ProcessInfo(1, "command line 1", "exec1", "args1"); ProcessInfo info2 = new ProcessInfo(1, "command line 2", "exec1", "args1"); ProcessInfo info3 = new ProcessInfo(1, "command line 3", "exec1", "args1"); @@ -294,7 +293,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { assertOrderedEquals(getHistory(getProject()), historyItem4, historyItem5, historyItem3, historyItem2); } - public void testHistory_UpdatingPreviousItems() throws Exception { + public void testHistory_UpdatingPreviousItems() { TestAttachGroup group1 = new TestAttachGroup("group1", 1); TestAttachGroup group2 = new TestAttachGroup("group2", 2); @@ -314,7 +313,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { assertOrderedEquals(getHistory(getProject()), historyItem2); } - public void testHistoryGroup() throws Exception { + public void testHistoryGroup() { TestAttachGroup group1 = new TestAttachGroup("group1", 1); TestAttachGroup group2 = new TestAttachGroup("group2", 2); List debuggers1 = createDebuggers("gdb1", "lldb1"); @@ -614,7 +613,7 @@ public class AttachToLocalProcessActionTest extends PlatformTestCase { } @Override - public void attachDebugSession(@NotNull Project project, @NotNull ProcessInfo processInfo) throws ExecutionException { + public void attachDebugSession(@NotNull Project project, @NotNull ProcessInfo processInfo) { } }); } diff --git a/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java b/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java index 7c43fe7bffe3..883dec82c773 100644 --- a/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java +++ b/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java @@ -19,7 +19,7 @@ import org.jdom.Element; * Date: 02.08.13 */ public class ReferenceInjectionTest extends LightCodeInsightFixtureTestCase { - public void testInjectReference() throws Exception { + public void testInjectReference() { myFixture.configureByText("foo.xml", "r\"/>"); assertNull(myFixture.getReferenceAtCaretPosition()); @@ -40,7 +40,7 @@ public class ReferenceInjectionTest extends LightCodeInsightFixtureTestCase { assertNull(myFixture.getReferenceAtCaretPosition()); } - public void testSurviveSerialization() throws Exception { + public void testSurviveSerialization() { myFixture.configureByText("foo.xml", "r\"/>"); assertNull(myFixture.getReferenceAtCaretPosition()); @@ -59,7 +59,7 @@ public class ReferenceInjectionTest extends LightCodeInsightFixtureTestCase { assertNull(myFixture.getReferenceAtCaretPosition()); } - public void testInjectIntoTagValue() throws Exception { + public void testInjectIntoTagValue() { myFixture.configureByText("foo.xml", "xxx/>"); assertNull(myFixture.getReferenceAtCaretPosition()); @@ -70,7 +70,7 @@ public class ReferenceInjectionTest extends LightCodeInsightFixtureTestCase { assertNull(myFixture.getReferenceAtCaretPosition()); } - public void testInjectIntoJava() throws Exception { + public void testInjectIntoJava() { myFixture.configureByText("Foo.java", "class Foo {\n" + " String bar() {\n" + " return \"bar.xml\";\n" + @@ -87,7 +87,7 @@ public class ReferenceInjectionTest extends LightCodeInsightFixtureTestCase { assertNull(getInjectedReferences()); } - public void testInjectByAnnotation() throws Exception { + public void testInjectByAnnotation() { myFixture.configureByText("Foo.java", "class Foo {\n" + " @org.intellij.lang.annotations.Language(\"file-reference\")\n" + " String bar() {\n" + @@ -97,7 +97,7 @@ public class ReferenceInjectionTest extends LightCodeInsightFixtureTestCase { myFixture.testHighlighting(); } - public void testTernary() throws Exception { + public void testTernary() { myFixture.configureByText("Foo.java", "class Foo {\n" + " void bar() {\n" + " @org.intellij.lang.annotations.Language(\"encoding-reference\")\n" + @@ -107,7 +107,7 @@ public class ReferenceInjectionTest extends LightCodeInsightFixtureTestCase { myFixture.testHighlighting(); } - public void testEmptyLiteral() throws Exception { + public void testEmptyLiteral() { myFixture.configureByText("Foo.java", "class Foo {\n" + " void bar() {\n" + " @org.intellij.lang.annotations.Language(\"encoding-reference\")\n" + diff --git a/plugins/ant/tests/src/com/intellij/lang/ant/AntCompletionTest.java b/plugins/ant/tests/src/com/intellij/lang/ant/AntCompletionTest.java index 30dcdce0c87a..db7fadaf72d5 100644 --- a/plugins/ant/tests/src/com/intellij/lang/ant/AntCompletionTest.java +++ b/plugins/ant/tests/src/com/intellij/lang/ant/AntCompletionTest.java @@ -43,7 +43,7 @@ public class AntCompletionTest extends LightCodeInsightTestCase { AntSupport.markFileAsAntFile(myVFile, myFile.getProject(), true); } - public void testSimpleProperty() throws Exception { + public void testSimpleProperty() { configureByFile("test1.xml"); performNormalCompletion(); assertNotNull(getItems()); @@ -51,7 +51,7 @@ public class AntCompletionTest extends LightCodeInsightTestCase { select(); } - public void testSimplePropertyWithDot1() throws Exception { + public void testSimplePropertyWithDot1() { configureByFile("test2.xml"); performNormalCompletion(); assertNotNull(getItems()); @@ -59,7 +59,7 @@ public class AntCompletionTest extends LightCodeInsightTestCase { select(); } - public void testSimplePropertyWithDot2() throws Exception { + public void testSimplePropertyWithDot2() { configureByFile("test4.xml"); performNormalCompletion(); assertNotNull(getItems()); @@ -67,7 +67,7 @@ public class AntCompletionTest extends LightCodeInsightTestCase { select(); } - public void testSimplePropertyWithDot3() throws Exception { + public void testSimplePropertyWithDot3() { configureByFile("/test5.xml"); performNormalCompletion(); assertNotNull(getItems()); @@ -75,7 +75,7 @@ public class AntCompletionTest extends LightCodeInsightTestCase { select(); } - public void testReplace1() throws Exception { + public void testReplace1() { configureByFile("test10.xml"); performNormalCompletion(); assertNotNull(getItems()); @@ -83,7 +83,7 @@ public class AntCompletionTest extends LightCodeInsightTestCase { checkResultByFile("test10-out.xml"); } - public void testSimplePropertyWithDot4() throws Exception { + public void testSimplePropertyWithDot4() { configureByFile("/test6.xml"); performNormalCompletion(); assertNotNull(getItems()); @@ -91,7 +91,7 @@ public class AntCompletionTest extends LightCodeInsightTestCase { select(); } - public void testSimplePropertyWithDotAndMulityReference() throws Exception { + public void testSimplePropertyWithDotAndMulityReference() { configureByFile("test7.xml"); performNormalCompletion(); final LookupElement[] items = getItems(); @@ -100,7 +100,7 @@ public class AntCompletionTest extends LightCodeInsightTestCase { select(); } - public void testSimplePropertyWithNoPrefix() throws Exception { + public void testSimplePropertyWithNoPrefix() { configureByFile("test3.xml"); performNormalCompletion(); assertNotNull(getItems()); @@ -108,26 +108,26 @@ public class AntCompletionTest extends LightCodeInsightTestCase { select(); } - public void testInsertion1() throws Exception { + public void testInsertion1() { configureByFile("test8.xml"); performNormalCompletion(); checkResultByFile("/test8-out.xml"); } - public void testInsertion2() throws Exception { + public void testInsertion2() { configureByFile("test9.xml"); performNormalCompletion(); checkResultByFile("/test8-out.xml"); } - public void testTargetCompletion() throws Exception { + public void testTargetCompletion() { configureByFile("targetCompletion.xml"); performNormalCompletion(); checkResultByFile("/targetCompletion-out.xml"); } - public void testTargetCompletion2() throws Exception { + public void testTargetCompletion2() { final String filePath = "targetCompletion2.xml"; configureByFile(filePath); @@ -137,14 +137,14 @@ public class AntCompletionTest extends LightCodeInsightTestCase { checkResultByFile("/targetCompletion2-out.xml"); } - public void testEntityCompletion() throws Exception { + public void testEntityCompletion() { configureByFile("EntityCompletion.xml"); performNormalCompletion(); checkResultByFile("EntityCompletion-out.xml"); } - public void testTargetAttributesCompletion() throws Exception { + public void testTargetAttributesCompletion() { final String testName = getTestName(false); configureByFile(testName + ".xml"); performNormalCompletion(); @@ -156,33 +156,33 @@ public class AntCompletionTest extends LightCodeInsightTestCase { checkResultByFile(testName + "-out.xml"); } - public void testEndTagCompletion() throws Exception { + public void testEndTagCompletion() { doTest(); } - public void testTargetIfAttrEasterEgg() throws Exception { + public void testTargetIfAttrEasterEgg() { doTest(); } - public void testTargetUnlessAttrEasterEgg() throws Exception { + public void testTargetUnlessAttrEasterEgg() { doTest(); } // TODO implement refs to params - public void _testMacrodefParam() throws Exception { + public void _testMacrodefParam() { doTest(); } // TODO implement refs to params - public void _testMacrodefParam1() throws Exception { + public void _testMacrodefParam1() { doTest(); } - public void testMacrodefNestedElement() throws Exception { + public void testMacrodefNestedElement() { doTest(); } - private void doTest() throws Exception { + private void doTest() { final String testName = getTestName(false); configureByFile(testName + ".xml"); performNormalCompletion(); diff --git a/plugins/ant/tests/src/com/intellij/lang/ant/AntHighlightingTest.java b/plugins/ant/tests/src/com/intellij/lang/ant/AntHighlightingTest.java index e3a849843e66..ba7f7f513009 100644 --- a/plugins/ant/tests/src/com/intellij/lang/ant/AntHighlightingTest.java +++ b/plugins/ant/tests/src/com/intellij/lang/ant/AntHighlightingTest.java @@ -105,7 +105,7 @@ public class AntHighlightingTest extends DaemonAnalyzerTestCase { doTest(); } - public void testBigFilePerformance() throws Exception { + public void testBigFilePerformance() { try { myIgnoreInfos = true; PlatformTestUtil.startPerformanceTest("Big ant file highlighting", 15_000, () -> { diff --git a/plugins/ant/tests/src/com/intellij/lang/ant/AntMultiFileCompletionTest.java b/plugins/ant/tests/src/com/intellij/lang/ant/AntMultiFileCompletionTest.java index ac79faae04e2..4a7bf9aa04f5 100644 --- a/plugins/ant/tests/src/com/intellij/lang/ant/AntMultiFileCompletionTest.java +++ b/plugins/ant/tests/src/com/intellij/lang/ant/AntMultiFileCompletionTest.java @@ -33,7 +33,7 @@ public class AntMultiFileCompletionTest extends UsefulTestCase { return PluginPathManager.getPluginHomePath("ant") + "/tests/data/psi/completion/"; } - public void testPropertyCompletion() throws Throwable { + public void testPropertyCompletion() { final String testName = "PropertyCompletion"; doTestFor( new String [] { testName, testName + ".properties" }, @@ -41,13 +41,13 @@ public class AntMultiFileCompletionTest extends UsefulTestCase { ); } - public void testPropertyCompletion2() throws Throwable { + public void testPropertyCompletion2() { final String testName = "PropertyCompletion2"; final String[] fileNames = new String [] { testName + ".xml", "PropertyCompletion.properties" }; myFixture.testCompletionTyping(fileNames, "\n", testName + "_after.xml"); } - private void doTestFor(final String[] fileNames, final String ext) throws Throwable { + private void doTestFor(final String[] fileNames, final String ext) { String initialTest = fileNames[0]; for(int i = 0; i < fileNames.length; ++i) { diff --git a/plugins/ant/tests/src/com/intellij/lang/ant/AntParsingTest.java b/plugins/ant/tests/src/com/intellij/lang/ant/AntParsingTest.java index 18c2c9d9bc70..2b220af9e16a 100644 --- a/plugins/ant/tests/src/com/intellij/lang/ant/AntParsingTest.java +++ b/plugins/ant/tests/src/com/intellij/lang/ant/AntParsingTest.java @@ -45,83 +45,83 @@ public class AntParsingTest extends ParsingTestCase { return PluginPathManager.getPluginHomePath("ant") + "/tests/data/psi"; } - public void testSingleProject() throws Exception { + public void testSingleProject() { doTest(true); } - public void testProjectWithDefaultTarget() throws Exception { + public void testProjectWithDefaultTarget() { doTest(true); } - public void testProjectWithDescriptions() throws Exception { + public void testProjectWithDescriptions() { doTest(true); } - public void testProjectWithDependentTargets() throws Exception { + public void testProjectWithDependentTargets() { doTest(true); } - public void testSimpleProperties() throws Exception { + public void testSimpleProperties() { doTest(true); } - public void testPropertyLocation() throws Exception { + public void testPropertyLocation() { doTest(true); } - public void testPropertyFile() throws Exception { + public void testPropertyFile() { doTest(true); } - public void testSimpleAntCall() throws Exception { + public void testSimpleAntCall() { doTest(true); } - public void testAntCallNestedTargets() throws Exception { + public void testAntCallNestedTargets() { doTest(true); } - public void testAntComments() throws Exception { + public void testAntComments() { doTest(true); } - public void testPrologEpilogue() throws Exception { + public void testPrologEpilogue() { doTest(true); } - public void testMacroDef() throws Exception { + public void testMacroDef() { doTest(true); } - public void testPresetDef() throws Exception { + public void testPresetDef() { doTest(true); } - public void testForwardMacroDef() throws Exception { + public void testForwardMacroDef() { doTest(true); } - public void testSequentialParallel() throws Exception { + public void testSequentialParallel() { doTest(true); } - public void testAvailable() throws Exception { + public void testAvailable() { doTest(true); } - public void testChecksum() throws Exception { + public void testChecksum() { doTest(true); } - public void testChecksum1() throws Exception { + public void testChecksum1() { doTest(true); } - public void testCondition() throws Exception { + public void testCondition() { doTest(true); } - public void testUptodate() throws Exception { + public void testUptodate() { doTest(true); } @@ -129,47 +129,47 @@ public class AntParsingTest extends ParsingTestCase { doTest(SystemInfo.isWindows ? "_w" : "_u"); } - public void testBasename() throws Exception { + public void testBasename() { doTest(true); } - public void testLoadFile() throws Exception { + public void testLoadFile() { doTest(true); } - public void testTempFile() throws Exception { + public void testTempFile() { doTest(true); } - public void testLength() throws Exception { + public void testLength() { doTest(true); } - public void testPathConvert() throws Exception { + public void testPathConvert() { doTest(true); } - public void testWhichResource() throws Exception { + public void testWhichResource() { doTest(true); } - public void testP4Counter() throws Exception { + public void testP4Counter() { doTest(true); } - public void testJarLibResolve() throws Exception { + public void testJarLibResolve() { doTest(true); } - public void testAntTask() throws Exception { + public void testAntTask() { doTest(true); } - public void testJava() throws Exception { + public void testJava() { doTest(true); } - public void testBuildNumber() throws Exception { + public void testBuildNumber() { doTest(true); } } \ No newline at end of file diff --git a/plugins/ant/tests/src/com/intellij/lang/ant/AntRenameTest.java b/plugins/ant/tests/src/com/intellij/lang/ant/AntRenameTest.java index 3988e3dbe144..d52c8586360f 100644 --- a/plugins/ant/tests/src/com/intellij/lang/ant/AntRenameTest.java +++ b/plugins/ant/tests/src/com/intellij/lang/ant/AntRenameTest.java @@ -29,75 +29,75 @@ import org.jetbrains.annotations.NotNull; public class AntRenameTest extends LightCodeInsightTestCase { - public void testSimpleProperty() throws Exception { + public void testSimpleProperty() { doTest(); } - public void testSimplePropertyReference() throws Exception { + public void testSimplePropertyReference() { doTest(); } - public void testParam() throws Exception { + public void testParam() { doTest(); } - public void testParamReference() throws Exception { + public void testParamReference() { doTest(); } - public void testRefid() throws Exception { + public void testRefid() { doTest(); } - public void testRefidReference() throws Exception { + public void testRefidReference() { doTest(); } - public void testRefidReferenceInDependieTarget() throws Exception { + public void testRefidReferenceInDependieTarget() { doTest(); } - public void testSingleTarget() throws Exception { + public void testSingleTarget() { doTest(); } - public void testSingleTargetReference() throws Exception { + public void testSingleTargetReference() { doTest(); } - public void testAntCall() throws Exception { + public void testAntCall() { doTest(); } - public void testAntCallReference() throws Exception { + public void testAntCallReference() { doTest(); } - public void testDependsTarget1() throws Exception { + public void testDependsTarget1() { doTest(); } - public void testDependsTarget2() throws Exception { + public void testDependsTarget2() { doTest(); } - public void testDependsTargetReference1() throws Exception { + public void testDependsTargetReference1() { doTest(); } - public void testDependsTargetReference2() throws Exception { + public void testDependsTargetReference2() { doTest(); } - public void testTargetProperties() throws Exception { + public void testTargetProperties() { doTest(); } - public void testTstampProperty() throws Exception { + public void testTstampProperty() { doTest(); } - public void testTstampProperty1() throws Exception { + public void testTstampProperty1() { doTest(); } @@ -113,19 +113,19 @@ public class AntRenameTest extends LightCodeInsightTestCase { } */ - public void testInputProperty() throws Exception { + public void testInputProperty() { doTest(); } - public void testInputProperty1() throws Exception { + public void testInputProperty1() { doTest(); } - public void testRenameByRef() throws Exception { + public void testRenameByRef() { doTest(); } - public void testRenameByDeclaration() throws Exception { + public void testRenameByDeclaration() { doTest(); } @@ -135,7 +135,7 @@ public class AntRenameTest extends LightCodeInsightTestCase { return PluginPathManager.getPluginHomePath("ant").replace('\\', '/') + "/tests/data/psi/rename/"; } - private void doTest() throws Exception { + private void doTest() { final String filename = getTestName(true) + ".xml"; VirtualFile vfile = VirtualFileManager.getInstance().findFileByUrl("file://" + getTestDataPath() + filename); String text = FileDocumentManager.getInstance().getDocument(vfile).getText(); diff --git a/plugins/devkit/testSources/inspections/InspectionDescriptionNotFoundInspectionTest.java b/plugins/devkit/testSources/inspections/InspectionDescriptionNotFoundInspectionTest.java index c9f18595e1dc..135f0668c053 100644 --- a/plugins/devkit/testSources/inspections/InspectionDescriptionNotFoundInspectionTest.java +++ b/plugins/devkit/testSources/inspections/InspectionDescriptionNotFoundInspectionTest.java @@ -17,7 +17,6 @@ package org.jetbrains.idea.devkit.inspections; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.codeInspection.LocalInspectionEP; -import com.intellij.codeInspection.LocalInspectionTool; import com.intellij.lang.LanguageExtensionPoint; import com.intellij.openapi.application.PluginPathManager; import com.intellij.openapi.vfs.VirtualFile; @@ -37,7 +36,7 @@ public class InspectionDescriptionNotFoundInspectionTest extends JavaCodeInsight } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { moduleBuilder.addLibrary("core-api", PathUtil.getJarPathForClass(LanguageExtensionPoint.class)); moduleBuilder.addLibrary("analysis-api", PathUtil.getJarPathForClass(LocalInspectionEP.class)); moduleBuilder.addLibrary("platform-resources", Paths.get(PathUtil.getJarPathForClass(LocalInspectionEP.class)) diff --git a/plugins/devkit/testSources/inspections/InspectionMappingConsistencyInspectionTest.java b/plugins/devkit/testSources/inspections/InspectionMappingConsistencyInspectionTest.java index 24d5fcac14c2..2d9dde944da1 100644 --- a/plugins/devkit/testSources/inspections/InspectionMappingConsistencyInspectionTest.java +++ b/plugins/devkit/testSources/inspections/InspectionMappingConsistencyInspectionTest.java @@ -28,16 +28,16 @@ import com.intellij.util.PathUtil; @TestDataPath("$CONTENT_ROOT/testData/inspections/inspectionMappingConsistency") public class InspectionMappingConsistencyInspectionTest extends JavaCodeInsightFixtureTestCase { - public void testInspectionMappings() throws Throwable { + public void testInspectionMappings() { myFixture.testHighlighting("inspectionMapping.xml", "bundle.properties"); } - public void testInspectionMappingsWithDefaultBundle() throws Throwable { + public void testInspectionMappingsWithDefaultBundle() { myFixture.testHighlighting("inspectionMappingWithDefaultBundle.xml", "bundle.properties"); } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { String pathForClass = PathUtil.getJarPathForClass(LocalInspectionEP.class); moduleBuilder.addLibrary("lang-api", pathForClass); } diff --git a/plugins/devkit/testSources/inspections/PsiElementConcatenationInspectionTest.java b/plugins/devkit/testSources/inspections/PsiElementConcatenationInspectionTest.java index 81b9eced9bd6..2a0b6fc0859b 100644 --- a/plugins/devkit/testSources/inspections/PsiElementConcatenationInspectionTest.java +++ b/plugins/devkit/testSources/inspections/PsiElementConcatenationInspectionTest.java @@ -57,7 +57,7 @@ public class PsiElementConcatenationInspectionTest extends LightQuickFixParamete return PluginPathManager.getPluginHomePath("devkit") + "/testData"; } - public void test() throws Exception { + public void test() { doAllTests(); } diff --git a/plugins/devkit/testSources/inspections/UniqueToolbarIdInspectionTest.java b/plugins/devkit/testSources/inspections/UniqueToolbarIdInspectionTest.java index af430773d141..bfd1314625c1 100644 --- a/plugins/devkit/testSources/inspections/UniqueToolbarIdInspectionTest.java +++ b/plugins/devkit/testSources/inspections/UniqueToolbarIdInspectionTest.java @@ -43,7 +43,7 @@ public class UniqueToolbarIdInspectionTest extends PluginModuleTestCase { "}"); } - public void testUsingEmptyToolbarId() throws Exception { + public void testUsingEmptyToolbarId() { myFixture.testHighlighting("UniqueToolbarIdTestDataClass.java"); } } diff --git a/plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java b/plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java index 9d4fe2b60ebe..d94d03ab6efb 100644 --- a/plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java +++ b/plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java @@ -38,7 +38,7 @@ public class DescriptionTypeRelatedItemLineMarkerProviderTest extends JavaCodeIn } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { String pathForClass = PathUtil.getJarPathForClass(LocalInspectionEP.class); moduleBuilder.addLibrary("lang-api", pathForClass); String platformApiJar = PathUtil.getJarPathForClass(JBList.class); diff --git a/plugins/devkit/testSources/navigation/ExtensionDeclarationRelatedItemLineMarkerProviderTest.java b/plugins/devkit/testSources/navigation/ExtensionDeclarationRelatedItemLineMarkerProviderTest.java index 733444008f1a..dea2020fbb63 100644 --- a/plugins/devkit/testSources/navigation/ExtensionDeclarationRelatedItemLineMarkerProviderTest.java +++ b/plugins/devkit/testSources/navigation/ExtensionDeclarationRelatedItemLineMarkerProviderTest.java @@ -35,7 +35,7 @@ public class ExtensionDeclarationRelatedItemLineMarkerProviderTest extends JavaC } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { String extensionsJar = PathUtil.getJarPathForClass(ExtensionPointName.class); moduleBuilder.addLibrary("extensions", extensionsJar); String platformApiJar = PathUtil.getJarPathForClass(JBList.class); diff --git a/plugins/devkit/testSources/navigation/ExtensionPointDeclarationRelatedItemLineMarkerProviderTest.java b/plugins/devkit/testSources/navigation/ExtensionPointDeclarationRelatedItemLineMarkerProviderTest.java index 1c6d13f47bff..2dc42176b262 100644 --- a/plugins/devkit/testSources/navigation/ExtensionPointDeclarationRelatedItemLineMarkerProviderTest.java +++ b/plugins/devkit/testSources/navigation/ExtensionPointDeclarationRelatedItemLineMarkerProviderTest.java @@ -35,7 +35,7 @@ public class ExtensionPointDeclarationRelatedItemLineMarkerProviderTest extends } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { String extensionsJar = PathUtil.getJarPathForClass(ExtensionPointName.class); moduleBuilder.addLibrary("extensions", extensionsJar); String platformApiJar = PathUtil.getJarPathForClass(JBList.class); diff --git a/plugins/devkit/testSources/testAssistant/TestDataGuessByExistingFilesUtilTest.java b/plugins/devkit/testSources/testAssistant/TestDataGuessByExistingFilesUtilTest.java index b86cda0edcdc..60a62c3f0ab1 100644 --- a/plugins/devkit/testSources/testAssistant/TestDataGuessByExistingFilesUtilTest.java +++ b/plugins/devkit/testSources/testAssistant/TestDataGuessByExistingFilesUtilTest.java @@ -53,7 +53,7 @@ public class TestDataGuessByExistingFilesUtilTest extends TestDataPathTestCase { } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { moduleBuilder.addLibrary("junit3", JavaSdkUtil.getJunit3JarPath()); } @@ -63,7 +63,7 @@ public class TestDataGuessByExistingFilesUtilTest extends TestDataPathTestCase { assertEquals("TestName", result); } - public void testCollectTestDataByExistingFilesBeforeAndAfter() throws IOException { + public void testCollectTestDataByExistingFilesBeforeAndAfter() { PsiMethod testMethod = getTestMethodWithBeforeAndAfterTestData(); List result = TestDataGuessByExistingFilesUtil.collectTestDataByExistingFiles(testMethod); verifyResultForBeforeAndAfter(result); @@ -76,7 +76,7 @@ public class TestDataGuessByExistingFilesUtilTest extends TestDataPathTestCase { verifyResultForBeforeAndAfter(result); } - public void testCollectTestDataByExistingFilesBeforeAndSame() throws IOException { + public void testCollectTestDataByExistingFilesBeforeAndSame() { PsiMethod testMethod = getTestMethodWithBeforeAndSameTestData(); List result = TestDataGuessByExistingFilesUtil.collectTestDataByExistingFiles(testMethod); verifyResultForBeforeAndSame(result); @@ -89,7 +89,7 @@ public class TestDataGuessByExistingFilesUtilTest extends TestDataPathTestCase { verifyResultForBeforeAndSame(result); } - public void testCollectTestDataByExistingFilesAfterAndSame() throws IOException { + public void testCollectTestDataByExistingFilesAfterAndSame() { PsiMethod testMethod = getTestMethodWithAfterAndSameTestData(); List result = TestDataGuessByExistingFilesUtil.collectTestDataByExistingFiles(testMethod); verifyResultForAfterAndSame(result); @@ -102,7 +102,7 @@ public class TestDataGuessByExistingFilesUtilTest extends TestDataPathTestCase { verifyResultForAfterAndSame(result); } - public void testCollectTestDataByExistingFilesOnlySame() throws IOException { + public void testCollectTestDataByExistingFilesOnlySame() { PsiMethod testMethod = getTestMethodWithOnlySameTestData(); List result = TestDataGuessByExistingFilesUtil.collectTestDataByExistingFiles(testMethod); verifyResultForOnlySame(result); diff --git a/plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java b/plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java index 40debeca9f2b..1c250aac2bad 100644 --- a/plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java +++ b/plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java @@ -20,7 +20,7 @@ import com.intellij.testFramework.TestDataPath; @TestDataPath("$CONTENT_ROOT/testData/completionTestDataPath") public class TestDataPathCompletionTest extends TestDataPathTestCase { - public void testProjectRoot() throws Exception { + public void testProjectRoot() { doTest(); } diff --git a/plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java b/plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java index 1deff1609d8c..98aa5b1daecf 100644 --- a/plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java +++ b/plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java @@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable; @TestDataPath("$CONTENT_ROOT/testData/resolveTestDataPath/") public class TestDataPathResolvingTest extends TestDataPathTestCase { - public void testProjectRootReference() throws Exception { + public void testProjectRootReference() { doTest(PsiManager.getInstance(myFixture.getProject()).findDirectory(myFixture.getProject().getBaseDir())); } diff --git a/plugins/devkit/testSources/testAssistant/TestDataPathTestCase.java b/plugins/devkit/testSources/testAssistant/TestDataPathTestCase.java index e52d1d1eeb0b..de05301d9bd5 100644 --- a/plugins/devkit/testSources/testAssistant/TestDataPathTestCase.java +++ b/plugins/devkit/testSources/testAssistant/TestDataPathTestCase.java @@ -46,7 +46,7 @@ abstract public class TestDataPathTestCase extends JavaCodeInsightFixtureTestCas } @Override - protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception { + protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) { moduleBuilder.addContentRoot(myFixture.getTempDirPath()); } } diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java index 7628edef23f3..632765e7b887 100644 --- a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java @@ -82,7 +82,7 @@ public class EclipseEmlTest extends IdeaTestCase { return module; } - protected static void checkModule(String path, Module module) throws WriteExternalException, IOException, JDOMException { + protected static void checkModule(String path, Module module) throws WriteExternalException { ModuleRootModel rootModel = ModuleRootManager.getInstance(module); final Element root = new Element("component"); IdeaSpecificSettings.writeIdeaSpecificClasspath(root, rootModel); diff --git a/plugins/git4idea/tests/git4idea/history/GitHistoryUtilsTest.java b/plugins/git4idea/tests/git4idea/history/GitHistoryUtilsTest.java index c6c4d62b8a61..503494455aca 100644 --- a/plugins/git4idea/tests/git4idea/history/GitHistoryUtilsTest.java +++ b/plugins/git4idea/tests/git4idea/history/GitHistoryUtilsTest.java @@ -227,7 +227,7 @@ public class GitHistoryUtilsTest extends GitSingleRepoTest { } } - private static TestCommit move(String file, File dir, String message) throws Exception { + private static TestCommit move(String file, File dir, String message) { final String NAME = "PostHighlightingPass.java"; mv(file, dir.getPath()); file = new File(dir, NAME).getPath(); diff --git a/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java b/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java index 75599fe2c4c2..3c344b3b3c02 100644 --- a/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java +++ b/plugins/git4idea/tests/git4idea/history/GitLogParserTest.java @@ -150,38 +150,38 @@ public class GitLogParserTest extends GitPlatformTest { doTestOneRecord(STATUS); } - public void test_char_0001_in_commit_message() throws VcsException { + public void test_char_0001_in_commit_message() { doTestCustomCommitMessage("Commit \u0001subject", "Commit \u0001subject"); } - public void test_double_char_0001_in_commit_message() throws VcsException { + public void test_double_char_0001_in_commit_message() { doTestCustomCommitMessage("Commit \u0001\u0001subject", "Commit subject"); } - public void test_char_0003_in_commit_message() throws VcsException { + public void test_char_0003_in_commit_message() { doTestCustomCommitMessage("Commit \u0003subject", "Commit \u0003subject"); } - public void test_double_char_0003_in_commit_message() throws VcsException { + public void test_double_char_0003_in_commit_message() { doTestCustomCommitMessage("Commit \u0003\u0003subject", "Commit \u0003\u0003subject"); } - public void test_both_chars_0001_and_0003_in_commit_message() throws VcsException { + public void test_both_chars_0001_and_0003_in_commit_message() { doTestCustomCommitMessage("Subject \u0001of the \u0003# weirdmessage", "Subject \u0001of the \u0003# weirdmessage"); } // this is not fixed, keeping the test for the record and possible future fix @SuppressWarnings("unused") - public void _test_both_double_chars_0001_and_0003_in_commit_message() throws VcsException { + public void _test_both_double_chars_0001_and_0003_in_commit_message() { doTestCustomCommitMessage("Subject \u0001\u0001of the \u0003\u0003# weirdmessage", "Subject of the \u0003\u0003# weirdmessage"); } - public void test_char_0001_twice_in_commit_message() throws VcsException { + public void test_char_0001_twice_in_commit_message() { doTestCustomCommitMessage("Subject \u0001of the \u0001# weird message", "Subject \u0001of the \u0001# weird message"); } - public void test_double_char_0001_twice_in_commit_message() throws VcsException { + public void test_double_char_0001_twice_in_commit_message() { doTestCustomCommitMessage("Subject \u0001\u0001of the \u0001\u0001# weird message", "Subject of the # weird message"); } diff --git a/plugins/git4idea/tests/git4idea/log/GitBranchComparatorTest.java b/plugins/git4idea/tests/git4idea/log/GitBranchComparatorTest.java index ff385a8a3f35..7795991678fb 100644 --- a/plugins/git4idea/tests/git4idea/log/GitBranchComparatorTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitBranchComparatorTest.java @@ -19,59 +19,58 @@ import com.intellij.util.containers.ContainerUtil; import com.intellij.vcs.log.VcsRef; import org.jetbrains.annotations.NotNull; -import java.io.IOException; import java.util.Collection; import java.util.Comparator; public class GitBranchComparatorTest extends GitRefManagerTest { - public void test_tracked_remote_branch_is_more_important_than_its_local_branch() throws IOException { + public void test_tracked_remote_branch_is_more_important_than_its_local_branch() { check("origin/139", given("origin/139", "139")); } - public void test_tracked_remote_branch_is_more_important_than_any_local_branch() throws IOException { + public void test_tracked_remote_branch_is_more_important_than_any_local_branch() { check("origin/139", given("feature", "origin/139", "139")); } - public void test_untracked_remote_branch_is_less_important_than_any_local_branch() throws IOException { + public void test_untracked_remote_branch_is_less_important_than_any_local_branch() { check("feature", given("feature", "origin/139")); } - public void test_master_is_more_important_than_other_local_branches() throws IOException { + public void test_master_is_more_important_than_other_local_branches() { check("master", given("feature", "master")); } - public void test_origin_master_is_more_important_than_other_remote_branches() throws IOException { + public void test_origin_master_is_more_important_than_other_remote_branches() { check("origin/master", given("origin/139", "master", "139", "origin/master", "origin/135")); } - public void test_local_branch_is_more_important_than_tag() throws IOException { + public void test_local_branch_is_more_important_than_tag() { check("feature", given("refs/tags/v1", "feature", "refs/tags/v2")); } - public void test_two_local_non_tracking_branches_are_compared_lexicographically() throws IOException { + public void test_two_local_non_tracking_branches_are_compared_lexicographically() { check("feature", given("zoo", "feature")); } - public void test_tracking_local_branch_is_more_important_than_nontracking_local_branch() throws IOException { + public void test_tracking_local_branch_is_more_important_than_nontracking_local_branch() { Collection refs = given("zoo", "origin/zoo", "feature"); refs = ContainerUtil.filter(refs, ref -> !ref.getName().equals("origin/zoo")); assertEquals("zoo", getTheMostPowerfulRef(refs).getName()); } - public void test_two_remote_non_tracking_branches_are_compared_lexicographically() throws IOException { + public void test_two_remote_non_tracking_branches_are_compared_lexicographically() { check("github/zoo", given("origin/feature", "origin/zoo", "github/zoo")); } - public void test_local_branch_is_more_important_than_HEAD() throws IOException { + public void test_local_branch_is_more_important_than_HEAD() { check("feature", given("feature", "HEAD")); } - public void test_tag_is_more_important_than_HEAD() throws IOException { + public void test_tag_is_more_important_than_HEAD() { check("refs/tags/v1", given("refs/tags/v1", "HEAD")); } - private void check(@NotNull String expectedBest, @NotNull Collection givenBranches) throws IOException { + private void check(@NotNull String expectedBest, @NotNull Collection givenBranches) { VcsRef actualBest = getTheMostPowerfulRef(givenBranches); assertEquals(expect(expectedBest).get(0), actualBest); } diff --git a/plugins/git4idea/tests/git4idea/log/GitLabelComparatorTest.java b/plugins/git4idea/tests/git4idea/log/GitLabelComparatorTest.java index 77042741085c..2204da09aeae 100644 --- a/plugins/git4idea/tests/git4idea/log/GitLabelComparatorTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitLabelComparatorTest.java @@ -19,7 +19,6 @@ import com.intellij.util.containers.ContainerUtil; import com.intellij.vcs.log.VcsRef; import org.jetbrains.annotations.NotNull; -import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -30,53 +29,53 @@ public class GitLabelComparatorTest extends GitRefManagerTest { check(Collections.emptyList(), Collections.emptyList()); } - public void testSingle() throws IOException { + public void testSingle() { check(given("HEAD"), expect("HEAD")); } - public void test_HEAD_is_at_left_from_branch() throws IOException { + public void test_HEAD_is_at_left_from_branch() { check(given("master", "HEAD"), expect("HEAD", "master")); } - public void testLocalBranchesAreComparedAsStrings() throws IOException { + public void testLocalBranchesAreComparedAsStrings() { check(given("release", "feature"), expect("feature", "release")); } - public void test_tag_is_to_the_right_of_remote_branch() throws IOException { + public void test_tag_is_to_the_right_of_remote_branch() { check(given("refs/tags/v1", "origin/master"), expect("origin/master", "refs/tags/v1")); } - public void test_master_is_to_the_left_of_other_local_branches() throws IOException { + public void test_master_is_to_the_left_of_other_local_branches() { check(given("feature", "master"), expect("master", "feature")); } - public void test_origin_master_is_to_the_left_of_other_remote_branches() throws IOException { + public void test_origin_master_is_to_the_left_of_other_remote_branches() { check(given("origin/master", "origin/aaa"), expect("origin/master", "origin/aaa")); } - public void test_remote_tracking_branch_is_to_the_left_of_other_remote_branches() throws IOException { + public void test_remote_tracking_branch_is_to_the_left_of_other_remote_branches() { check(given("feature", "origin/aaa", "origin/feature"), expect("feature", "origin/feature", "origin/aaa")); } - public void test_complex_1() throws IOException { + public void test_complex_1() { check(given("refs/tags/v1", "feature", "HEAD", "master"), expect("HEAD", "master", "feature", "refs/tags/v1")); } - public void test_complex_2() throws IOException { + public void test_complex_2() { check(given("origin/master", "origin/great_feature", "refs/tags/v1", "release", "HEAD", "master"), expect("HEAD", "master", "release", "origin/master", "origin/great_feature", "refs/tags/v1")); } // may happen e.g. in multi-repo case - public void testTwoMasters() throws IOException { + public void testTwoMasters() { check(given("master", "master"), expect("master", "master")); } diff --git a/plugins/git4idea/tests/git4idea/log/GitLogProviderTest.java b/plugins/git4idea/tests/git4idea/log/GitLogProviderTest.java index 595711f14e29..2fab798b6cdd 100644 --- a/plugins/git4idea/tests/git4idea/log/GitLogProviderTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitLogProviderTest.java @@ -32,7 +32,6 @@ import git4idea.test.GitSingleRepoTest; import git4idea.test.GitTestUtil; import org.jetbrains.annotations.NotNull; -import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -284,7 +283,7 @@ public class GitLogProviderTest extends GitSingleRepoTest { tac("b.txt"); } - private static void prepareLongHistory(int size) throws IOException { + private static void prepareLongHistory(int size) { for (int i = 0; i < size; i++) { String file = "a" + (i % 10) + ".txt"; if (i < 10) { diff --git a/plugins/git4idea/tests/git4idea/log/GitRefGroupsTest.java b/plugins/git4idea/tests/git4idea/log/GitRefGroupsTest.java index 96d7cbcf7283..e75fa9607964 100644 --- a/plugins/git4idea/tests/git4idea/log/GitRefGroupsTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitRefGroupsTest.java @@ -23,23 +23,22 @@ import com.intellij.vcs.log.VcsRef; import com.intellij.vcs.log.impl.SingletonRefGroup; import org.jetbrains.annotations.NotNull; -import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.List; public class GitRefGroupsTest extends GitRefManagerTest { - public void test_single_tracked_branch() throws IOException { + public void test_single_tracked_branch() { check(given("HEAD", "master", "origin/master"), ContainerUtil.list("HEAD"), Pair.create("Local", ContainerUtil.list("master")), Pair.create("Tracked", ContainerUtil.list("origin/master")), Pair.create("origin/...", ContainerUtil.list("origin/master"))); } - public void test_single_local_branch() throws IOException { + public void test_single_local_branch() { check(given("HEAD", "master"), ContainerUtil.list("HEAD"), Pair.create("Local", ContainerUtil.list("master"))); } - public void test_local_tracked_and_remote_branch() throws IOException { + public void test_local_tracked_and_remote_branch() { check(given("HEAD", "master", "origin/master", "origin/remote_branch", "local_branch"), ContainerUtil.list("HEAD"), Pair.create("Local", ContainerUtil.list("master", "local_branch")), Pair.create("Tracked", ContainerUtil.list("origin/master")), Pair.create("origin/...", ContainerUtil.list("origin/master", "origin/remote_branch"))); diff --git a/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java b/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java index 439649edfc8e..549e3451ca7e 100644 --- a/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitRefManagerTest.java @@ -13,7 +13,6 @@ import git4idea.test.GitSingleRepoTest; import git4idea.test.GitTestUtil; import org.jetbrains.annotations.NotNull; -import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.Set; @@ -24,7 +23,7 @@ import static git4idea.test.GitExecutor.git; public abstract class GitRefManagerTest extends GitSingleRepoTest { @NotNull - protected Collection given(@NotNull String... refs) throws IOException { + protected Collection given(@NotNull String... refs) { Collection result = ContainerUtil.newArrayList(); cd(myProjectRoot); Hash hash = HashImpl.build(git("rev-parse HEAD")); diff --git a/plugins/git4idea/tests/git4idea/log/GitUserFilterTest.java b/plugins/git4idea/tests/git4idea/log/GitUserFilterTest.java index 5b7ed9099890..3319607a06a4 100644 --- a/plugins/git4idea/tests/git4idea/log/GitUserFilterTest.java +++ b/plugins/git4idea/tests/git4idea/log/GitUserFilterTest.java @@ -22,8 +22,6 @@ import git4idea.test.GitSingleRepoTest; import git4idea.test.GitTestUtil; import org.jetbrains.annotations.NotNull; -import java.io.IOException; - import static git4idea.test.GitExecutor.modify; public class GitUserFilterTest extends GitSingleRepoTest { @@ -34,7 +32,7 @@ public class GitUserFilterTest extends GitSingleRepoTest { super.setUp(); myVcsLogUserFilterTest = new VcsLogUserFilterTest(GitTestUtil.findGitLogProvider(myProject), myProject) { @NotNull - protected String commit(@NotNull VcsUser user) throws IOException { + protected String commit(@NotNull VcsUser user) { GitTestUtil.setupUsername(user.getName(), user.getEmail()); String commit = modify("file.txt"); GitTestUtil.setupDefaultUsername(); diff --git a/plugins/git4idea/tests/git4idea/push/GitPushTargetTest.java b/plugins/git4idea/tests/git4idea/push/GitPushTargetTest.java index b6ee56083383..215590727873 100644 --- a/plugins/git4idea/tests/git4idea/push/GitPushTargetTest.java +++ b/plugins/git4idea/tests/git4idea/push/GitPushTargetTest.java @@ -31,22 +31,22 @@ public class GitPushTargetTest extends GitSingleRepoTest { addRemote("origin"); } - public void test_no_push_spec() throws Exception { + public void test_no_push_spec() { GitPushTarget target = GitPushTarget.getFromPushSpec(myRepo, ObjectUtils.assertNotNull(myRepo.getCurrentBranch())); assertNull(target); } - public void test_refs_for_master() throws Exception { + public void test_refs_for_master() { setPushSpec("origin", "HEAD:refs/for/master"); assertSpecialTargetRef("refs/for/master", "origin"); } - public void test_wildcard_special_ref() throws Exception { + public void test_wildcard_special_ref() { setPushSpec("origin", "refs/heads/*:refs/for/*"); assertSpecialTargetRef("refs/for/master", "origin"); } - public void test_complex_remote_name() throws Exception { + public void test_complex_remote_name() { addRemote("my/remote"); setPushSpec("my/remote", "HEAD:refs/for/master"); setTracking("master", "my/remote", "refs/heads/master"); @@ -54,13 +54,13 @@ public class GitPushTargetTest extends GitSingleRepoTest { assertSpecialTargetRef("refs/for/master", "my/remote"); } - public void test_standard_fetch_refspec() throws Exception { + public void test_standard_fetch_refspec() { setPushSpec("origin", "refs/heads/*:refs/remotes/origin/*"); assertStandardRemoteBranch("master", ObjectUtils.assertNotNull(myRepo.getBranches().findBranchByName("origin/master"))); } - public void test_tracked_remote_is_preferable_over_origin() throws Exception { + public void test_tracked_remote_is_preferable_over_origin() { addRemote("github"); setPushSpec("origin", "HEAD:refs/for/origin"); setPushSpec("github", "HEAD:refs/for/github"); diff --git a/plugins/git4idea/tests/git4idea/rebase/GitRebaserReorderCommitsTest.java b/plugins/git4idea/tests/git4idea/rebase/GitRebaserReorderCommitsTest.java index ae1c2b34f647..49cfdead1e81 100644 --- a/plugins/git4idea/tests/git4idea/rebase/GitRebaserReorderCommitsTest.java +++ b/plugins/git4idea/tests/git4idea/rebase/GitRebaserReorderCommitsTest.java @@ -23,7 +23,6 @@ import git4idea.test.GitTestUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.ide.BuiltInServerManager; -import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -89,7 +88,7 @@ public class GitRebaserReorderCommitsTest extends GitSingleRepoTest { assertCommits(myFirstCommit, hashes[2], hashes[1], hashes[0]); } - private static String[] makeCommits(int number) throws IOException { + private static String[] makeCommits(int number) { String[] hashes = new String[number]; for (int i = 0; i < hashes.length; i++) { hashes[i] = makeCommit(); @@ -98,13 +97,13 @@ public class GitRebaserReorderCommitsTest extends GitSingleRepoTest { } @NotNull - private static String makeCommit() throws IOException { + private static String makeCommit() { touch(Math.random() + ".txt", "initial" + Math.random()); addCommit("some commit"); return last(); } - private static void assertCommits(String... commits) throws IOException { + private static void assertCommits(String... commits) { final String[] hashes = git("rev-list --reverse HEAD").split("\n"); assertEquals(commits.length, hashes.length); for (int i = 0; i < commits.length; i++) { diff --git a/plugins/git4idea/tests/git4idea/repo/GitConfigTest.java b/plugins/git4idea/tests/git4idea/repo/GitConfigTest.java index 7132cf8bab26..25fb8ec8b8ca 100644 --- a/plugins/git4idea/tests/git4idea/repo/GitConfigTest.java +++ b/plugins/git4idea/tests/git4idea/repo/GitConfigTest.java @@ -53,7 +53,7 @@ public class GitConfigTest extends GitPlatformTest { } //inspired by IDEA-135557 - public void test_branch_with_hash_symbol() throws IOException { + public void test_branch_with_hash_symbol() { createRepository(); addRemote("http://example.git"); git("update-ref refs/remotes/origin/a#branch HEAD"); @@ -71,7 +71,7 @@ public class GitConfigTest extends GitPlatformTest { } // IDEA-143363 Check that remote.pushdefault (generic, without remote name) doesn't fail the config parsing procedure - public void test_remote_unspecified_section() throws Exception { + public void test_remote_unspecified_section() { createRepository(); addRemote("git@github.com:foo/bar.git"); git("config remote.pushdefault origin"); @@ -79,7 +79,7 @@ public class GitConfigTest extends GitPlatformTest { assertSingleRemoteInConfig(); } - public void test_invalid_section_with_remote_prefix_is_ignored() throws Exception { + public void test_invalid_section_with_remote_prefix_is_ignored() { createRepository(); addRemote("git@github.com:foo/bar.git"); git("config remote-cfg.newkey newval"); diff --git a/plugins/git4idea/tests/git4idea/repo/GitRepositoryReaderTest.java b/plugins/git4idea/tests/git4idea/repo/GitRepositoryReaderTest.java index 4df7dfd35778..905b9b00a3d4 100644 --- a/plugins/git4idea/tests/git4idea/repo/GitRepositoryReaderTest.java +++ b/plugins/git4idea/tests/git4idea/repo/GitRepositoryReaderTest.java @@ -76,7 +76,7 @@ public class GitRepositoryReaderTest extends GitPlatformTest { @After @Override - public void tearDown() throws Exception { + public void tearDown() { try { if (myTempDir != null) { FileUtil.delete(myTempDir); diff --git a/plugins/git4idea/tests/git4idea/tests/GitUpperDirectorySearchTest.java b/plugins/git4idea/tests/git4idea/tests/GitUpperDirectorySearchTest.java index 5eccc7d388ce..0467ae899c4b 100644 --- a/plugins/git4idea/tests/git4idea/tests/GitUpperDirectorySearchTest.java +++ b/plugins/git4idea/tests/git4idea/tests/GitUpperDirectorySearchTest.java @@ -46,7 +46,7 @@ public class GitUpperDirectorySearchTest { } @After - public void tearDown() throws Exception { + public void tearDown() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { try { myProjectFixture.tearDown(); diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java index 830944558fdd..d3f8e2cb4c2c 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTest.java @@ -32,14 +32,14 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase protected Editor myEditor; @Override - protected void afterTest() throws Exception { + protected void afterTest() { if (myEditor != null) { EditorFactory.getInstance().releaseEditor(myEditor); myEditor = null; } } - public void testCreateFromFile() throws Throwable { + public void testCreateFromFile() { List expected = new ArrayList<>(); expected.add(new FileContent("file.txt", "file.txt content")); @@ -51,7 +51,7 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase checkEquals(expected, actual); } - public void testCreateFromDirectory() throws Throwable { + public void testCreateFromDirectory() { List expected = new ArrayList<>(); expected.add(new FileContent("folder_file1", "file1 content")); expected.add(new FileContent("folder_file2", "file2 content")); @@ -65,7 +65,7 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase checkEquals(expected, actual); } - public void testCreateFromEmptyDirectory() throws Throwable { + public void testCreateFromEmptyDirectory() { List expected = new ArrayList<>(); VirtualFile file = myProjectRoot.findFileByRelativePath("folder/empty_folder"); @@ -76,7 +76,7 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase checkEquals(expected, actual); } - public void testCreateFromEmptyFile() throws Throwable { + public void testCreateFromEmptyFile() { List expected = new ArrayList<>(); VirtualFile file = myProjectRoot.findFileByRelativePath("folder/empty_file"); @@ -87,7 +87,7 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase checkEquals(expected, actual); } - public void testCreateFromFiles() throws Throwable { + public void testCreateFromFiles() { List expected = new ArrayList<>(); expected.add(new FileContent("file.txt", "file.txt content")); expected.add(new FileContent("file2", "file2 content")); @@ -106,7 +106,7 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase checkEquals(expected, actual); } - public void testCreateFromEmptyFiles() throws Throwable { + public void testCreateFromEmptyFiles() { List expected = new ArrayList<>(); VirtualFile[] files = VirtualFile.EMPTY_ARRAY; @@ -116,7 +116,7 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase checkEquals(expected, actual); } - public void testCreateFromEditor() throws Throwable { + public void testCreateFromEditor() { VirtualFile file = myProjectRoot.findFileByRelativePath("file.txt"); assertNotNull(file); @@ -134,7 +134,7 @@ public class GithubCreateGistContentTest extends GithubCreateGistContentTestBase checkEquals(expected, actual); } - public void testCreateFromEditorWithoutFile() throws Throwable { + public void testCreateFromEditorWithoutFile() { VirtualFile file = myProjectRoot.findFileByRelativePath("file.txt"); assertNotNull(file); diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTestBase.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTestBase.java index d801da88fda4..7c73dc631b9a 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTestBase.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistContentTestBase.java @@ -28,7 +28,7 @@ import java.util.List; public abstract class GithubCreateGistContentTestBase extends GithubTest { @Override - protected void beforeTest() throws Exception { + protected void beforeTest() { createProjectFiles(); } diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTest.java index 6a9112536d09..fb09b6161db1 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTest.java @@ -31,7 +31,7 @@ import java.util.List; public class GithubCreateGistTest extends GithubCreateGistTestBase { private final ProgressIndicator myIndicator = DumbProgressIndicator.INSTANCE; - public void testSimple() throws Throwable { + public void testSimple() { List expected = createContent(); String url = GithubCreateGistAction.createGist(myProject, getAuthDataHolder(), myIndicator, expected, true, GIST_DESCRIPTION, null); @@ -45,7 +45,7 @@ public class GithubCreateGistTest extends GithubCreateGistTestBase { checkGistContent(expected); } - public void testAnonymous() throws Throwable { + public void testAnonymous() { List expected = createContent(); String url = GithubCreateGistAction @@ -65,7 +65,7 @@ public class GithubCreateGistTest extends GithubCreateGistTestBase { GIST = null; } - public void testUnusedFilenameField() throws Throwable { + public void testUnusedFilenameField() { List expected = createContent(); String url = @@ -80,7 +80,7 @@ public class GithubCreateGistTest extends GithubCreateGistTestBase { checkGistContent(expected); } - public void testUsedFilenameField() throws Throwable { + public void testUsedFilenameField() { List content = Collections.singletonList(new FileContent("file.txt", "file.txt content")); List expected = Collections.singletonList(new FileContent("filename", "file.txt content")); @@ -96,7 +96,7 @@ public class GithubCreateGistTest extends GithubCreateGistTestBase { checkGistContent(expected); } - public void testPublic() throws Throwable { + public void testPublic() { List expected = createContent(); String url = GithubCreateGistAction.createGist(myProject, getAuthDataHolder(), myIndicator, expected, false, GIST_DESCRIPTION, null); @@ -110,7 +110,7 @@ public class GithubCreateGistTest extends GithubCreateGistTestBase { checkGistContent(expected); } - public void testEmpty() throws Throwable { + public void testEmpty() { List expected = Collections.emptyList(); String url = GithubCreateGistAction.createGist(myProject, getAuthDataHolder(), myIndicator, expected, true, GIST_DESCRIPTION, null); diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java index b44833ee62f6..d310ccdee381 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreateGistTestBase.java @@ -42,7 +42,7 @@ public abstract class GithubCreateGistTestBase extends GithubTest { protected String GIST_DESCRIPTION; @Override - protected void beforeTest() throws Exception { + protected void beforeTest() { long time = Clock.getTime(); GIST_DESCRIPTION = getTestName(false) + "_" + DateFormatUtil.formatDate(time); } diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreatePullRequestTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreatePullRequestTest.java index 354dddb866a0..b70f67b93ef1 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreatePullRequestTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreatePullRequestTest.java @@ -21,7 +21,7 @@ import com.intellij.notification.NotificationType; * @author Aleksey Pivovarov */ public class GithubCreatePullRequestTest extends GithubCreatePullRequestTestBase { - public void testSimple() throws Exception { + public void testSimple() { registerDefaultCreatePullRequestDialogHandler("master", myLogin1); GithubCreatePullRequestAction.createPullRequest(myProject, myProjectRoot); @@ -31,7 +31,7 @@ public class GithubCreatePullRequestTest extends GithubCreatePullRequestTestBase checkLastCommitPushed(); } - public void testParent() throws Exception { + public void testParent() { registerDefaultCreatePullRequestDialogHandler("file2", myLogin2); addRemote(myLogin2); diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubCreatePullRequestTestBase.java b/plugins/github/test/org/jetbrains/plugins/github/GithubCreatePullRequestTestBase.java index 51d4c610ef69..e44247a033fb 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubCreatePullRequestTestBase.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubCreatePullRequestTestBase.java @@ -15,7 +15,6 @@ */ package org.jetbrains.plugins.github; -import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.util.Clock; import com.intellij.testFramework.VfsTestUtil; @@ -45,7 +44,7 @@ public abstract class GithubCreatePullRequestTestBase extends GithubTest { protected String BRANCH_NAME; @Override - protected void beforeTest() throws Exception { + protected void beforeTest() { Random rnd = new Random(); long time = Clock.getTime(); BRANCH_NAME = "branch_" + getTestName(false) + "_" + DateFormatUtil.formatDate(time).replace('/', '-') + "_" + rnd.nextLong(); @@ -60,7 +59,7 @@ public abstract class GithubCreatePullRequestTestBase extends GithubTest { } @Override - protected void afterTest() throws Exception { + protected void afterTest() { deleteRemoteBranch(); } diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubRequestQueringTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubRequestQueringTest.java index a85fee484d2c..d19c3c63a965 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubRequestQueringTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubRequestQueringTest.java @@ -32,7 +32,7 @@ import static org.junit.Assume.assumeNotNull; public class GithubRequestQueringTest extends GithubTest { @Override - protected void beforeTest() throws Exception { + protected void beforeTest() { assumeNotNull(myLogin2); } diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTest.java index 785eda66b95e..b994c99388c7 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTest.java @@ -35,7 +35,7 @@ public class GithubShareProjectTest extends GithubShareProjectTestBase { checkLastCommitPushed(); } - public void testGithubAlreadyExists() throws Throwable { + public void testGithubAlreadyExists() { final boolean[] dialogShown = new boolean[1]; TestDialog oldTestDialog = Messages.setTestDialog(new TestDialog() { @Override diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTestBase.java b/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTestBase.java index 8347de4d452c..9d4cc40660e7 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTestBase.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubShareProjectTestBase.java @@ -37,7 +37,7 @@ public abstract class GithubShareProjectTestBase extends GithubTest { protected String PROJECT_NAME; @Override - protected void beforeTest() throws Exception { + protected void beforeTest() { Random rnd = new Random(); long time = Clock.getTime(); PROJECT_NAME = "new_project_from_" + getTestName(false) + "_" + DateFormatUtil.formatDate(time).replace('/', '-') + "_" + rnd.nextLong(); diff --git a/plugins/github/test/org/jetbrains/plugins/github/GithubUrlUtilTest.java b/plugins/github/test/org/jetbrains/plugins/github/GithubUrlUtilTest.java index fb8de40a4e86..b737f1e92e07 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/GithubUrlUtilTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/GithubUrlUtilTest.java @@ -46,7 +46,7 @@ public class GithubUrlUtilTest extends TestCase { } } - public void testRemoveTrailingSlash() throws Throwable { + public void testRemoveTrailingSlash() { TestCase tests = new TestCase<>(); tests.add("http://github.com/", "http://github.com"); @@ -58,7 +58,7 @@ public class GithubUrlUtilTest extends TestCase { runTestCase(tests, in -> removeTrailingSlash(in)); } - public void testRemoveProtocolPrefix() throws Throwable { + public void testRemoveProtocolPrefix() { TestCase tests = new TestCase<>(); tests.add("github.com/user/repo/", "github.com/user/repo/"); @@ -80,7 +80,7 @@ public class GithubUrlUtilTest extends TestCase { runTestCase(tests, in -> removeProtocolPrefix(in)); } - public void testIsGithubUrl1() throws Throwable { + public void testIsGithubUrl1() { TestCase tests = new TestCase<>(); tests.add("http://github.com/user/repo", true); @@ -109,7 +109,7 @@ public class GithubUrlUtilTest extends TestCase { runTestCase(tests, in -> isGithubUrl(in, "http://GitHub.com")); } - public void testIsGithubUrl2() throws Throwable { + public void testIsGithubUrl2() { TestCase tests = new TestCase<>(); tests.add("http://git.code.example.co.jp/user/repo", true); @@ -126,7 +126,7 @@ public class GithubUrlUtilTest extends TestCase { runTestCase(tests, in -> isGithubUrl(in, "git.code.example.co.jp/api")); } - public void testGetApiUrlWithoutProtocol() throws Throwable { + public void testGetApiUrlWithoutProtocol() { TestCase tests = new TestCase<>(); tests.add("github.com", "api.github.com"); @@ -143,7 +143,7 @@ public class GithubUrlUtilTest extends TestCase { runTestCase(tests, in -> getApiUrlWithoutProtocol(in)); } - public void testGetUserAndRepositoryFromRemoteUrl() throws Throwable { + public void testGetUserAndRepositoryFromRemoteUrl() { TestCase tests = new TestCase<>(); tests.add("http://github.com/username/reponame/", new GithubFullPath("username", "reponame")); @@ -168,7 +168,7 @@ public class GithubUrlUtilTest extends TestCase { runTestCase(tests, in -> getUserAndRepositoryFromRemoteUrl(in)); } - public void testMakeGithubRepoFromRemoteUrl() throws Throwable { + public void testMakeGithubRepoFromRemoteUrl() { TestCase tests = new TestCase<>(); tests.add("http://github.com/username/reponame/", "https://github.com/username/reponame"); @@ -194,7 +194,7 @@ public class GithubUrlUtilTest extends TestCase { runTestCase(tests, in -> makeGithubRepoUrlFromRemoteUrl(in, "https://github.com")); } - public void testGetHostFromUrl() throws Throwable { + public void testGetHostFromUrl() { TestCase tests = new TestCase<>(); tests.add("github.com", "github.com"); @@ -221,7 +221,7 @@ public class GithubUrlUtilTest extends TestCase { runTestCase(tests, in -> getHostFromUrl(in)); } - public void testGetApiUrl() throws Throwable { + public void testGetApiUrl() { TestCase tests = new TestCase<>(); tests.add("github.com", "https://api.github.com"); diff --git a/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java b/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java index 5f807cf6ded0..36f0ba516922 100644 --- a/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java +++ b/plugins/github/test/org/jetbrains/plugins/github/test/GithubTest.java @@ -201,7 +201,7 @@ public abstract class GithubTest extends GitPlatformTest { } } - protected void beforeTest() throws Exception { + protected void beforeTest() { } protected void afterTest() throws Exception { diff --git a/plugins/google-app-engine/testSource/com/intellij/appengine/highlighting/AppEngineDescriptorHighlightingTest.java b/plugins/google-app-engine/testSource/com/intellij/appengine/highlighting/AppEngineDescriptorHighlightingTest.java index f9b8bcf9fd83..bd8416134d60 100644 --- a/plugins/google-app-engine/testSource/com/intellij/appengine/highlighting/AppEngineDescriptorHighlightingTest.java +++ b/plugins/google-app-engine/testSource/com/intellij/appengine/highlighting/AppEngineDescriptorHighlightingTest.java @@ -24,17 +24,17 @@ import com.intellij.xml.util.CheckXmlFileWithXercesValidatorInspection; */ @TestDataPath("$CONTENT_ROOT/testData/highlighting/descriptor/") public class AppEngineDescriptorHighlightingTest extends AppEngineCodeInsightTestCase { - public void testAppEngineWeb() throws Exception { + public void testAppEngineWeb() { myCodeInsightFixture.configureByFile("appengine-web.xml"); checkXmlHighlighting(); } - public void testJdoConfig() throws Exception { + public void testJdoConfig() { myCodeInsightFixture.configureByFile("jdoconfig.xml"); checkXmlHighlighting(); } - public void testApplication() throws Exception { + public void testApplication() { myCodeInsightFixture.configureByFile("appengine-application.xml"); checkXmlHighlighting(); } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/codeInsight/actions/AddGradleDslPluginActionTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/codeInsight/actions/AddGradleDslPluginActionTest.java index 7cb1ec16930f..bf46684a8a62 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/codeInsight/actions/AddGradleDslPluginActionTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/codeInsight/actions/AddGradleDslPluginActionTest.java @@ -28,11 +28,11 @@ import java.io.File; */ public class AddGradleDslPluginActionTest extends LightPlatformCodeInsightFixtureTestCase { - public void testApplyPlugin() throws Exception { + public void testApplyPlugin() { doTest("testApplyPlugin.gradle", "java"); } - public void testApplyPluginInsideClosure() throws Exception { + public void testApplyPluginInsideClosure() { myFixture.configureByFile("testApplyPluginInsideClosure.gradle"); doTest("testApplyPluginInsideClosure.gradle", "java"); } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/codeInsight/actions/MvnDependencyPasteTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/codeInsight/actions/MvnDependencyPasteTest.java index 5726853ad7fd..6aac6f9f88b2 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/codeInsight/actions/MvnDependencyPasteTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/codeInsight/actions/MvnDependencyPasteTest.java @@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable; public class MvnDependencyPasteTest extends LightCodeInsightTestCase { - public void testPastedGradleDependency() throws Exception { + public void testPastedGradleDependency() { configureFromFileText("pom.xml", getDependency("group", "artifact", "1.0", "runtime", null)); selectWholeFile(); performCut(); @@ -38,7 +38,7 @@ public class MvnDependencyPasteTest extends LightCodeInsightTestCase { "}"); } - public void testDependencyWithClassifier() throws Exception { + public void testDependencyWithClassifier() { configureFromFileText("pom.xml", getDependency("group", "artifact", "1.0", "runtime", "jdk14")); selectWholeFile(); performCut(); @@ -50,7 +50,7 @@ public class MvnDependencyPasteTest extends LightCodeInsightTestCase { "}"); } - public void test_DoNotConvertIfCoordinatesNotClear() throws Exception { + public void test_DoNotConvertIfCoordinatesNotClear() { String noArtifact = getDependency("group", null, "1.0", "runtime", null); configureFromFileText("pom.xml", noArtifact); diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/execution/GradleConsoleFilterTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/execution/GradleConsoleFilterTest.java index 2a7ece0f2744..91563ed2afc1 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/execution/GradleConsoleFilterTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/execution/GradleConsoleFilterTest.java @@ -23,7 +23,7 @@ import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase; */ public class GradleConsoleFilterTest extends CodeInsightFixtureTestCase { - public void testApplyFilter() throws Exception { + public void testApplyFilter() { doTest("Build file 'C:\\project\\build.gradle' line: 7", "C:\\project\\build.gradle", 7); doTest("Build file '/project/build.gradle' line: 7", "/project/build.gradle", 7); doTest(" build file 'C:\\project\\build.gradle': 49: unexpected token: 5 @ line 49, column 28.", "C:\\project\\build.gradle", 49); diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleClassFinderTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleClassFinderTest.java index 2ce927ad4877..182e43db85fc 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleClassFinderTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleClassFinderTest.java @@ -39,7 +39,7 @@ public class GradleClassFinderTest extends GradleImportingTestCase { */ @SuppressWarnings("MethodOverridesStaticMethodOfSuperclass") @Parameterized.Parameters(name = "with Gradle-{0}") - public static Collection data() throws Throwable { + public static Collection data() { return Arrays.asList(new Object[][]{{BASE_GRADLE_VERSION}}); } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java index 936b081ea89d..29dfc2ac8d44 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java @@ -95,7 +95,7 @@ public abstract class GradleImportingTestCase extends ExternalSystemImportingTes assumeThat(gradleVersion, versionMatcherRule.getMatcher()); new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { Sdk oldJdk = ProjectJdkTable.getInstance().findJdk(GRADLE_JDK_NAME); if (oldJdk != null) { ProjectJdkTable.getInstance().removeJdk(oldJdk); @@ -122,7 +122,7 @@ public abstract class GradleImportingTestCase extends ExternalSystemImportingTes try { new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { Sdk old = ProjectJdkTable.getInstance().findJdk(GRADLE_JDK_NAME); if (old != null) { SdkConfigurationUtil.removeSdk(old); @@ -138,7 +138,7 @@ public abstract class GradleImportingTestCase extends ExternalSystemImportingTes } @Override - protected void collectAllowedRoots(final List roots) throws IOException { + protected void collectAllowedRoots(final List roots) { roots.add(myJdkHome); roots.addAll(collectRootsInside(myJdkHome)); roots.add(PathManager.getConfigPath()); diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleMiscImportingTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleMiscImportingTest.java index 5715e892b738..c9e6efb272b2 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleMiscImportingTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleMiscImportingTest.java @@ -48,7 +48,7 @@ public class GradleMiscImportingTest extends GradleImportingTestCase { */ @SuppressWarnings("MethodOverridesStaticMethodOfSuperclass") @Parameterized.Parameters(name = "with Gradle-{0}") - public static Collection data() throws Throwable { + public static Collection data() { return Arrays.asList(new Object[][]{{BASE_GRADLE_VERSION}}); } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleProjectOpenProcessorTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleProjectOpenProcessorTest.java index af8eb7228752..7d6e1dd8f8ee 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleProjectOpenProcessorTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleProjectOpenProcessorTest.java @@ -64,7 +64,7 @@ public class GradleProjectOpenProcessorTest extends GradleImportingTestCase { */ @SuppressWarnings("MethodOverridesStaticMethodOfSuperclass") @Parameterized.Parameters(name = "with Gradle-{0}") - public static Collection data() throws Throwable { + public static Collection data() { return Arrays.asList(new Object[][]{{BASE_GRADLE_VERSION}}); } @@ -73,7 +73,7 @@ public class GradleProjectOpenProcessorTest extends GradleImportingTestCase { super.setUp(); new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { for (Sdk sdk : ProjectJdkTable.getInstance().getAllJdks()) { if (GRADLE_JDK_NAME.equals(sdk.getName())) continue; ProjectJdkTable.getInstance().removeJdk(sdk); @@ -88,7 +88,7 @@ public class GradleProjectOpenProcessorTest extends GradleImportingTestCase { try { new WriteAction() { @Override - protected void run(@NotNull Result result) throws Throwable { + protected void run(@NotNull Result result) { for (Sdk sdk : removedSdks) { SdkConfigurationUtil.addSdk(sdk); } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/integrations/maven/codeInsight/actions/AddGradleDslDependencyActionTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/integrations/maven/codeInsight/actions/AddGradleDslDependencyActionTest.java index 3196f9801e71..e5bfb432df42 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/integrations/maven/codeInsight/actions/AddGradleDslDependencyActionTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/integrations/maven/codeInsight/actions/AddGradleDslDependencyActionTest.java @@ -30,12 +30,12 @@ import java.io.File; */ public class AddGradleDslDependencyActionTest extends LightPlatformCodeInsightFixtureTestCase { - public void testAddMavenDependencyInEmptyFile() throws Exception { + public void testAddMavenDependencyInEmptyFile() { AddGradleDslDependencyAction.TEST_THREAD_LOCAL.set(ContainerUtil.list(new MavenId("testGroupId", "testArtifactId", "1.0"))); doTest("testAddMavenDependencyInEmptyFile.gradle"); } - public void testAddMavenDependencyIntoExistingBlock() throws Exception { + public void testAddMavenDependencyIntoExistingBlock() { AddGradleDslDependencyAction.TEST_THREAD_LOCAL.set(ContainerUtil.list(new MavenId("testGroupId", "testArtifactId", "1.0"))); doTest("testAddMavenDependencyIntoExistingBlock.gradle"); } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/execution/GradleExecutionHelperTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/execution/GradleExecutionHelperTest.java index 20bdb70a4289..72da00ca99c3 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/execution/GradleExecutionHelperTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/execution/GradleExecutionHelperTest.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertEquals; public class GradleExecutionHelperTest { @Test - public void testPasswordObfuscation() throws Exception { + public void testPasswordObfuscation() { List originalArgs = ImmutableList.of( "--configure-on-demand", "-Pandroid.injected.invoked.from.ide=true", diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/project/BaseProjectImportErrorHandlerTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/project/BaseProjectImportErrorHandlerTest.java index a8f4267572a6..c5ed8b465861 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/project/BaseProjectImportErrorHandlerTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/project/BaseProjectImportErrorHandlerTest.java @@ -33,7 +33,7 @@ public class BaseProjectImportErrorHandlerTest { private String myProjectPath; @Before - public void setUp() throws Exception { + public void setUp() { myErrorHandler = new BaseProjectImportErrorHandler(); myProjectPath = "basic"; } diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/project/GradleProjectResolverUtilTest.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/project/GradleProjectResolverUtilTest.java index f068aaf07bb1..e6f2f3ae771a 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/project/GradleProjectResolverUtilTest.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/service/project/GradleProjectResolverUtilTest.java @@ -37,7 +37,7 @@ public class GradleProjectResolverUtilTest { public static final ProjectRule myProjectRule = new ProjectRule(); @Test - public void testGetGradlePath() throws Exception { + public void testGetGradlePath() { assertNull(GradleProjectResolverUtil.getGradlePath(null)); final Module rootModule = createModuleMock("rootModule"); diff --git a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java index a0bf88732cd0..543352751b6d 100644 --- a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java +++ b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java @@ -198,7 +198,7 @@ public abstract class AbstractModelBuilderTest { } @After - public void tearDown() throws Exception { + public void tearDown() { if (testDir != null) { FileUtil.delete(testDir); } diff --git a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModelBuildScriptClasspathBuilderImplTest.java b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModelBuildScriptClasspathBuilderImplTest.java index 6baa51252d32..36a3ac63018d 100644 --- a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModelBuildScriptClasspathBuilderImplTest.java +++ b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModelBuildScriptClasspathBuilderImplTest.java @@ -42,7 +42,7 @@ public class ModelBuildScriptClasspathBuilderImplTest extends AbstractModelBuild @Test @TargetVersions("2.0+") - public void testModelBuildScriptClasspathBuilder() throws Exception { + public void testModelBuildScriptClasspathBuilder() { DomainObjectSet ideaModules = allModels.getIdeaProject().getModules(); diff --git a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImplTest.java b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImplTest.java index f4f2c37b9cb3..6a4107ee5131 100644 --- a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImplTest.java +++ b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ModuleExtendedModelBuilderImplTest.java @@ -43,7 +43,7 @@ public class ModuleExtendedModelBuilderImplTest extends AbstractModelBuilderTest } @Test - public void testGradleSourcesSetsInterpretation() throws Exception { + public void testGradleSourcesSetsInterpretation() { final int modulesSize = 9; DomainObjectSet ideaModules = allModels.getIdeaProject().getModules(); @@ -136,7 +136,7 @@ public class ModuleExtendedModelBuilderImplTest extends AbstractModelBuilderTest } @Test - public void testJavaExtendedModel() throws Exception { + public void testJavaExtendedModel() { final Map modulesMap = getModulesMap(ModuleExtendedModel.class); assertEquals(3, modulesMap.size()); diff --git a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ScalaModelBuilderImplTest.java b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ScalaModelBuilderImplTest.java index 5a2650eadefc..28b4488e0806 100644 --- a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ScalaModelBuilderImplTest.java +++ b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/ScalaModelBuilderImplTest.java @@ -41,7 +41,7 @@ public class ScalaModelBuilderImplTest extends AbstractModelBuilderTest { } @Test - public void testScalaModel() throws Exception { + public void testScalaModel() { DomainObjectSet ideaModules = allModels.getIdeaProject().getModules(); List scalaModels = ContainerUtil.mapNotNull(ideaModules, diff --git a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/WebConfigurationBuilderImplTest.java b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/WebConfigurationBuilderImplTest.java index 115bff2b6eb3..7e8347569165 100644 --- a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/WebConfigurationBuilderImplTest.java +++ b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/WebConfigurationBuilderImplTest.java @@ -41,7 +41,7 @@ public class WebConfigurationBuilderImplTest extends AbstractModelBuilderTest { } @Test - public void testDefaultWarModel() throws Exception { + public void testDefaultWarModel() { DomainObjectSet ideaModules = allModels.getIdeaProject().getModules(); List ideaModule = ContainerUtil.mapNotNull(ideaModules, diff --git a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/internal/ExtraModelBuilderTest.java b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/internal/ExtraModelBuilderTest.java index 40b215962873..b4371af27e03 100644 --- a/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/internal/ExtraModelBuilderTest.java +++ b/plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/internal/ExtraModelBuilderTest.java @@ -33,7 +33,7 @@ import static org.junit.Assert.assertTrue; public class ExtraModelBuilderTest { @Test - public void testVersionMatching() throws Exception { + public void testVersionMatching() { assertTrue(isMatching("1.8", TestModelBuilderService_v_1_8.class)); assertTrue(isMatching("1.8-rc-1", TestModelBuilderService_v_1_8.class)); diff --git a/plugins/groovy/structuralsearch-groovy/testSrc/com/intellij/structuralsearch/GroovyStructuralSearchTest.java b/plugins/groovy/structuralsearch-groovy/testSrc/com/intellij/structuralsearch/GroovyStructuralSearchTest.java index b4c8d39bc62c..0a523b775001 100644 --- a/plugins/groovy/structuralsearch-groovy/testSrc/com/intellij/structuralsearch/GroovyStructuralSearchTest.java +++ b/plugins/groovy/structuralsearch-groovy/testSrc/com/intellij/structuralsearch/GroovyStructuralSearchTest.java @@ -23,7 +23,7 @@ import org.jetbrains.plugins.groovy.GroovyFileType; */ public class GroovyStructuralSearchTest extends StructuralSearchTestCase { - public void test1() throws Exception { + public void test1() { String s = "def int x = 0;\n" + "def y = 0;\n" + "int z = 10;\n" + @@ -38,7 +38,7 @@ public class GroovyStructuralSearchTest extends StructuralSearchTestCase { doTest(s, "int $x$ = $value$", 2, 2); } - public void test2() throws Exception { + public void test2() { String s = "def void f(int x) {}\n" + "def f(int x) {\n" + " System.out.println(\"hello\");\n" + @@ -66,7 +66,7 @@ public class GroovyStructuralSearchTest extends StructuralSearchTestCase { doTest(s, "def '_T1('_T2*) {'_T3*}", 6, 1); } - public void test3() throws Exception { + public void test3() { String s = "public class C implements I1, I2 {\n" + " void f() {\n" + " def a = 1;\n" + @@ -85,7 +85,7 @@ public class GroovyStructuralSearchTest extends StructuralSearchTestCase { doTest(s, "def a = 1\n def b = 2", 1, 0); } - public void test4() throws Exception { + public void test4() { String s = "for (a in list) {\n" + " println(\"hello1\");\n" + " println(\"hello2\");\n" + diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyGotoTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyGotoTest.java index 119560560ed8..b89d82cbc177 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyGotoTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyGotoTest.java @@ -48,27 +48,27 @@ public class GroovyGotoTest extends LightCodeInsightFixtureTestCase { assertTrue(verifier.value(target)); } - public void testNewExpression() throws Throwable { + public void testNewExpression() { doTest(element -> element instanceof GrMethod && ((GrMethod)element).isConstructor() && ((GrMethod)element).getParameters().length == 0); } - public void testNewExpressionWithNamedArgs() throws Throwable { + public void testNewExpressionWithNamedArgs() { doTest(element -> element instanceof PsiClass); } - public void testNewExpressionWithMapParameter() throws Throwable { + public void testNewExpressionWithMapParameter() { doTest(element -> element instanceof GrMethod && ((GrMethod)element).isConstructor() && ((GrMethod)element).getParameters().length == 1); } - public void testNewExpressionWithAnonymousClass() throws Throwable { + public void testNewExpressionWithAnonymousClass() { doTest(element -> element instanceof GrMethod && ((GrMethod)element).isConstructor() && ((GrMethod)element).getParameters().length == 2); } - public void testGroovyDocParameter1() throws Throwable { + public void testGroovyDocParameter1() { doTest(element -> element instanceof GrParameter && ((GrParameter)element).getName().equals("x")); } - public void testGroovyDocParameter2() throws Throwable { + public void testGroovyDocParameter2() { doTest(element -> element instanceof GrParameter && ((GrParameter)element).getName().equals("x")); } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/ReferenceCompletionTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/ReferenceCompletionTest.java index 30eaebab80ef..d25cb9800ac7 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/ReferenceCompletionTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/ReferenceCompletionTest.java @@ -23,31 +23,31 @@ import org.jetbrains.plugins.groovy.util.TestUtils; */ public class ReferenceCompletionTest extends CompletionTestBase { - public void testEscapedReference() throws Throwable { doTest(); } - public void testGrvy1021() throws Throwable { doTest(); } - public void testGrvy1021a() throws Throwable { doTest(); } - public void testGrvy1021b() throws Throwable { doTest(); } - public void testGrvy1156() throws Throwable { doTest(); } - public void testGrvy117() throws Throwable { doTest(); } - public void testGrvy1272() throws Throwable { doTest(); } - public void testGRVY1316() throws Throwable { doTest(); } - public void testGrvy194() throws Throwable { doTest(); } - public void testGrvy194_1() throws Throwable { doTest(); } - public void testGRVY223() throws Throwable { doTest(); } - public void testGrvy487() throws Throwable { doTest(); } - public void testGrvy491() throws Throwable { doTest(); } - public void testGrvy76() throws Throwable { doTest(); } - public void testGrvy959() throws Throwable { doTest(); } - public void testOnDemand() throws Throwable { doTest(); } - public void testStaticMethod() throws Throwable { doTest(); } - public void testThrowVariable() throws Throwable { doTest(); } - public void testTupleCompl1() throws Throwable { doTest(); } - public void testTupleLongListAssign() throws Throwable { doTest(); } - public void testTupleObjCompl() throws Throwable { doTest(); } - public void testTupleShortListAss() throws Throwable { doTest(); } - public void testTupleTypedCompl() throws Throwable { doTest(); } - public void testType() throws Throwable { doTest(); } - public void testUntyped() throws Throwable { doTest(); } + public void testEscapedReference() { doTest(); } + public void testGrvy1021() { doTest(); } + public void testGrvy1021a() { doTest(); } + public void testGrvy1021b() { doTest(); } + public void testGrvy1156() { doTest(); } + public void testGrvy117() { doTest(); } + public void testGrvy1272() { doTest(); } + public void testGRVY1316() { doTest(); } + public void testGrvy194() { doTest(); } + public void testGrvy194_1() { doTest(); } + public void testGRVY223() { doTest(); } + public void testGrvy487() { doTest(); } + public void testGrvy491() { doTest(); } + public void testGrvy76() { doTest(); } + public void testGrvy959() { doTest(); } + public void testOnDemand() { doTest(); } + public void testStaticMethod() { doTest(); } + public void testThrowVariable() { doTest(); } + public void testTupleCompl1() { doTest(); } + public void testTupleLongListAssign() { doTest(); } + public void testTupleObjCompl() { doTest(); } + public void testTupleShortListAss() { doTest(); } + public void testTupleTypedCompl() { doTest(); } + public void testType() { doTest(); } + public void testUntyped() { doTest(); } @Override protected String getBasePath() { diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/inspections/secondUnsafeCall/SecondUnsafeCallTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/inspections/secondUnsafeCall/SecondUnsafeCallTest.java index 6753a9e093e2..1bd8d0bb5ce1 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/inspections/secondUnsafeCall/SecondUnsafeCallTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/inspections/secondUnsafeCall/SecondUnsafeCallTest.java @@ -29,7 +29,7 @@ public class SecondUnsafeCallTest extends LightCodeInsightFixtureTestCase { return TestUtils.getTestDataPath() + "groovy/inspections/secondUnsafeCall"; } - public void doTest() throws Exception { + public void doTest() { final List data = TestUtils.readInput(getTestDataPath() + "/" + getTestName(true) + ".test"); myFixture.configureByText("a.groovy", data.get(0)); @@ -40,10 +40,10 @@ public class SecondUnsafeCallTest extends LightCodeInsightFixtureTestCase { myFixture.checkResult(data.get(1)); } - public void test4Calls() throws Throwable { doTest(); } - public void testMethodCall() throws Throwable { doTest(); } - public void testMethodsCalls() throws Throwable { doTest(); } - public void testSecondUnsafeCall1() throws Throwable { doTest(); } - public void testVarInit() throws Throwable { doTest(); } + public void test4Calls() { doTest(); } + public void testMethodCall() { doTest(); } + public void testMethodsCalls() { doTest(); } + public void testSecondUnsafeCall1() { doTest(); } + public void testVarInit() { doTest(); } } \ No newline at end of file diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/removeParenthesis/RemoveUnnecessaryParenthesisTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/removeParenthesis/RemoveUnnecessaryParenthesisTest.java index a9e601284783..fdba206a0c12 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/removeParenthesis/RemoveUnnecessaryParenthesisTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/removeParenthesis/RemoveUnnecessaryParenthesisTest.java @@ -26,7 +26,7 @@ public class RemoveUnnecessaryParenthesisTest extends LightCodeInsightFixtureTes return TestUtils.getTestDataPath() + "intentions/removeParenth/"; } - public void testRemoveUnnecessaryParenthesis() throws Throwable { + public void testRemoveUnnecessaryParenthesis() { doTest(); } @@ -37,7 +37,7 @@ public class RemoveUnnecessaryParenthesisTest extends LightCodeInsightFixtureTes myFixture.checkResultByFile(getTestName(false) + "_after.groovy"); } - public void testNothingInsideClosure() throws Throwable { + public void testNothingInsideClosure() { myFixture.configureByFile(getTestName(false) + ".groovy"); assertEmpty(myFixture.filterAvailableIntentions("Remove Unnecessary Parentheses")); } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/strings/RemoveUnnecessaryBracesInGStringTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/strings/RemoveUnnecessaryBracesInGStringTest.java index b3aa9eade01c..be11b45f825e 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/strings/RemoveUnnecessaryBracesInGStringTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/intentions/strings/RemoveUnnecessaryBracesInGStringTest.java @@ -28,15 +28,15 @@ public class RemoveUnnecessaryBracesInGStringTest extends GrIntentionTestCase { return TestUtils.getTestDataPath() + "intentions/removeUnnecessaryBraces/"; } - public void testIntention() throws Exception { + public void testIntention() { doTest("Remove unnecessary braces in GString", true); } - public void testRefWithQualifier() throws Exception { + public void testRefWithQualifier() { doTest("Remove unnecessary braces in GString", true); } - public void testNoIntention() throws Exception { + public void testNoIntention() { doTest("Remove unnecessary braces in GString", false); } } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyLineMarkerTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyLineMarkerTest.java index 792b195c4d41..e2b7362fa4be 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyLineMarkerTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyLineMarkerTest.java @@ -34,36 +34,36 @@ public class GroovyLineMarkerTest extends LightCodeInsightFixtureTestCase { return TestUtils.getTestDataPath() + "lineMarker/"; } - public void testInterface() throws Throwable { + public void testInterface() { doSimpleTest(3);} - public void testGStringMethodName() throws Throwable { + public void testGStringMethodName() { doSimpleTest(3);} - public void testStringMethodName() throws Throwable { + public void testStringMethodName() { doSimpleTest(3);} - public void testAllGStringMethodName() throws Throwable { + public void testAllGStringMethodName() { doSimpleTest(3);} - public void testJavaToGroovy() throws Throwable { + public void testJavaToGroovy() { myFixture.configureByFiles(getTestName(false)+".groovy", getTestName(false)+".java"); doTest(1); } - public void testGroovyToJava() throws Throwable { + public void testGroovyToJava() { myFixture.configureByFiles(getTestName(false)+".groovy", getTestName(false)+".java"); doTest(2); } - public void testJavaToGroovy2() throws Throwable { + public void testJavaToGroovy2() { myFixture.configureByFiles("JavaToGroovy.java", "JavaToGroovy.groovy"); doTest(2); } - public void testGroovyToJava2() throws Throwable { + public void testGroovyToJava2() { myFixture.configureByFiles("GroovyToJava.java", "GroovyToJava.groovy"); doTest(1); } - private void doSimpleTest(int count) throws Throwable{ + private void doSimpleTest(int count) { myFixture.configureByFile(getTestName(false)+".groovy"); doTest(count); } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/actions/updown/GroovyMoveStatementTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/actions/updown/GroovyMoveStatementTest.java index 84d03bd8f74d..70b792fd24fb 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/actions/updown/GroovyMoveStatementTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/actions/updown/GroovyMoveStatementTest.java @@ -32,13 +32,13 @@ public class GroovyMoveStatementTest extends GroovyEditorActionTestBase { return TestUtils.getTestDataPath() + "groovy/actions/moveStatement/"; } - public void testClazz2() throws Throwable { bothTest(); } + public void testClazz2() { bothTest(); } - public void testClos2() throws Throwable { bothTest(); } + public void testClos2() { bothTest(); } - public void testMeth1() throws Throwable { bothTest(); } + public void testMeth1() { bothTest(); } - public void testMeth2() throws Throwable { + public void testMeth2() { final List data = TestUtils.readInput(getTestDataPath() + getTestName(true) + ".test"); myFixture.configureByText(GroovyFileType.GROOVY_FILE_TYPE, data.get(0)); @@ -46,63 +46,63 @@ public class GroovyMoveStatementTest extends GroovyEditorActionTestBase { myFixture.checkResult(data.get(1)); } - public void testMeth3() throws Throwable { bothTest(); } - public void testMeth4() throws Throwable { bothTest(); } + public void testMeth3() { bothTest(); } + public void testMeth4() { bothTest(); } - public void testIfst() throws Throwable { bothTest(); } - public void testIfst2() throws Throwable { bothTest(); } + public void testIfst() { bothTest(); } + public void testIfst2() { bothTest(); } - public void testSimple1() throws Throwable { bothTest(); } - public void testSimple2() throws Throwable { bothTest(); } + public void testSimple1() { bothTest(); } + public void testSimple2() { bothTest(); } - public void testTryst1() throws Throwable { bothTest(); } - public void testTryst2() throws Throwable { bothTest(); } + public void testTryst1() { bothTest(); } + public void testTryst2() { bothTest(); } - public void testStatementOutsideClosure() throws Throwable { bothTest(); } - public void testVariableOutsideClosure() throws Throwable { bothTest(); } - public void testVariableOutsideClosureDown() throws Throwable { bothTest(); } - public void testStatementInsideClosure() throws Throwable { bothTest(); } + public void testStatementOutsideClosure() { bothTest(); } + public void testVariableOutsideClosure() { bothTest(); } + public void testVariableOutsideClosureDown() { bothTest(); } + public void testStatementInsideClosure() { bothTest(); } - public void testMoveGroovydocWithMethod() throws Throwable { bothTest(); } - public void testLeaveGroovydocWithMethod() throws Throwable { bothTest(); } - public void testMoveMethodWithGroovydoc() throws Throwable { bothTest(); } - public void testMoveGroovyDocWithField() throws Throwable { bothTest(); } + public void testMoveGroovydocWithMethod() { bothTest(); } + public void testLeaveGroovydocWithMethod() { bothTest(); } + public void testMoveMethodWithGroovydoc() { bothTest(); } + public void testMoveGroovyDocWithField() { bothTest(); } - public void testMoveSecondFieldUp() throws Throwable { bothTest(); } - public void testMoveFirstFieldDown() throws Throwable { bothTest(); } + public void testMoveSecondFieldUp() { bothTest(); } + public void testMoveFirstFieldDown() { bothTest(); } - public void testVariableOverMethodInScript() throws Throwable { bothTest(); } - public void testVariableOverClassInScript() throws Throwable { bothTest(); } + public void testVariableOverMethodInScript() { bothTest(); } + public void testVariableOverClassInScript() { bothTest(); } - public void testUpFromLastOffset() throws Throwable { bothTest(); } + public void testUpFromLastOffset() { bothTest(); } - public void testClosureWithPrequel() throws Throwable { bothTest(); } + public void testClosureWithPrequel() { bothTest(); } - public void testMultiLineVariable() throws Throwable { bothTest(); } - public void testClosureVariableByRBrace() throws Throwable { bothTest(); } + public void testMultiLineVariable() { bothTest(); } + public void testClosureVariableByRBrace() { bothTest(); } - public void testInsideMultilineString() throws Throwable { bothTest(); } - public void testAroundMultilineString() throws Throwable { bothTest(); } - public void testAroundMultilineString2() throws Throwable { bothTest(); } + public void testInsideMultilineString() { bothTest(); } + public void testAroundMultilineString() { bothTest(); } + public void testAroundMultilineString2() { bothTest(); } - public void testInSwitchCaseUp1() throws Throwable { bothTest(); } - public void testInSwitchCaseUp2() throws Throwable { bothTest(); } - public void testInSwitchCaseUp3() throws Throwable { bothTest(); } - public void testInSwitchCaseUp4() throws Throwable { bothTest(); } - public void testInSwitchCaseUp5() throws Throwable { bothTest(); } + public void testInSwitchCaseUp1() { bothTest(); } + public void testInSwitchCaseUp2() { bothTest(); } + public void testInSwitchCaseUp3() { bothTest(); } + public void testInSwitchCaseUp4() { bothTest(); } + public void testInSwitchCaseUp5() { bothTest(); } - public void testTwoStatements() throws Throwable { bothTest(); } + public void testTwoStatements() { bothTest(); } - public void testStatementToEmptySpace() throws Throwable { bothTest(); } - public void testStatementToEmptySpace2() throws Throwable { bothTest(); } - public void testStatementToEmptySpace3() throws Throwable { bothTest(); } + public void testStatementToEmptySpace() { bothTest(); } + public void testStatementToEmptySpace2() { bothTest(); } + public void testStatementToEmptySpace3() { bothTest(); } - public void testStatementsWithSemicolons() throws Throwable { bothTest(); } - public void testStatementsWithComments() throws Throwable { bothTest(); } - public void testMoveIntoEmptyLine() throws Throwable { bothTest(); } - public void testMoveIntoEmptyLine2() throws Throwable { bothTest(); } + public void testStatementsWithSemicolons() { bothTest(); } + public void testStatementsWithComments() { bothTest(); } + public void testMoveIntoEmptyLine() { bothTest(); } + public void testMoveIntoEmptyLine2() { bothTest(); } - public void testClassesWithFields() throws Throwable { bothTest(); } + public void testClassesWithFields() { bothTest(); } private void bothTest() { final List data = TestUtils.readInput(getTestDataPath() + getTestName(true) + ".test"); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/dynamic/DynamicTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/dynamic/DynamicTest.java index 511751080859..5d83ea2505b7 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/dynamic/DynamicTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/dynamic/DynamicTest.java @@ -42,7 +42,7 @@ public class DynamicTest extends JavaCodeInsightFixtureTestCase { return TestUtils.getTestDataPath() + "dynamic/"; } - public void testMethod() throws Throwable { + public void testMethod() { final GrReferenceExpression referenceExpression = doDynamicFix(); final PsiType[] psiTypes = PsiUtil.getArgumentTypes(referenceExpression, false); @@ -60,12 +60,12 @@ public class DynamicTest extends JavaCodeInsightFixtureTestCase { return classElement; } - public void testProperty() throws Throwable { + public void testProperty() { final String name = doDynamicFix().getReferenceName(); assert getDClassElement().getPropertyByName(name) != null; } - private GrReferenceExpression doDynamicFix() throws Throwable { + private GrReferenceExpression doDynamicFix() { myFixture.enableInspections(new GrUnresolvedAccessInspection()); final List actions = myFixture.getAvailableIntentions(getTestName(false) + ".groovy"); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/gotosuper/GroovyGoToSuperTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/gotosuper/GroovyGoToSuperTest.java index f31e1853818c..db8c6f646b57 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/gotosuper/GroovyGoToSuperTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/gotosuper/GroovyGoToSuperTest.java @@ -34,11 +34,11 @@ public class GroovyGoToSuperTest extends LightCodeInsightFixtureTestCase { return TestUtils.getTestDataPath() + "groovy/gotoSuper/"; } - public void testGts1() throws Throwable { doTest(); } - public void testGts2() throws Throwable { doTest(); } - public void testGts3() throws Throwable { doTest(); } + public void testGts1() { doTest(); } + public void testGts2() { doTest(); } + public void testGts3() { doTest(); } - private void doTest() throws Throwable { + private void doTest() { final List data = TestUtils.readInput(getTestDataPath() + getTestName(true) + ".test"); myFixture.configureByText(GroovyFileType.GROOVY_FILE_TYPE, data.get(0)); final CodeInsightActionHandler handler = CodeInsightActions.GOTO_SUPER.forLanguage(GroovyLanguage.INSTANCE); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/AllSuperMethodsTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/AllSuperMethodsTest.java index 80ee74772afc..2ab569123c99 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/AllSuperMethodsTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/AllSuperMethodsTest.java @@ -9,14 +9,14 @@ public class AllSuperMethodsTest extends OverridingTester { return super.getBasePath() + "allSuperMethods"; } - public void testExtendsAndImplements() throws Throwable { doTest(); } - public void testExtendsClass() throws Throwable { doTest(); } - public void testImplementsImplements() throws Throwable { doTest(); } - public void testImplementsInterface() throws Throwable { doTest(); } - public void testManyOverrMethods2() throws Throwable { doTest(); } - public void testManySuperMethods() throws Throwable { doTest(); } - public void testMethodWithoutParameters() throws Throwable { doTest(); } - public void testMethodWithParameters() throws Throwable { doTest(); } + public void testExtendsAndImplements() { doTest(); } + public void testExtendsClass() { doTest(); } + public void testImplementsImplements() { doTest(); } + public void testImplementsInterface() { doTest(); } + public void testManyOverrMethods2() { doTest(); } + public void testManySuperMethods() { doTest(); } + public void testMethodWithoutParameters() { doTest(); } + public void testMethodWithParameters() { doTest(); } @Override PsiMethod[] findMethod(PsiMethod method) { diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/DeepestSuperMethodsTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/DeepestSuperMethodsTest.java index d7fbf5c1ef27..41ad053db27e 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/DeepestSuperMethodsTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/DeepestSuperMethodsTest.java @@ -4,12 +4,12 @@ import com.intellij.psi.PsiMethod; public class DeepestSuperMethodsTest extends OverridingTester { - public void testManyOverridingMethods() throws Throwable { doTest(); } - public void testManyOverrMethods2() throws Throwable { doTest(); } - public void testManyOverrMethods3() throws Throwable { doTest(); } - public void testManyOverrMethods4() throws Throwable { doTest(); } - public void testOverrideClassMethod() throws Throwable { doTest(); } - public void testOverrideInterfaceMethod() throws Throwable { doTest(); } + public void testManyOverridingMethods() { doTest(); } + public void testManyOverrMethods2() { doTest(); } + public void testManyOverrMethods3() { doTest(); } + public void testManyOverrMethods4() { doTest(); } + public void testOverrideClassMethod() { doTest(); } + public void testOverrideInterfaceMethod() { doTest(); } @Override diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/OverridingTester.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/OverridingTester.java index 528945c474bf..e26f94454311 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/OverridingTester.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/overriding/OverridingTester.java @@ -15,7 +15,7 @@ public abstract class OverridingTester extends LightCodeInsightFixtureTestCase { return TestUtils.getTestDataPath() + "overriding/"; } - public void doTest() throws Throwable { + public void doTest() { final String testFile = getTestName(true) + ".test"; final List strings = TestUtils.readInput(getTestDataPath() + "/" + testFile); GroovyFileBase psiFile = (GroovyFileBase) myFixture.addFileToProject("foo.groovy", strings.get(0)); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/psi/PsiEventsTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/psi/PsiEventsTest.java index 448ad4529321..788681459000 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/psi/PsiEventsTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/psi/PsiEventsTest.java @@ -1,20 +1,20 @@ package org.jetbrains.plugins.groovy.lang.psi; -import com.intellij.testFramework.PsiTestCase; +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.command.CommandProcessor; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.util.Ref; +import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiTreeChangeAdapter; import com.intellij.psi.PsiTreeChangeEvent; -import com.intellij.psi.PsiDocumentManager; -import com.intellij.openapi.util.Ref; -import com.intellij.openapi.editor.Document; -import com.intellij.openapi.command.CommandProcessor; -import com.intellij.openapi.application.ApplicationManager; +import com.intellij.testFramework.PsiTestCase; import org.jetbrains.annotations.NotNull; /** * @author ven */ public class PsiEventsTest extends PsiTestCase { - public void testEditingInDocComment() throws Exception { + public void testEditingInDocComment() { final Ref gotIt = new Ref<>(false); getPsiManager().addPsiTreeChangeListener(new PsiTreeChangeAdapter() { @Override diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveLabelTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveLabelTest.java index f3e0bec8ac7b..5a70ddec5dd6 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveLabelTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveLabelTest.java @@ -31,21 +31,21 @@ public class ResolveLabelTest extends GroovyResolveTestCase { return TestUtils.getTestDataPath()+"resolve/label"; } - public void testLabelResolve() throws Exception { + public void testLabelResolve() { final PsiReference ref = configureByFile(getTestName(true)+"/"+getTestName(false) + ".groovy"); final PsiElement resolved = ref.resolve(); assertNotNull(resolved); assertInstanceOf(resolved, GrLabeledStatement.class); } - public void testLabelResolve2() throws Exception { + public void testLabelResolve2() { final PsiReference ref = configureByFile(getTestName(true)+"/"+getTestName(false) + ".groovy"); final PsiElement resolved = ref.resolve(); assertNotNull(resolved); assertInstanceOf(resolved, GrLabeledStatement.class); } - public void testLabelNotResolved() throws Exception { + public void testLabelNotResolved() { final PsiReference ref = configureByFile(getTestName(true)+"/"+getTestName(false) + ".groovy"); final PsiElement resolved = ref.resolve(); assertNull(resolved); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/stubs/StubsTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/stubs/StubsTest.java index 24c4f13f9419..d9af70a38e4a 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/stubs/StubsTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/stubs/StubsTest.java @@ -19,19 +19,19 @@ import java.util.List; */ public class StubsTest extends LightCodeInsightFixtureTestCase { - public void testConfig_object() throws Throwable { doTest(); } - public void testSlurper() throws Throwable { doTest(); } - public void testStub1() throws Throwable { doTest(); } - public void testStub_field1() throws Throwable { doTest(); } - public void testStub_method1() throws Throwable { doTest(); } - public void testTypeParameters() throws Throwable { doTest(); } + public void testConfig_object() { doTest(); } + public void testSlurper() { doTest(); } + public void testStub1() { doTest(); } + public void testStub_field1() { doTest(); } + public void testStub_method1() { doTest(); } + public void testTypeParameters() { doTest(); } @Override protected String getBasePath() { return TestUtils.getTestDataPath() + "groovy/stubs"; } - public void doTest() throws Exception { + public void doTest() { final List data = TestUtils.readInput(getTestDataPath() + "/" + getTestName(true) + ".test"); String fileText = data.get(0); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/GrTurnRefsToSuperTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/GrTurnRefsToSuperTest.java index f6bb75b4379d..d7866cd317df 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/GrTurnRefsToSuperTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/GrTurnRefsToSuperTest.java @@ -25,11 +25,11 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.plugins.groovy.util.TestUtils; public class GrTurnRefsToSuperTest extends MultiFileTestCase { - public void testNoReturnType() throws Exception { + public void testNoReturnType() { doTest("ClassB", "ClassB1", false); } - private void doTest(@NonNls final String className, @NonNls final String superClassName, final boolean replaceInstanceOf) throws Exception { + private void doTest(@NonNls final String className, @NonNls final String superClassName, final boolean replaceInstanceOf) { doTest((rootDir, rootAfter) -> this.performAction(className, superClassName, replaceInstanceOf), true); } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/introduceVariable/IntroduceVariableValidatorTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/introduceVariable/IntroduceVariableValidatorTest.java index 14ca3d5dc0df..c4c955c8bdbf 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/introduceVariable/IntroduceVariableValidatorTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/introduceVariable/IntroduceVariableValidatorTest.java @@ -34,7 +34,6 @@ import org.jetbrains.plugins.groovy.refactoring.introduce.GrIntroduceHandlerBase import org.jetbrains.plugins.groovy.refactoring.introduce.variable.GroovyVariableValidator; import org.jetbrains.plugins.groovy.util.TestUtils; -import java.io.IOException; import java.util.List; /** @@ -47,22 +46,22 @@ public class IntroduceVariableValidatorTest extends LightCodeInsightFixtureTestC return TestUtils.getTestDataPath() + "groovy/refactoring/introduceVariableValidator/"; } - public void testAll1() throws Throwable { doTest(); } - public void testAll2() throws Throwable { doTest(); } - public void testClass1() throws Throwable { doTest(); } - public void testClass2() throws Throwable { doTest(); } - public void testE() throws Throwable { doTest(); } - public void testFile1() throws Throwable { doTest(); } - public void testFile2() throws Throwable { doTest(); } - public void testLoop1() throws Throwable { doTest(); } - public void testLoop2() throws Throwable { doTest(); } - public void testLoop3() throws Throwable { doTest(); } - public void testSimple() throws Throwable { doTest(); } + public void testAll1() { doTest(); } + public void testAll2() { doTest(); } + public void testClass1() { doTest(); } + public void testClass2() { doTest(); } + public void testE() { doTest(); } + public void testFile1() { doTest(); } + public void testFile2() { doTest(); } + public void testLoop1() { doTest(); } + public void testLoop2() { doTest(); } + public void testLoop3() { doTest(); } + public void testSimple() { doTest(); } protected static final String ALL_MARKER = ""; protected boolean replaceAllOccurences = false; - private String processFile(String fileText) throws IncorrectOperationException, InvalidDataException, IOException { + private String processFile(String fileText) throws IncorrectOperationException, InvalidDataException { String result = ""; int startOffset = fileText.indexOf(TestUtils.BEGIN_MARKER); if (startOffset < 0) { @@ -97,7 +96,7 @@ public class IntroduceVariableValidatorTest extends LightCodeInsightFixtureTestC } - public void doTest() throws Exception { + public void doTest() { final List data = TestUtils.readInput(getTestDataPath() + getTestName(true) + ".test"); assertEquals(StringUtil.trimEnd(data.get(1), "\n"), processFile(data.get(0))); } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/move/GroovyMoveScriptTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/move/GroovyMoveScriptTest.java index 1518df513a50..25f517986a31 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/move/GroovyMoveScriptTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/move/GroovyMoveScriptTest.java @@ -16,10 +16,11 @@ package org.jetbrains.plugins.groovy.refactoring.move; -import com.intellij.openapi.application.Result; -import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.fileEditor.FileDocumentManager; -import com.intellij.openapi.vfs.*; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VfsUtilCore; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.psi.*; import com.intellij.psi.impl.source.PostprocessReformattingAspect; import com.intellij.refactoring.PackageWrapper; @@ -44,15 +45,15 @@ public class GroovyMoveScriptTest extends LightCodeInsightFixtureTestCase { return TestUtils.getTestDataPath() + "refactoring/move/moveScript/"; } - public void testMoveScriptBasic() throws Exception { + public void testMoveScriptBasic() { doTest(new String[]{"a/Script.groovy"}, "b"); } - public void testUpdateReferences() throws Exception { + public void testUpdateReferences() { doTest(new String[]{"a/Script.groovy"}, "b"); } - public void testMultiMove() throws Exception { + public void testMultiMove() { doTest(new String[]{"a/Script.groovy", "a/Script2.groovy"}, "b"); } diff --git a/plugins/hg4idea/testSrc/hg4idea/test/annotation/HgAnnotationTest.java b/plugins/hg4idea/testSrc/hg4idea/test/annotation/HgAnnotationTest.java index e4fb41f0e5b0..7286a0bb7ff5 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/annotation/HgAnnotationTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/annotation/HgAnnotationTest.java @@ -1,7 +1,6 @@ package hg4idea.test.annotation; import com.intellij.openapi.util.Clock; -import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.text.DateFormatUtil; @@ -51,7 +50,7 @@ public class HgAnnotationTest extends HgPlatformTest { super.tearDown(); } - public void testAnnotationWithVerboseOption() throws VcsException { + public void testAnnotationWithVerboseOption() { myRepository.refresh(false, true); final VirtualFile file = myRepository.findFileByRelativePath(firstCreatedFile); assert file != null; diff --git a/plugins/hg4idea/testSrc/hg4idea/test/history/HgBrowseChangesTest.java b/plugins/hg4idea/testSrc/hg4idea/test/history/HgBrowseChangesTest.java index d5537ef42272..37f240c04401 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/history/HgBrowseChangesTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/history/HgBrowseChangesTest.java @@ -21,10 +21,8 @@ import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; import hg4idea.test.HgPlatformTest; import org.zmlx.hg4idea.HgVcs; -import org.zmlx.hg4idea.execution.HgCommandException; import org.zmlx.hg4idea.provider.HgRepositoryLocation; -import java.text.ParseException; import java.util.List; import static com.intellij.openapi.vcs.Executor.cd; @@ -59,7 +57,7 @@ public class HgBrowseChangesTest extends HgPlatformTest { dateAfter = ChangeBrowserSettings.DATE_FORMAT.format(now.getTime()); } - public void testLogRevisionWithDataFilter() throws HgCommandException, ParseException, VcsException { + public void testLogRevisionWithDataFilter() throws VcsException { mySettings.USE_DATE_AFTER_FILTER = true; mySettings.USE_DATE_BEFORE_FILTER = true; mySettings.DATE_BEFORE = dateBefore; @@ -67,32 +65,32 @@ public class HgBrowseChangesTest extends HgPlatformTest { doTest(); } - public void testLogRevisionWithAfterDataFilter() throws HgCommandException, ParseException, VcsException { + public void testLogRevisionWithAfterDataFilter() throws VcsException { mySettings.USE_DATE_AFTER_FILTER = true; mySettings.DATE_AFTER = dateAfter; doTest(); } - public void testLogRevisionWithBeforeDataFilter() throws HgCommandException, ParseException, VcsException { + public void testLogRevisionWithBeforeDataFilter() throws VcsException { mySettings.USE_DATE_BEFORE_FILTER = true; mySettings.DATE_BEFORE = dateBefore; doTest(); } - public void testLogRevisionWithBeforeFilter() throws HgCommandException, ParseException, VcsException { + public void testLogRevisionWithBeforeFilter() throws VcsException { mySettings.USE_CHANGE_BEFORE_FILTER = true; mySettings.CHANGE_BEFORE = "1"; doTest(); } - public void testLogRevisionWithAfterFilter() throws HgCommandException, ParseException, VcsException { + public void testLogRevisionWithAfterFilter() throws VcsException { mySettings.USE_CHANGE_AFTER_FILTER = true; mySettings.CHANGE_AFTER = "0"; doTest(); } - public void testLogRevisionWithFilter() throws HgCommandException, ParseException, VcsException { + public void testLogRevisionWithFilter() throws VcsException { mySettings.USE_CHANGE_BEFORE_FILTER = true; mySettings.USE_CHANGE_AFTER_FILTER = true; @@ -105,7 +103,7 @@ public class HgBrowseChangesTest extends HgPlatformTest { doTest(); } - private void doTest() throws HgCommandException, VcsException { + private void doTest() throws VcsException { CommittedChangesProvider provider = myVcs.getCommittedChangesProvider(); assert provider != null; //noinspection unchecked diff --git a/plugins/hg4idea/testSrc/hg4idea/test/history/HgHistoryTest.java b/plugins/hg4idea/testSrc/hg4idea/test/history/HgHistoryTest.java index 754577337366..ed4232e36bc8 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/history/HgHistoryTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/history/HgHistoryTest.java @@ -120,7 +120,7 @@ public class HgHistoryTest extends HgPlatformTest { } } - public void testUncommittedRenamedFileHistory() throws HgCommandException { + public void testUncommittedRenamedFileHistory() { cd(myRepository); VirtualFile subDir = myRepository.findFileByRelativePath(subDirName); assert subDir != null; diff --git a/plugins/hg4idea/testSrc/hg4idea/test/merge/HgMergeProviderTest.java b/plugins/hg4idea/testSrc/hg4idea/test/merge/HgMergeProviderTest.java index d3d58d9a9be0..0109523d0890 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/merge/HgMergeProviderTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/merge/HgMergeProviderTest.java @@ -16,7 +16,6 @@ package hg4idea.test.merge; import com.intellij.openapi.util.Pair; -import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.merge.MergeData; import com.intellij.openapi.vcs.merge.MergeProvider; import com.intellij.openapi.vfs.CharsetToolkit; @@ -27,8 +26,6 @@ import hg4idea.test.HgTestUtil; import org.testng.Assert; import org.zmlx.hg4idea.HgVcs; -import java.io.IOException; - import static com.intellij.openapi.vcs.Executor.*; import static hg4idea.test.HgExecutor.*; @@ -45,7 +42,7 @@ public class HgMergeProviderTest extends HgPlatformTest { assertNotNull(myMergeProvider); } - public void testMerge2BranchesIfFileCreatedSeparatelyInBoth() throws VcsException { + public void testMerge2BranchesIfFileCreatedSeparatelyInBoth() { cd(myRepository); hg("branch branchA"); hg("commit -m 'create branchA' "); @@ -62,7 +59,7 @@ public class HgMergeProviderTest extends HgPlatformTest { verifyMergeData(myRepository.findChild(aFile), "", "default", "a"); } - public void testMerge2Branches() throws VcsException { + public void testMerge2Branches() { cd(myRepository); String aFile = "A.txt"; touch(aFile, "base"); @@ -166,7 +163,7 @@ public class HgMergeProviderTest extends HgPlatformTest { * * @return References to the files in parent and child repositories respectively. */ - private Pair prepareFileInBothRepositories() throws IOException { + private Pair prepareFileInBothRepositories() { cd(myRepository); String aFile = "A.txt"; touch(aFile, "basic"); @@ -184,8 +181,7 @@ public class HgMergeProviderTest extends HgPlatformTest { return Pair.create(parentFile, childFile); } - private void verifyMergeData(final VirtualFile file, String expectedBase, String expectedLocal, String expectedServer) - throws VcsException { + private void verifyMergeData(final VirtualFile file, String expectedBase, String expectedLocal, String expectedServer) { EdtTestUtil.runInEdtAndWait(() -> { MergeData mergeData = myMergeProvider.loadRevisions(file); assertEquals(expectedBase, mergeData.ORIGINAL); diff --git a/plugins/hg4idea/testSrc/hg4idea/test/merge/HgRevertUncommittedMergeTest.java b/plugins/hg4idea/testSrc/hg4idea/test/merge/HgRevertUncommittedMergeTest.java index 3e7677ace4e2..9b1c7d1ff276 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/merge/HgRevertUncommittedMergeTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/merge/HgRevertUncommittedMergeTest.java @@ -15,7 +15,6 @@ */ package hg4idea.test.merge; -import com.intellij.openapi.vcs.VcsException; import hg4idea.test.HgPlatformTest; import org.zmlx.hg4idea.command.HgRevertCommand; import org.zmlx.hg4idea.execution.HgCommandResult; @@ -31,7 +30,7 @@ import static hg4idea.test.HgExecutor.hgMergeWith; public class HgRevertUncommittedMergeTest extends HgPlatformTest { - public void testRevertAfterMerge() throws VcsException { + public void testRevertAfterMerge() { cd(myRepository); hg("branch branchA"); String aFile = "A.txt"; diff --git a/plugins/hg4idea/testSrc/hg4idea/test/validator/HgReferenceValidatorTest.java b/plugins/hg4idea/testSrc/hg4idea/test/validator/HgReferenceValidatorTest.java index a8e3ed9a4bfc..5e2debbdca18 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/validator/HgReferenceValidatorTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/validator/HgReferenceValidatorTest.java @@ -62,7 +62,7 @@ public class HgReferenceValidatorTest extends HgPlatformTest { @Override @After - public void tearDown() throws Exception { + public void tearDown() { UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { try { HgReferenceValidatorTest.super.tearDown(); diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTest.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTest.java index 5dfca9270200..37fdd848e0fb 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTest.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgDeleteTest.java @@ -41,7 +41,7 @@ public class HgDeleteTest extends HgSingleUserTest { } @Test - public void testDeleteNewFile() throws Exception { + public void testDeleteNewFile() { VirtualFile file = createFileInCommand("a.txt", "new file content"); deleteFileInCommand(file); Assert.assertFalse(file.exists()); @@ -73,7 +73,7 @@ public class HgDeleteTest extends HgSingleUserTest { * 3. File shouldn't be prompted for removal from repository. */ @Test - public void testNewlyAddedFileShouldNotBePromptedForRemoval() throws Exception { + public void testNewlyAddedFileShouldNotBePromptedForRemoval() { showConfirmation(VcsConfiguration.StandardConfirmation.REMOVE); final VirtualFile vf = createFileInCommand("a.txt", null); final HgMockVcsHelper helper = registerMockVcsHelper(); @@ -95,7 +95,7 @@ public class HgDeleteTest extends HgSingleUserTest { * 5. File shouldn't be prompted for removal from repository. */ @Test - public void testJustDeletedAndThenAddedFileShouldNotBePromptedForRemoval() throws Exception { + public void testJustDeletedAndThenAddedFileShouldNotBePromptedForRemoval() { VirtualFile vf = createFileInCommand("a.txt", null); myChangeListManager.commitFiles(vf); deleteFileInCommand(vf); diff --git a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTestRepository.java b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTestRepository.java index e245ae0ba0d4..30fb7e1666f3 100644 --- a/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTestRepository.java +++ b/plugins/hg4idea/testSrc/org/zmlx/hg4idea/test/HgTestRepository.java @@ -17,15 +17,14 @@ package org.zmlx.hg4idea.test; import com.intellij.execution.process.ProcessOutput; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.testFramework.vcs.AbstractVcsTestCase; import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory; import com.intellij.testFramework.fixtures.TempDirTestFixture; +import com.intellij.testFramework.vcs.AbstractVcsTestCase; import com.intellij.vcsUtil.VcsUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; /** @@ -101,7 +100,7 @@ public class HgTestRepository { * @param filename relative path to the file. * @return The created file. */ - public VirtualFile createFile(String filename) throws FileNotFoundException { + public VirtualFile createFile(String filename) { return createFile(filename, "initial content"); } @@ -111,7 +110,7 @@ public class HgTestRepository { * @param content initial content for the file. * @return The created file. */ - public VirtualFile createFile(String filename, String content) throws FileNotFoundException { + public VirtualFile createFile(String filename, String content) { return myTest.createFileInCommand(filename, content); } diff --git a/plugins/java-i18n/testSrc/com/intellij/codeInspection/CapitalizationInspectionTest.java b/plugins/java-i18n/testSrc/com/intellij/codeInspection/CapitalizationInspectionTest.java index e18557c6fb94..a70fd510ca04 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/CapitalizationInspectionTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/CapitalizationInspectionTest.java @@ -76,7 +76,7 @@ public class CapitalizationInspectionTest extends LightCodeInsightFixtureTestCas final IntentionAction action = myFixture.filterAvailableIntentions("Properly capitalize").get(0); new WriteCommandAction.Simple(getProject()) { @Override - protected void run() throws Throwable { + protected void run() { action.invoke(getProject(), myFixture.getEditor(), getFile()); } }.execute(); diff --git a/plugins/java-i18n/testSrc/com/intellij/codeInspection/CapitalizationTest.java b/plugins/java-i18n/testSrc/com/intellij/codeInspection/CapitalizationTest.java index d41e3cf64def..a36b44c9ebd0 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/CapitalizationTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/CapitalizationTest.java @@ -21,7 +21,7 @@ import org.jetbrains.annotations.Nls; public class CapitalizationTest extends TestCase { - public void testCapitalization() throws Exception { + public void testCapitalization() { assertTrue(TitleCapitalizationInspection.checkCapitalization("Fix SQL issues", Nls.Capitalization.Sentence)); assertTrue(TitleCapitalizationInspection.checkCapitalization("Fix I18n issues", Nls.Capitalization.Sentence)); assertTrue(TitleCapitalizationInspection.checkCapitalization("Fix C issues", Nls.Capitalization.Sentence)); 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 98e11fa752ac..615bd7f9c4fd 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/DuplicateStringLiteralInspectionTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/DuplicateStringLiteralInspectionTest.java @@ -38,7 +38,7 @@ public class DuplicateStringLiteralInspectionTest extends JavaCodeInsightFixture super.tearDown(); } - public void testPropertyKey() throws Exception { + public void testPropertyKey() { myInspection.IGNORE_PROPERTY_KEYS = true; try { myFixture.testHighlighting("PropertyKey.java"); diff --git a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/I18NInspectionTest.java b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/I18NInspectionTest.java index 5f92a1054f51..4f71e39ae9a4 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/I18NInspectionTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/I18NInspectionTest.java @@ -13,22 +13,22 @@ import com.intellij.testFramework.InspectionTestCase; * @author lesya */ public class I18NInspectionTest extends InspectionTestCase { - private void doTest() throws Exception { + private void doTest() { doTest(new I18nInspection()); } - private void doTest(I18nInspection tool) throws Exception { + private void doTest(I18nInspection tool) { doTest("i18n/" + getTestName(true), tool); } - public void testHardCodedStringLiteralAsParameter() throws Exception{ doTest(); } - public void testReturnTypeInheritsNonNlsAnnotationFromParent() throws Exception{ doTest(); } - public void testRecursiveInheritance() throws Exception { doTest(); } - public void testParameterInheritsNonNlsAnnotationFromSuper() throws Exception { doTest(); } - public void testLocalVariables() throws Exception { doTest(); } - public void testFields() throws Exception{ doTest(); } - public void testAnonymousClassConstructorParameter() throws Exception { doTest(); } - public void testStringBufferNonNls() throws Exception { doTest(); } - public void testEnum() throws Exception { + public void testHardCodedStringLiteralAsParameter() { doTest(); } + public void testReturnTypeInheritsNonNlsAnnotationFromParent() { doTest(); } + public void testRecursiveInheritance() { doTest(); } + public void testParameterInheritsNonNlsAnnotationFromSuper() { doTest(); } + public void testLocalVariables() { doTest(); } + public void testFields() { doTest(); } + public void testAnonymousClassConstructorParameter() { doTest(); } + public void testStringBufferNonNls() { doTest(); } + public void testEnum() { final JavaPsiFacade facade = getJavaFacade(); final LanguageLevel effectiveLanguageLevel = LanguageLevelProjectExtension.getInstance(facade.getProject()).getLanguageLevel(); LanguageLevelProjectExtension.getInstance(facade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); @@ -40,19 +40,19 @@ public class I18NInspectionTest extends InspectionTestCase { } } - public void testVarargNonNlsParameter() throws Exception { doTest(); } - public void testInitializerInAnonymousClass() throws Exception{ doTest(); } - public void testNonNlsArray() throws Exception{ doTest(); } - public void testParameterInNewAnonymousClass() throws Exception{ doTest(); } - public void testConstructorCallOfNonNlsVariable() throws Exception{ doTest(); } - public void testSwitchOnNonNlsString() throws Exception{ doTest(); } - public void testNonNlsComment() throws Exception{ + public void testVarargNonNlsParameter() { doTest(); } + public void testInitializerInAnonymousClass() { doTest(); } + public void testNonNlsArray() { doTest(); } + public void testParameterInNewAnonymousClass() { doTest(); } + public void testConstructorCallOfNonNlsVariable() { doTest(); } + public void testSwitchOnNonNlsString() { doTest(); } + public void testNonNlsComment() { I18nInspection inspection = new I18nInspection(); inspection.nonNlsCommentPattern = "MYNON-NLS"; inspection.cacheNonNlsCommentPattern(); doTest(inspection); } - public void testAnnotationArgument() throws Exception{ doTest(); } + public void testAnnotationArgument() { doTest(); } @Override protected String getTestDataPath() { 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 071a1762903a..8dd1a415f0a9 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspectionTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspectionTest.java @@ -20,24 +20,24 @@ import com.intellij.openapi.application.PluginPathManager; import com.intellij.testFramework.InspectionTestCase; public class InvalidPropertyKeyInspectionTest extends InspectionTestCase { - private void doTest() throws Exception { + private void doTest() { LocalInspectionToolWrapper tool = new LocalInspectionToolWrapper(new InvalidPropertyKeyInspection()); doTest("invalidPropertyKey/" + getTestName(true), tool, "java 1.5"); } - public void testSimple() throws Exception { + public void testSimple() { doTest(); } - public void testImplicit() throws Exception { + public void testImplicit() { doTest(); } - public void testImplicit2() throws Exception { + public void testImplicit2() { doTest(); } - public void testImplicit3() throws Exception { + public void testImplicit3() { doTest(); } diff --git a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/UnusedMessageFormatParameterInspectionTest.java b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/UnusedMessageFormatParameterInspectionTest.java index 1b1ec4e6ed87..a5623bb7e230 100644 --- a/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/UnusedMessageFormatParameterInspectionTest.java +++ b/plugins/java-i18n/testSrc/com/intellij/codeInspection/i18n/UnusedMessageFormatParameterInspectionTest.java @@ -5,23 +5,23 @@ import com.intellij.openapi.application.PluginPathManager; import com.intellij.testFramework.InspectionTestCase; public class UnusedMessageFormatParameterInspectionTest extends InspectionTestCase { - private void doTest() throws Exception { + private void doTest() { doTest("unusedParameter/" + getTestName(true), new UnusedMessageFormatParameterInspection()); } - public void testSimpleString() throws Exception { + public void testSimpleString() { doTest(); } - public void testCorruptedValue() throws Exception{ + public void testCorruptedValue() { doTest(); } - public void testWithChoiceFormat() throws Exception{ + public void testWithChoiceFormat() { doTest(); } - public void testRegexp() throws Exception { + public void testRegexp() { doTest(); } diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyNoArtifactTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyNoArtifactTest.java index dff5e22f402b..181a1d26e4dc 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyNoArtifactTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyNoArtifactTest.java @@ -14,14 +14,14 @@ import java.io.IOException; */ public class JavaFxFieldToPropertyNoArtifactTest extends JavaFxFieldToPropertyTest { - public void testArtifactPresenceFieldToProperty() throws Exception { + public void testArtifactPresenceFieldToProperty() { configureByFiles(null, getTestName(false) + ".java"); final IntentionAction intentionAction = getIntentionAction(); // no artifact, no fxml, no javafx.* imports: the intention shouldn't be available assertNull(intentionAction); } - public void testAddRemoveFxmlFile() throws Exception { + public void testAddRemoveFxmlFile() { final VirtualFile sourceRootDir = configureByFiles(null, getTestName(false) + ".java"); IntentionAction intentionAction = getIntentionAction(); assertNull(intentionAction); diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyTest.java index b4e2e083959a..27233760b0f0 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyTest.java @@ -90,7 +90,7 @@ public class JavaFxFieldToPropertyTest extends DaemonAnalyzerTestCase { checkResultByFile(getTestName(false) + "_after.java"); } - protected IntentionAction getIntentionAction() throws Exception { + protected IntentionAction getIntentionAction() { final List infos = doHighlighting(); final Editor editor = getEditor(); final PsiFile file = getFile(); diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/RefactoringFieldTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/RefactoringFieldTest.java index 162a8462507c..c89b157ee0b1 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/RefactoringFieldTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/RefactoringFieldTest.java @@ -26,13 +26,13 @@ import org.jetbrains.plugins.javaFX.fxml.AbstractJavaFXTestCase; public class RefactoringFieldTest extends AbstractJavaFXTestCase { - public void testPropertyRename() throws Exception { + public void testPropertyRename() { myFixture.configureByFile(getTestName(false) + ".java"); performRename("newName"); myFixture.checkResultByFile(getTestName(false) + "_after.java"); } - public void testPropertyDelete() throws Exception { + public void testPropertyDelete() { myFixture.configureByFile(getTestName(false) + ".java"); performDelete(); myFixture.checkResultByFile(getTestName(false) + "_after.java"); diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXDefaultTagInspectionTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXDefaultTagInspectionTest.java index ffd87deec708..982f711dd6ba 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXDefaultTagInspectionTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXDefaultTagInspectionTest.java @@ -27,31 +27,31 @@ public class JavaFXDefaultTagInspectionTest extends AbstractJavaFXQuickFixTest { } - public void testChildren() throws Exception { + public void testChildren() { doLaunchQuickfixTest("children"); } - public void testEmptyChildren() throws Exception { + public void testEmptyChildren() { doLaunchQuickfixTest("children"); } - public void testFxCollectionsHighlighting() throws Exception { + public void testFxCollectionsHighlighting() { doHighlightingTest(); } - public void testEmptyListHighlighting() throws Exception { + public void testEmptyListHighlighting() { doHighlightingTest(); } - public void testEmptyCollapsedListHighlighting() throws Exception { + public void testEmptyCollapsedListHighlighting() { doHighlightingTest(); } - public void testStylesheets() throws Exception { + public void testStylesheets() { checkQuickFixNotAvailable("stylesheets"); } - private void doHighlightingTest() throws Exception { + private void doHighlightingTest() { myFixture.configureByFiles(getTestName(true) + ".fxml"); myFixture.checkHighlighting(); } diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXHighlightingTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXHighlightingTest.java index bde99c5f25af..6a1dedcbb00a 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXHighlightingTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXHighlightingTest.java @@ -32,75 +32,75 @@ import org.jetbrains.annotations.NotNull; */ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { - public void testLoginForm() throws Exception { + public void testLoginForm() { doTest(); } - public void testUnresolvedTopLevelController() throws Exception { + public void testUnresolvedTopLevelController() { doTest(); } - public void testController() throws Exception { + public void testController() { doTest(); } - public void testCoercedTypes() throws Exception { + public void testCoercedTypes() { doTest(); } - public void testRootTagCoercedUnchecked() throws Exception { + public void testRootTagCoercedUnchecked() { doTest(); } - public void testStaticProperties() throws Exception { + public void testStaticProperties() { doTest(); } - public void testStaticPropertiesCustomLayout() throws Exception { + public void testStaticPropertiesCustomLayout() { myFixture.addClass("import javafx.scene.layout.GridPane;\n" + "public class MyGridPane extends GridPane {}\n"); myFixture.testHighlighting(false, false, false, getTestName(true) + ".fxml"); } - public void testEnumValues() throws Exception { + public void testEnumValues() { doTest(); } - public void testDefaultTagProperties() throws Exception { + public void testDefaultTagProperties() { doTest(); } - public void testDefaultTagInList() throws Exception { + public void testDefaultTagInList() { doTest(); } - public void testUnresolvedImport() throws Exception { + public void testUnresolvedImport() { doTest(); } - public void testImageIcon() throws Exception { + public void testImageIcon() { myFixture.copyFileToProject("appIcon.png"); myFixture.configureByFiles(getTestName(true) + ".fxml"); myFixture.testHighlighting(false, false, false, getTestName(true) + ".fxml"); } - public void testControllerIdRef() throws Exception { + public void testControllerIdRef() { doTestIdController(); } - public void testEventHandlers() throws Exception { + public void testEventHandlers() { myFixture.testHighlighting(false, false, false, getTestName(true) + ".fxml"); } - public void testPackageLocalController() throws Exception { + public void testPackageLocalController() { doTest(getTestName(false) + ".java"); } - public void testNoParamsHandler() throws Exception { + public void testNoParamsHandler() { doTest(getTestName(false) + ".java"); } - private void doTestIdController() throws Exception { + private void doTestIdController() { final String controllerClassName = getTestName(false) + "Controller"; myFixture.configureByFiles(getTestName(true) + ".fxml", controllerClassName + ".java"); final PsiClass controllerClass = myFixture.findClass(controllerClassName); @@ -112,27 +112,27 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { assertEquals(controllerClass.getFields()[0], reference.resolve()); } - public void testConstantNavigation() throws Exception { + public void testConstantNavigation() { doTestNavigation("java.lang.Double", "NEGATIVE_INFINITY"); } - public void testEnumNavigation() throws Exception { + public void testEnumNavigation() { doTestNavigation("javafx.geometry.Pos", "CENTER"); } - public void testCustomComponentFields() throws Exception { + public void testCustomComponentFields() { doTestNavigation("CustomVBox", "tf", "custom/" + getTestName(true) + ".fxml", "custom/CustomVBox.java"); } - public void testCustomComponentFieldsWithSameProperties() throws Exception { + public void testCustomComponentFieldsWithSameProperties() { doTest("custom/" + getTestName(true) + ".fxml", "custom/" + getTestName(false) + ".java"); } - public void testCustomComponent_Fields() throws Exception { + public void testCustomComponent_Fields() { doTest("custom/" + getTestName(true) + ".fxml", "custom/_CustomVBox.java"); } - public void testInjectedController() throws Exception { + public void testInjectedController() { myFixture.copyFileToProject("injected/MyController.java"); myFixture.copyFileToProject("injected/FooVBox.java"); @@ -147,19 +147,19 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { } } - public void testControllerInExpression() throws Exception{ + public void testControllerInExpression() { doTest(getTestName(true) + ".fxml", getTestName(false) + ".java", getTestName(false) + "Wrapper.java"); } - public void testNamedColor() throws Exception { + public void testNamedColor() { doTestNavigation(JavaFxCommonNames.JAVAFX_SCENE_COLOR, "ORANGE"); } - private void doTestNavigation(String resultClassName, String resultFieldName) throws Exception { + private void doTestNavigation(String resultClassName, String resultFieldName) { doTestNavigation(resultClassName, resultFieldName, ArrayUtil.EMPTY_STRING_ARRAY); } - private void doTestNavigation(String resultClassName, String resultFieldName, String... additionalPaths) throws Exception { + private void doTestNavigation(String resultClassName, String resultFieldName, String... additionalPaths) { if (additionalPaths.length == 0) { myFixture.configureByFiles(getTestName(true) + ".fxml"); } else { @@ -175,7 +175,7 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { assertEquals(resultField, reference.resolve()); } - public void testNavigationFromMainToFxml() throws Exception { + public void testNavigationFromMainToFxml() { myFixture.configureByFiles(getTestName(false) + ".java", getTestName(true) + ".fxml"); final int offset = myFixture.getCaretOffset(); final PsiReference reference = myFixture.getFile().findReferenceAt(offset); @@ -187,63 +187,63 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { assertEquals(getTestName(true) + ".fxml", containingFile.getName()); } - public void testSourceAttrRecognition() throws Exception { + public void testSourceAttrRecognition() { doTest(); } - public void testReferenceAttributes() throws Exception { + public void testReferenceAttributes() { doTest(); } - public void testVariables() throws Exception { + public void testVariables() { doTest(); } - public void testDefineAttributes() throws Exception { + public void testDefineAttributes() { doTest(); } - public void testDefinedElements() throws Exception { + public void testDefinedElements() { doTest(); } - public void testPropertyElementsWithAnyAttributes() throws Exception { + public void testPropertyElementsWithAnyAttributes() { doTest(); } - public void testHandlerWithoutController() throws Exception { + public void testHandlerWithoutController() { doTest(); } - public void testHandlerWithoutPageLanguage() throws Exception { + public void testHandlerWithoutPageLanguage() { doTest(); } - public void testIdOutOfHierarchy() throws Exception { + public void testIdOutOfHierarchy() { doTest("btn.fxml", "MyController.java"); } - public void testIncludeBtn() throws Exception { + public void testIncludeBtn() { doTest("btn.fxml"); } - public void testWrongBindingType() throws Exception { + public void testWrongBindingType() { doTest(getTestName(false) + ".java"); } - public void testAllowIncludeTagInsideDefine() throws Exception { + public void testAllowIncludeTagInsideDefine() { doTest("btn.fxml"); } - public void testValueOfAcceptance() throws Exception { + public void testValueOfAcceptance() { doTest(); } - public void testInstantiationAcceptance() throws Exception { + public void testInstantiationAcceptance() { doTest(); } - public void testInstantiationAcceptanceWithNameArg() throws Exception { + public void testInstantiationAcceptanceWithNameArg() { myFixture.addClass("package p;\n" + "public class Root extends javafx.scene.layout.GridPane{\n" + " public Root(@javafx.beans.NamedArg(\"axis\") javafx.scene.Node node ) {\n" + @@ -255,47 +255,47 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { doTest(getTestName(true) + ".fxml"); } - public void testFqnTagNames() throws Exception { + public void testFqnTagNames() { doTest(); } - public void testRootTag() throws Exception { + public void testRootTag() { doTest(); } - public void testUnresolvedRootTag() throws Exception { + public void testUnresolvedRootTag() { doTest(); } - public void testRootTagWithoutType() throws Exception { + public void testRootTagWithoutType() { doTest(); } - public void testRootTagWithImport() throws Exception { + public void testRootTagWithImport() { doTest(); } - public void testReadOnly() throws Exception { + public void testReadOnly() { doTest(); } - public void testReadOnly1() throws Exception { + public void testReadOnly1() { doTest(); } - public void testScriptSource() throws Exception { + public void testScriptSource() { doTest("s1.js"); } - public void testPropertyNameExpression() throws Exception { + public void testPropertyNameExpression() { doTest(); } - public void testPropertyChainExpression() throws Exception { + public void testPropertyChainExpression() { doTest(); } - public void testIncorrectPropertyExpressionSyntax() throws Exception { + public void testIncorrectPropertyExpressionSyntax() { doTest(); } @@ -309,135 +309,135 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { myFixture.testHighlighting(false, false, false, paths[0]); } - public void testExpressionBinding() throws Exception { + public void testExpressionBinding() { doTest(); } - public void testPropertyWithoutField() throws Exception { + public void testPropertyWithoutField() { doTest(); } - public void testRootTagProperties() throws Exception { + public void testRootTagProperties() { doTest(); } - public void testBooleanPropertyWithoutField() throws Exception { + public void testBooleanPropertyWithoutField() { doTest(); } - public void testShortNamesInRootType() throws Exception { + public void testShortNamesInRootType() { doTest(); } - public void testLineChartInstantiation() throws Exception { + public void testLineChartInstantiation() { doTest(); } - public void testUnexpectedNode() throws Exception { + public void testUnexpectedNode() { doTest(); } - public void testDefaultPropertyField() throws Exception { + public void testDefaultPropertyField() { doTest(); } - public void testPrimitiveSubtags() throws Exception { + public void testPrimitiveSubtags() { doTest(); } - public void testReferencePosition() throws Exception { + public void testReferencePosition() { doTest(); } - public void testAcceptReferenceInsideDefine() throws Exception { + public void testAcceptReferenceInsideDefine() { doTest(); } - public void testRootTagOnDifferentLevels() throws Exception { + public void testRootTagOnDifferentLevels() { doTest(); } - public void testAbsenceOfDefineAttributes() throws Exception { + public void testAbsenceOfDefineAttributes() { doTest(); } - public void testCopyReference() throws Exception { + public void testCopyReference() { doTest(); } - public void testConstantValue() throws Exception { + public void testConstantValue() { doTest(); } - public void testEnumConstantValue() throws Exception { + public void testEnumConstantValue() { doTest(); } - public void testNestedClassConstants() throws Exception { + public void testNestedClassConstants() { doTest("model/" + getTestName(false) + "Model.java"); } - public void testBoxedConstantValue() throws Exception { + public void testBoxedConstantValue() { doTest(); } - public void testLiteralValue() throws Exception { + public void testLiteralValue() { doTest(); } - public void testNullObjectValue() throws Exception { + public void testNullObjectValue() { doTest(); } - public void testNullPrimitiveValue() throws Exception { + public void testNullPrimitiveValue() { doTest(); } - public void testFactoryMethod() throws Exception { + public void testFactoryMethod() { doTest(); } - public void testPrivateControllerMethod() throws Exception { + public void testPrivateControllerMethod() { doTest(getTestName(false) + ".java"); } - public void testPropertyTagCompatibleClass() throws Exception { + public void testPropertyTagCompatibleClass() { doTest(); } - public void testPropertyTagCompatiblePrimitive() throws Exception { + public void testPropertyTagCompatiblePrimitive() { doTest(); } - public void testPropertyTagIncompatibleClass() throws Exception { + public void testPropertyTagIncompatibleClass() { doTest(); } - public void testPropertyTagIncompatiblePrimitive() throws Exception { + public void testPropertyTagIncompatiblePrimitive() { doTest(); } - public void testPropertyTagUnrelatedClass() throws Exception { + public void testPropertyTagUnrelatedClass() { doWarningsTest(); } - public void testPropertyTagUnrelatedPrimitive() throws Exception { + public void testPropertyTagUnrelatedPrimitive() { doWarningsTest(); } - public void testCharsetInInclude() throws Exception { + public void testCharsetInInclude() { myFixture.addFileToProject("sample.fxml", "\n" + "\n"); doWarningsTest(); } - public void testIncludedForm() throws Exception { + public void testIncludedForm() { myFixture.addFileToProject("sample.fxml", "\n" + "\n"); doWarningsTest(); } - public void testInjectedControllerFields() throws Exception { + public void testInjectedControllerFields() { myFixture.addFileToProject("sample.fxml", "\n" + "\n" + "\n" + @@ -447,32 +447,32 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { myFixture.testHighlighting(true, false, false, getTestName(false) + ".java"); } - public void testAbsoluteRemoteUrl() throws Exception { + public void testAbsoluteRemoteUrl() { doTest(); } - public void testMultipleStylesheetsAttribute() throws Exception { + public void testMultipleStylesheetsAttribute() { myFixture.addFileToProject("mystyle.css", ".myStyle {}"); myFixture.addFileToProject("very/deeply/located/small.css", ".small {}"); doTest(); } - public void testMultipleStylesheetsTag() throws Exception { + public void testMultipleStylesheetsTag() { myFixture.addFileToProject("mystyle.css", ".myStyle {}"); myFixture.addFileToProject("very/deeply/located/small.css", ".small {}"); doTest(); } - public void testPrivateEventHandler() throws Exception { + public void testPrivateEventHandler() { myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java"); myFixture.testHighlighting(true, true, true, getTestName(false) + ".java"); } - public void testFxIdInSuperclass() throws Exception { + public void testFxIdInSuperclass() { doTestControllerSuperclass(); } - public void testEventHandlerInSuperclass() throws Exception { + public void testEventHandlerInSuperclass() { doTestControllerSuperclass(); } @@ -490,13 +490,13 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase { myFixture.testHighlighting(true, true, true, superclass + ".java"); } - public void testResourceKeyInAttribute() throws Exception { + public void testResourceKeyInAttribute() { myFixture.addFileToProject("messages.properties", "string.key=My text\n" + "double.key=123.456\n"); doTest(); } - public void testFxIdUsedInSameNode() throws Exception { + public void testFxIdUsedInSameNode() { myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java"); doTest(); } diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXOptimizeImportsTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXOptimizeImportsTest.java index 9db7f2f3e319..3a30407ebac3 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXOptimizeImportsTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXOptimizeImportsTest.java @@ -20,31 +20,31 @@ import com.intellij.openapi.application.PluginPathManager; import org.jetbrains.annotations.NotNull; public class JavaFXOptimizeImportsTest extends AbstractJavaFXTestCase { - public void testCollapseOnDemand() throws Exception { + public void testCollapseOnDemand() { doTest(); } - public void testRemoveUnused() throws Exception { + public void testRemoveUnused() { doTest(); } - public void testDblImports() throws Exception { + public void testDblImports() { doTest(); } - public void testStaticPropertiesAttrAndCustomComponents() throws Exception { + public void testStaticPropertiesAttrAndCustomComponents() { myFixture.addClass("import javafx.scene.layout.GridPane;\n" + "public class MyGridPane extends GridPane {}\n"); doTest(); } - public void testStaticPropertiesTagAndCustomComponents() throws Exception { + public void testStaticPropertiesTagAndCustomComponents() { myFixture.addClass("import javafx.scene.layout.GridPane;\n" + "public class MyGridPane extends GridPane {}\n"); doTest(); } - private void doTest() throws Exception { + private void doTest() { myFixture.configureByFile(getTestName(true) + ".fxml"); new OptimizeImportsProcessor(getProject(), myFixture.getFile()).run(); myFixture.checkResultByFile(getTestName(true) + "_after.fxml"); diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXQuickfixTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXQuickfixTest.java index 99ad1d041a4d..1ebcbef2a985 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXQuickfixTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXQuickfixTest.java @@ -53,71 +53,71 @@ public class JavaFXQuickfixTest extends LightCodeInsightFixtureTestCase { return JAVA_FX_WITH_GROOVY_DESCRIPTOR; } - public void testCreateControllerMethod() throws Exception { + public void testCreateControllerMethod() { doTest("Create method 'void bar(ActionEvent)'", ".java"); } - public void testCreateControllerMethodInGroovy() throws Exception { + public void testCreateControllerMethodInGroovy() { doTest("Create method 'void bar(ActionEvent)'", ".groovy"); } - public void testCreateControllerMethodGeneric() throws Exception { + public void testCreateControllerMethodGeneric() { doTest("Create method 'void onSort(SortEvent)'", ".java"); } - public void testCreateControllerMethodHalfRaw() throws Exception { + public void testCreateControllerMethodHalfRaw() { doTest("Create method 'void onSort(SortEvent)'", ".java"); } - public void testCreateFieldPublicVisibility() throws Exception { + public void testCreateFieldPublicVisibility() { doTestWithDefaultVisibility("Create field 'btn'", "CreateField", PsiModifier.PUBLIC, ".java"); } - public void testCreateFieldProtectedVisibility() throws Exception { + public void testCreateFieldProtectedVisibility() { doTestWithDefaultVisibility("Create field 'btn'", "CreateField", PsiModifier.PROTECTED, ".java"); } - public void testCreateFieldPrivateVisibility() throws Exception { + public void testCreateFieldPrivateVisibility() { doTestWithDefaultVisibility("Create field 'btn'", "CreateField", PsiModifier.PRIVATE, ".java"); } - public void testCreateFieldPackageLocalVisibility() throws Exception { + public void testCreateFieldPackageLocalVisibility() { doTestWithDefaultVisibility("Create field 'btn'", "CreateField", PsiModifier.PACKAGE_LOCAL, ".java"); } - public void testCreateFieldEscalateVisibility() throws Exception { + public void testCreateFieldEscalateVisibility() { doTestWithDefaultVisibility("Create field 'btn'", "CreateField", VisibilityUtil.ESCALATE_VISIBILITY, ".java"); } - public void testCreateMethodPublicVisibility() throws Exception { + public void testCreateMethodPublicVisibility() { doTestWithDefaultVisibility("Create method 'void onAction(ActionEvent)'", "CreateMethod", PsiModifier.PUBLIC, ".java"); } - public void testCreateMethodProtectedVisibility() throws Exception { + public void testCreateMethodProtectedVisibility() { doTestWithDefaultVisibility("Create method 'void onAction(ActionEvent)'", "CreateMethod", PsiModifier.PROTECTED, ".java"); } - public void testCreateMethodPrivateVisibility() throws Exception { + public void testCreateMethodPrivateVisibility() { doTestWithDefaultVisibility("Create method 'void onAction(ActionEvent)'", "CreateMethod", PsiModifier.PRIVATE, ".java"); } - public void testCreateMethodPackageLocalVisibility() throws Exception { + public void testCreateMethodPackageLocalVisibility() { doTestWithDefaultVisibility("Create method 'void onAction(ActionEvent)'", "CreateMethod", PsiModifier.PACKAGE_LOCAL, ".java"); } - public void testCreateMethodEscalateVisibility() throws Exception { + public void testCreateMethodEscalateVisibility() { doTestWithDefaultVisibility("Create method 'void onAction(ActionEvent)'", "CreateMethod", VisibilityUtil.ESCALATE_VISIBILITY, ".java"); } - public void testCreateFieldEmptyName() throws Exception { + public void testCreateFieldEmptyName() { String path = getTestName(true) + ".fxml"; final IntentionAction intention = myFixture.getAvailableIntention("Create field 'btn'", path, getTestName(false) + ".java"); assertNull(intention); } - public void testRegisterPageLanguage() throws Exception { + public void testRegisterPageLanguage() { myFixture.configureByFile(getTestName(true) + ".fxml"); final IntentionAction intention = myFixture.findSingleIntention("Specify page language"); assertNotNull(intention); @@ -129,7 +129,7 @@ public class JavaFXQuickfixTest extends LightCodeInsightFixtureTestCase { myFixture.checkResultByFile(getTestName(true) + ".fxml", getTestName(true) + "_after.fxml", true); } - public void testWrapWithDefine() throws Exception { + public void testWrapWithDefine() { final IntentionAction intention = myFixture.getAvailableIntention("Wrap \"lb\" with fx:define", getTestName(true) + ".fxml"); assertNotNull(intention); @@ -140,7 +140,7 @@ public class JavaFXQuickfixTest extends LightCodeInsightFixtureTestCase { private void doTestWithDefaultVisibility(final String actionName, final String inputName, final String defaultVisibility, - final String extension) throws Exception { + final String extension) { JavaCodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject()).getCustomSettings(JavaCodeStyleSettings.class); String savedVisibility = settings.VISIBILITY; try { @@ -152,11 +152,11 @@ public class JavaFXQuickfixTest extends LightCodeInsightFixtureTestCase { } } - private void doTest(final String actionName, final String extension) throws Exception { + private void doTest(final String actionName, final String extension) { doTest(actionName, getTestName(false), getTestName(false), extension); } - private void doTest(final String actionName, final String inputName, final String outputName, final String extension) throws Exception { + private void doTest(final String actionName, final String inputName, final String outputName, final String extension) { String path = PlatformTestUtil.lowercaseFirstLetter(inputName, true) + ".fxml"; final IntentionAction intention = myFixture.getAvailableIntention(actionName, path, inputName + extension); diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXRenameTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXRenameTest.java index 888446423da7..7faeff5d37b0 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXRenameTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXRenameTest.java @@ -40,27 +40,27 @@ import java.util.Arrays; public class JavaFXRenameTest extends AbstractJavaFXRenameTest { - public void testCustomComponent() throws Exception { + public void testCustomComponent() { doTest(getTestName(false) + "1"); } - public void testInRoot() throws Exception { + public void testInRoot() { doTest(getTestName(false) + "1"); } - public void testControllerField() throws Exception { + public void testControllerField() { doTest("newFieldName"); } - public void testControllerFieldWithRefs() throws Exception { + public void testControllerFieldWithRefs() { doTest("newFieldName"); } - public void testHandler() throws Exception { + public void testHandler() { doTest("newHandlerName"); } - public void testPrivateSuperHandler() throws Exception { + public void testPrivateSuperHandler() { final String newName = "newHandlerName"; final String fxmlPath = getTestName(true) + ".fxml"; final String fxmlPathAfter = getTestName(true) + "_after.fxml"; @@ -76,15 +76,15 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { assertMethodExists(psiClass, newName); } - public void testCustomComponentTag() throws Exception { + public void testCustomComponentTag() { doTest("Foo", true); } - public void testCustomComponentPropertyTag() throws Exception { + public void testCustomComponentPropertyTag() { doTest("Foo", true); } - public void testFromReference() throws Exception { + public void testFromReference() { final String newName = "lbl1"; doTest(newName); final PsiClass controllerClass = myFixture.findClass(getTestName(false)); @@ -92,7 +92,7 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { assertFieldExists(controllerClass, newName); } - public void testIdWithRefs() throws Exception { + public void testIdWithRefs() { myFixture.configureByFiles(getTestName(true) + ".fxml"); PsiElement element = TargetElementUtil .findTargetElement(getEditor(), TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); @@ -101,15 +101,15 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { myFixture.checkResultByFile(getTestName(true) + "_after.fxml"); } - public void testControllerBare() throws Exception { + public void testControllerBare() { doTestErrorHint("Foo", "Cannot rename built-in property"); } - public void testControllerInExpr() throws Exception { + public void testControllerInExpr() { doTestErrorHint("Foo", "Cannot rename built-in property"); } - private void doTestErrorHint(String newName, String message) throws Exception { + private void doTestErrorHint(String newName, String message) { try { doTest(newName, true); fail(message); @@ -119,15 +119,15 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { } } - public void testPropertyRenameHandlerPresent() throws Exception { + public void testPropertyRenameHandlerPresent() { doTestPropertyRenameHandler(getTestName(true) + ".fxml", getTestName(false) + ".java"); } - public void testPropertyRenameHandlerPresentForStatic() throws Exception { + public void testPropertyRenameHandlerPresentForStatic() { doTestPropertyRenameHandler(getTestName(true) + ".fxml", "container/MyCustomContainer.java"); } - public void doTestPropertyRenameHandler(String... files) throws Exception { + public void doTestPropertyRenameHandler(String... files) { myFixture.configureByFiles(files); final MapDataContext dataContext = new MapDataContext(); dataContext.put(CommonDataKeys.EDITOR, getEditor()); @@ -135,15 +135,15 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { assertTrue(renameHandler instanceof JavaFxPropertyRenameHandler); } - public void testStaticPropertyImportClass() throws Exception { + public void testStaticPropertyImportClass() { doTestStaticProperty("newPropName2", "container.MyCustomContainer"); } - public void testStaticPropertyImportPackage() throws Exception { + public void testStaticPropertyImportPackage() { doTestStaticProperty("newPropName2", "container.MyCustomContainer"); } - public void doTestStaticProperty(@NonNls String newName, String className) throws Exception { + public void doTestStaticProperty(@NonNls String newName, String className) { myFixture.configureByFiles(getTestName(true) + ".fxml", className.replace('.', '/') + ".java"); final MapDataContext dataContext = new MapDataContext(); @@ -162,7 +162,7 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { assertMethodExists(psiClass, "set" + propName); } - public void testStaticPropertyMethod() throws Exception { + public void testStaticPropertyMethod() { final String className="container.MyCustomContainer"; final String methodName = "setStaticProp"; final String newName = "setNewMethodName"; @@ -181,21 +181,21 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { assertMethodExists(psiClass, newName); } - public void testStaticPropertyFromLibrary() throws Exception { + public void testStaticPropertyFromLibrary() { doTestErrorHint("Foo", RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("error.cannot.be.renamed"))); } - public void testControllerMethod() throws Exception { + public void testControllerMethod() { final PsiClass psiClass = doTestHandler("newName", null); assertMethodExists(psiClass, "getNewName"); } - public void testNestedControllerIdFromFxml() throws Exception { + public void testNestedControllerIdFromFxml() { doTestHandler("newName", getTestName(false) + "Internal"); myFixture.checkResultByFile(getTestName(false) + ".java", getTestName(false) + "_after.java", false); } - public void testNestedControllerIdFromJava() throws Exception { + public void testNestedControllerIdFromJava() { myFixture.configureByFiles(getTestName(false) + ".java", getTestName(false) + "Internal.java", getTestName(true) + ".fxml"); final PsiElement elementAtCaret = myFixture.getElementAtCaret(); new RenameProcessor(getProject(), elementAtCaret, "newName", false, false).run(); @@ -211,11 +211,11 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { doTestProperty("newName", true); } - public void testModelIdProperty() throws Exception { + public void testModelIdProperty() { doTestProperty("newName", "model.Data", false); } - public void testModelFieldProperty() throws Exception { + public void testModelFieldProperty() { doTestProperty("newName", "model.Data", false); } @@ -226,11 +226,11 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { myFixture.checkResultByFile(getTestName(true) + ".properties", getTestName(true) + "_after.properties", false); } - public void doTestProperty(String name, boolean isBoolean) throws Exception { + public void doTestProperty(String name, boolean isBoolean) { doTestProperty(name, null, isBoolean); } - public void doTestProperty(@NonNls String name, String className, boolean isBoolean) throws Exception { + public void doTestProperty(@NonNls String name, String className, boolean isBoolean) { final PsiClass psiClass = doTestHandler(name, className); final String propName = name.substring(0, 1).toUpperCase() + name.substring(1); assertMethodExists(psiClass, (isBoolean ? "is" : "get") + propName); @@ -240,7 +240,7 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { } @NotNull - public PsiClass doTestHandler(String newName, String className) throws Exception { + public PsiClass doTestHandler(String newName, String className) { if (className == null) { className = getTestName(false); myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java"); @@ -271,11 +271,11 @@ public class JavaFXRenameTest extends AbstractJavaFXRenameTest { assertOrderedEquals(Arrays.stream(methods).map(PsiMethod::getName).toArray(), name); } - private void doTest(final String newName) throws Exception { + private void doTest(final String newName) { doTest(newName, false); } - private void doTest(final String newName, boolean inline) throws Exception { + private void doTest(final String newName, boolean inline) { myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java"); PsiElement element = TargetElementUtil .findTargetElement(getEditor(), TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXUnresolvedFxIdReferenceInspectionTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXUnresolvedFxIdReferenceInspectionTest.java index f5efd5700e69..40f989f6bd16 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXUnresolvedFxIdReferenceInspectionTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXUnresolvedFxIdReferenceInspectionTest.java @@ -32,24 +32,24 @@ public class JavaFXUnresolvedFxIdReferenceInspectionTest extends AbstractJavaFXQ myFixture.enableInspections(new JavaFxUnresolvedFxIdReferenceInspection()); } - public void testUnknownRef() throws Exception { + public void testUnknownRef() { doTest("Controller", VisibilityUtil.ESCALATE_VISIBILITY); } - public void testRootType() throws Exception { + public void testRootType() { myFixture.configureByFiles(getTestName(true) + ".fxml"); final List intentionActions = myFixture.filterAvailableIntentions(getHint("unknown")); assertEmpty(intentionActions); } - public void testIncludeBtnWithController() throws Exception { + public void testIncludeBtnWithController() { myFixture.addFileToProject("btn.fxml", "\n" + "\n" + "