diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/AbstractParameterInfoTestCase.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/AbstractParameterInfoTestCase.java index e6fd1e6b6173..934e7f4e47a9 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/AbstractParameterInfoTestCase.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/AbstractParameterInfoTestCase.java @@ -85,10 +85,10 @@ public abstract class AbstractParameterInfoTestCase extends LightFixtureCompleti AutoPopupController.getInstance(getProject()).waitForDelayedActions(1, TimeUnit.MINUTES); } - protected void waitForAllAsyncStuff() throws TimeoutException { - waitForParameterInfoUpdate(); + protected void waitForAllAsyncStuff() { + try { waitForParameterInfoUpdate(); } catch (TimeoutException e) { fail("Timed out waiting for parameter info update"); } myFixture.doHighlighting(); waitTillAnimationCompletes(getEditor()); - waitForAutoPopup(); + try { waitForAutoPopup(); } catch (TimeoutException e) { fail("Timed out waiting for auto-popup"); } } } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/ParameterInfoTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/ParameterInfoTest.java index 6c40bd338569..0cb3bd2a7d59 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/ParameterInfoTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/ParameterInfoTest.java @@ -378,7 +378,7 @@ public class ParameterInfoTest extends AbstractParameterInfoTestCase { myFixture.checkResultByFile(getTestName(false) + "_after.java"); } - public void testHighlightCurrentParameterAfterTypingFirstArgumentOfThree() throws Exception { + public void testHighlightCurrentParameterAfterTypingFirstArgumentOfThree() { configureJava("class A {\n" + " void foo() {}\n" + " void foo(int a, int b, int c) {}\n" + diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionHintsTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionHintsTest.java index ba51985b17c2..ba82acc619bb 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionHintsTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/completion/CompletionHintsTest.java @@ -22,8 +22,6 @@ import com.intellij.psi.PsiExpressionCodeFragment; import com.intellij.testFramework.EditorTestUtil; import com.intellij.testFramework.fixtures.EditorMouseFixture; -import java.util.concurrent.TimeoutException; - public class CompletionHintsTest extends AbstractParameterInfoTestCase { private boolean myStoredSettingValue; @@ -44,7 +42,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { } } - public void testBasicScenarioWithHintsDisabledForMethod() throws Exception { + public void testBasicScenarioWithHintsDisabledForMethod() { disableVirtualComma(); // check hints appearance on completion @@ -81,7 +79,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.setProperty(\"a\", \"b\") } }"); } - public void testBasicScenarioWithHintsEnabledForMethod() throws Exception { + public void testBasicScenarioWithHintsEnabledForMethod() { disableVirtualComma(); // check hints appearance on completion @@ -117,7 +115,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { Character.forDigit(1, 2) } }"); } - public void testWithHintsEnabledForNonLiterals() throws Exception { + public void testWithHintsEnabledForNonLiterals() { disableVirtualComma(); Option option = JavaInlayParameterHintsProvider.Companion.getInstance().isShowForParamsWithSameType(); @@ -161,7 +159,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { Character.toChars(123, , ) } }"); } - public void testSwitchingOverloadsForMethodWithDisabledHints() throws Exception { + public void testSwitchingOverloadsForMethodWithDisabledHints() { disableVirtualComma(); configureJava("class C {\n" + @@ -209,7 +207,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testNestedCompletion() throws Exception { + public void testNestedCompletion() { disableVirtualComma(); configureJava("class C { void m() { System.setPro } }"); @@ -222,7 +220,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.setProperty(System.getProperty(, ), ) } }"); } - public void testTabWithNestedCompletion() throws Exception { + public void testTabWithNestedCompletion() { disableVirtualComma(); configureJava("class C { void m() { System.setPro } }"); @@ -254,7 +252,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.getProperty() } }"); } - public void testHintsDisappearWhenNumberOfParametersIsChangedDirectly() throws Exception { + public void testHintsDisappearWhenNumberOfParametersIsChangedDirectly() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -265,7 +263,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.getProperty( ) } }"); } - public void testHintsDisappearWhenNumberOfParametersIsChangedDirectlyWithNoOverloads() throws Exception { + public void testHintsDisappearWhenNumberOfParametersIsChangedDirectlyWithNoOverloads() { disableVirtualComma(); configureJava("class C { void m() { Character.for } }"); @@ -276,7 +274,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { Character.forDigit( ) } }"); } - public void testCaretIsToTheRightOfHintAfterSmartInnerCompletion() throws Exception { + public void testCaretIsToTheRightOfHintAfterSmartInnerCompletion() { disableVirtualComma(); configureJava("class C { void m() { System.setPro } }"); @@ -287,7 +285,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.setProperty(new String().trim(), ) } }"); } - public void testNoHintsDuplicationWhenTypingToTheLeftOfHint() throws Exception { + public void testNoHintsDuplicationWhenTypingToTheLeftOfHint() { disableVirtualComma(); configureJava("class C { void m() { Character.for } }"); @@ -303,7 +301,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { Character.forDigit(1,2 ) } }"); } - public void testIntroduceVariableIntention() throws Exception { + public void testIntroduceVariableIntention() { disableVirtualComma(); configureJava("class C {\n" + @@ -324,7 +322,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testIntroduceVariableIntentionInIfWithoutBraces() throws Exception { + public void testIntroduceVariableIntentionInIfWithoutBraces() { disableVirtualComma(); configureJava("class C {\n" + @@ -347,7 +345,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testPrevParameterFromOutside() throws Exception { + public void testPrevParameterFromOutside() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -359,7 +357,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.getProperty(, ) } }"); } - public void testPrevParameterFromOutsideWhenParametersAreNotEmpty() throws Exception { + public void testPrevParameterFromOutsideWhenParametersAreNotEmpty() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -373,7 +371,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.getProperty(\"a\", \"b\") } }"); } - public void testVararg() throws Exception { + public void testVararg() { disableVirtualComma(); configureJava("class C { void m() { String.f } }"); @@ -394,7 +392,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { String.format(\"a\") } }"); } - public void testVarargWithNoMandatoryArguments() throws Exception { + public void testVarargWithNoMandatoryArguments() { disableVirtualComma(); configureJava("class C { int vararg(int... args){ return 0; } void m() { varar } }"); @@ -421,7 +419,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("int..."); } - public void testVarargWithTwoMandatoryArguments() throws Exception { + public void testVarargWithTwoMandatoryArguments() { disableVirtualComma(); configureJava("class C { int vararg(int a, int b, int... args){ return 0; } void m() { varar } }"); @@ -446,7 +444,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { int vararg(int a, int b, int... args){ return 0; } void m() { vararg(1, 2) } }"); } - public void testVarargHintsDontSwitchPlaces() throws Exception { + public void testVarargHintsDontSwitchPlaces() { disableVirtualComma(); configureJava("class C { void m() { java.util.Collections.add } }"); @@ -462,7 +460,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { java.util.Collections.addAll() } }"); } - public void testHintsDontDisappearWhenNavigatingAwayFromUncompletedInvocation() throws Exception { + public void testHintsDontDisappearWhenNavigatingAwayFromUncompletedInvocation() { disableVirtualComma(); configureJava("class C { void m() { System.setPro } }"); @@ -475,7 +473,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays(" class C { void m() { System.setProperty(, ) } }"); } - public void testHintsDontDisappearOnUnfinishedInputForMethodWithOneParameter() throws Exception { + public void testHintsDontDisappearOnUnfinishedInputForMethodWithOneParameter() { disableVirtualComma(); configureJava("class C { void m() { System.clear } }"); @@ -486,7 +484,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.clearProperty() } }"); } - public void testSeveralParametersCompletion() throws Exception { + public void testSeveralParametersCompletion() { disableVirtualComma(); configureJava("class P {\n" + @@ -518,7 +516,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testCompletionHintsAreShownEvenWhenStaticHintsAreDisabled() throws Exception { + public void testCompletionHintsAreShownEvenWhenStaticHintsAreDisabled() { disableVirtualComma(); EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance(); @@ -577,7 +575,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testNestedContextIsNotDisposedOnTabbingOutToOuterContext() throws Exception { + public void testNestedContextIsNotDisposedOnTabbingOutToOuterContext() { disableVirtualComma(); configureJava("class C { void m() { System.setPro } }"); @@ -598,7 +596,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.setProperty(System.getProperty(, ), ) } }"); } - public void testHintPopupContentsForMethodWithOverloads() throws Exception { + public void testHintPopupContentsForMethodWithOverloads() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -617,7 +615,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "[@NotNull String key, String def]"); } - public void testHintPopupContentsForMethodWithoutOverloads() throws Exception { + public void testHintPopupContentsForMethodWithoutOverloads() { disableVirtualComma(); configureJava("class C { void m() { System.setPro } }"); @@ -634,7 +632,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("@NotNull String key, String value"); } - public void testUpInEditor() throws Exception { + public void testUpInEditor() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -646,13 +644,13 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("@NotNull String key\n" + "-\n" + "[@NotNull String key, String def]"); - myFixture.performEditorAction(IdeActions.ACTION_EDITOR_MOVE_CARET_UP); + up(); waitForAllAsyncStuff(); checkResultWithInlays("class C { void m() { System.getProperty(, ) } }"); checkHintContents(null); } - public void testDownInEditor() throws Exception { + public void testDownInEditor() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -670,7 +668,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents(null); } - public void testPopupAfterCaretMovesOutsideOfParenthesis() throws Exception { + public void testPopupAfterCaretMovesOutsideOfParenthesis() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -684,7 +682,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents(null); } - public void testNoLineUnderPopupText() throws Exception { + public void testNoLineUnderPopupText() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -693,7 +691,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("@NotNull String  the name of the system property. "); } - public void testSwitchIsPossibleForManuallyEnteredUnmatchedMethodCall() throws Exception { + public void testSwitchIsPossibleForManuallyEnteredUnmatchedMethodCall() { disableVirtualComma(); configureJava("class C {\n" + @@ -720,7 +718,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testShortHintIsShownAfterFullHint() throws Exception { + public void testShortHintIsShownAfterFullHint() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -737,7 +735,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("String  a default value. "); } - public void testAutopopupIsShownWithCompletionHintsDisabled() throws Exception { + public void testAutopopupIsShownWithCompletionHintsDisabled() { disableVirtualComma(); CodeInsightSettings.getInstance().SHOW_PARAMETER_NAME_HINTS_ON_COMPLETION = false; @@ -770,7 +768,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents(null); } - public void testNextParameterWorksWhenTabCompletionDoesntChangeAnything() throws Exception { + public void testNextParameterWorksWhenTabCompletionDoesntChangeAnything() { disableVirtualComma(); configureJava("class C { void m() { String local = \"a\"; String local2 = \"b\"; System.getPro } }"); @@ -783,7 +781,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { String local = \"a\"; String local2 = \"b\"; System.getProperty(local, ) } }"); } - public void testGenericType() throws Exception { + public void testGenericType() { disableVirtualComma(); configureJava("class C { void abcd(Class c) {} void m() { abc } }"); @@ -803,7 +801,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { int myVal = 1; void vararg(int a, int... b) {} void m() { vararg(myVal); } }"); } - public void testEnteringSpaceBetweenVarargHints() throws Exception { + public void testEnteringSpaceBetweenVarargHints() { disableVirtualComma(); configureJava("class C { void vararg(Object a, int... b) {} void m() { varar } }"); @@ -814,7 +812,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void vararg(Object a, int... b) {} void m() { vararg(new ); } }"); } - public void testNoTooltipForInvalidParameter() throws Exception { + public void testNoTooltipForInvalidParameter() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -826,7 +824,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents(null); } - public void testIncorrectTooltipIsNotShownForInnerContext() throws Exception { + public void testIncorrectTooltipIsNotShownForInnerContext() { disableVirtualComma(); configureJava("class C { void m() { System.getPro } }"); @@ -836,7 +834,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents(null); } - public void testOverloadsWithOneAndNoParameters() throws Exception { + public void testOverloadsWithOneAndNoParameters() { disableVirtualComma(); configureJava("class C { void method() {} void method(int a) {} void m() { m } }"); @@ -858,7 +856,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { // Later we might make it work correctly for code fragments. } - public void testVarargWithNoMandatoryArgumentsDoesNotKeepHintOnCaretOut() throws Exception { + public void testVarargWithNoMandatoryArgumentsDoesNotKeepHintOnCaretOut() { disableVirtualComma(); configureJava("class C { int vararg(int... args){ return 0; } void m() { varar } }"); @@ -869,7 +867,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { int vararg(int... args){ return 0; } void m() { vararg() } }"); } - public void testNoLinksInParameterJavadoc() throws Exception { + public void testNoLinksInParameterJavadoc() { disableVirtualComma(); configureJava("class C { void m() { String.f } }"); @@ -879,7 +877,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("String   A format string "); } - public void testBasicScenarioForConstructor() throws Exception { + public void testBasicScenarioForConstructor() { disableVirtualComma(); // check hints appearance on completion @@ -915,7 +913,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { C(int a, int b) {} void m() { new C(1, 2) } }"); } - public void testEnumValueOf() throws Exception { + public void testEnumValueOf() { disableVirtualComma(); configureJava("class C { void m() { Thread.State. } }"); @@ -925,7 +923,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("String"); } - public void testBrokenPsiCall() throws Exception { + public void testBrokenPsiCall() { disableVirtualComma(); configureJava("class C { void m() { System.setPro } }"); @@ -939,7 +937,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.setProperty(, ) } }"); } - public void testKeepHintsLonger() throws Exception { + public void testKeepHintsLonger() { disableVirtualComma(); RegistryValue setting = Registry.get("editor.keep.completion.hints.longer"); @@ -972,7 +970,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { } } - public void testKeepHintsEvenLonger() throws Exception { + public void testKeepHintsEvenLonger() { disableVirtualComma(); RegistryValue setting = Registry.get("editor.keep.completion.hints.even.longer"); @@ -1011,7 +1009,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { } } - public void testOverloadWithNoParameters() throws Exception { + public void testOverloadWithNoParameters() { disableVirtualComma(); configureJava("class C { void m() { System.out.pr } }"); @@ -1047,7 +1045,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { assertTrue(doc.contains("If the named charset is not supported")); } - public void testHighlightingOfHintsOnMultipleLines() throws Exception { + public void testHighlightingOfHintsOnMultipleLines() { disableVirtualComma(); configureJava("class C { void m() { System.setPro } }"); @@ -1072,7 +1070,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("import static java.lang.System.arraycopy;\n\nclass C { void m() { arraycopy(, , , , ); } }"); } - public void testParameterHintsLimit() throws Exception { + public void testParameterHintsLimit() { disableVirtualComma(); setParameterHintsLimit(2); @@ -1123,7 +1121,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testParameterHintsLimitWithTyping() throws Exception { + public void testParameterHintsLimitWithTyping() { disableVirtualComma(); setParameterHintsLimit(2); @@ -1177,7 +1175,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testParameterHintsLimitMoreParameters() throws Exception { + public void testParameterHintsLimitMoreParameters() { disableVirtualComma(); setParameterHintsLimit(2); @@ -1220,7 +1218,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testVarargWithLimit() throws Exception { + public void testVarargWithLimit() { disableVirtualComma(); setParameterHintsLimit(1); @@ -1243,7 +1241,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { String.format(\"a\") } }"); } - public void testBlacklistedHintsDoNotAppearWithCompletionHintsDisabled() throws Exception { + public void testBlacklistedHintsDoNotAppearWithCompletionHintsDisabled() { disableVirtualComma(); CodeInsightSettings.getInstance().SHOW_PARAMETER_NAME_HINTS_ON_COMPLETION = false; @@ -1272,7 +1270,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testVirtualCommaBasicCase() throws Exception { + public void testVirtualCommaBasicCase() { configureJava("class C { int mmm(short a, int b, long c){ return 0; } void m() { mm } }"); complete(); waitForAllAsyncStuff(); @@ -1307,7 +1305,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("short"); } - public void testVirtualCommaEmptyParams() throws Exception { + public void testVirtualCommaEmptyParams() { configureJava("class C { int mmm(short a, int b, long c){ return 0; } void m() { mm } }"); complete(); waitForAllAsyncStuff(); @@ -1339,7 +1337,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkHintContents("short"); } - public void testVirtualCommaWithLimit() throws Exception { + public void testVirtualCommaWithLimit() { setParameterHintsLimit(2); configureJava("class C {\n" + @@ -1381,7 +1379,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testVirtualCommaWithLimitEmptyParams() throws Exception { + public void testVirtualCommaWithLimitEmptyParams() { setParameterHintsLimit(2); configureJava("class C {\n" + @@ -1443,7 +1441,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testVirtualCommaWithOverload() throws Exception { + public void testVirtualCommaWithOverload() { configureJava("class C { void m() { System.getPro } }"); complete("getProperty(String key, String def)"); checkResultWithInlays("class C { void m() { System.getProperty() } }"); @@ -1459,7 +1457,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.getProperty(\"a\", \"b\") } }"); } - public void testVirtualCommaWithManyParams() throws Exception { + public void testVirtualCommaWithManyParams() { configureJava("class C {\n" + " int mmm(int a, int b, int c, int d) { return 0; }\n" + " void m2() { mm }\n" + @@ -1516,7 +1514,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { int a = Math.max()5; } }"); } - public void testConstructorInvocationInsideMethodInvocation() throws Exception { + public void testConstructorInvocationInsideMethodInvocation() { configureJava("class C { void m() { System.getPro } }"); complete("getProperty(String key)"); checkResultWithInlays("class C { void m() { System.getProperty() } }"); @@ -1529,7 +1527,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { System.getProperty(new String(null, )) } }"); } - public void testFieldAccessInsideMethodInvocation() throws Exception { + public void testFieldAccessInsideMethodInvocation() { configureJava("class C {\n" + " int x;\n" + " void some(int a, int b) {}\n" + @@ -1557,7 +1555,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { "}"); } - public void testParameterPopupAfterManuallyRenamingOneOverload() throws Exception { + public void testParameterPopupAfterManuallyRenamingOneOverload() { disableVirtualComma(); configureJava("class C {\n" + @@ -1602,7 +1600,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void m() { Character.toChars() } }"); } - public void testHintsDontDisappearOnIncompleteCallWithVirtualComma() throws Exception { + public void testHintsDontDisappearOnIncompleteCallWithVirtualComma() { configureJava("class C { void m() { System.getPro } }"); complete("getProperty(String key, String def)"); checkResultWithInlays("class C { void m() { System.getProperty() } }"); @@ -1621,7 +1619,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { // Later we might make it work correctly for code fragments. } - public void testAutoCompletionOfOverloadedMethod() throws Exception { + public void testAutoCompletionOfOverloadedMethod() { configureJava("class C {\n" + " void some(int a, int b) {}\n" + " void some(int c, int d, int e) {}" + @@ -1648,19 +1646,9 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase { checkResultWithInlays("class C { void some(int a) {} void some(int a, int b) {} void m() { some(1, ); } }"); EditorTestUtil.testUndoInEditor(getEditor(), () -> { myFixture.performEditorAction(IdeActions.ACTION_UNDO); - try { - waitForAllAsyncStuff(); - } - catch (TimeoutException e) { - fail(); - } + waitForAllAsyncStuff(); myFixture.performEditorAction(IdeActions.ACTION_REDO); - try { - waitForAllAsyncStuff(); - } - catch (TimeoutException e) { - fail(); - } + waitForAllAsyncStuff(); }); checkResultWithInlays("class C { void some(int a) {} void some(int a, int b) {} void m() { some(1, ); } }"); }