From 50867f68bba19ab660ac7e69024ca3d04f051881 Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Fri, 27 Jan 2017 13:07:15 +0300 Subject: [PATCH] [java inlay tests] flaking tests fixed BlackListMethodIntentionTest was not cleaning up param hints settings state which caused JavaInlayParameterHintsTest failure --- .../daemon/inlays/IntentionTest.kt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/IntentionTest.kt b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/IntentionTest.kt index 1e9d0dfa5020..7c0892fbbd66 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/IntentionTest.kt +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/IntentionTest.kt @@ -16,10 +16,33 @@ package com.intellij.codeInsight.daemon.inlays import com.intellij.codeInsight.daemon.impl.ParameterHintsPresentationManager +import com.intellij.codeInsight.hints.settings.ParameterNameHintsSettings +import com.intellij.openapi.editor.ex.EditorSettingsExternalizable import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase import org.assertj.core.api.Assertions.assertThat +import org.jdom.Element class BlackListMethodIntentionTest : LightCodeInsightFixtureTestCase() { + + private var isParamHintsEnabledBefore = false + private lateinit var stateBefore: Element + + override fun setUp() { + super.setUp() + + val settings = EditorSettingsExternalizable.getInstance() + isParamHintsEnabledBefore = settings.isShowParameterNameHints + settings.isShowParameterNameHints = true + + stateBefore = ParameterNameHintsSettings.getInstance().state + } + + override fun tearDown() { + EditorSettingsExternalizable.getInstance().isShowParameterNameHints = isParamHintsEnabledBefore + ParameterNameHintsSettings.getInstance().loadState(stateBefore) + + super.tearDown() + } fun `test add to blacklist by alt enter`() { myFixture.configureByText("a.java", """