diff --git a/platform/vcs-tests/testSrc/com/intellij/vcs/test/VcsPlatformTest.kt b/platform/vcs-tests/testSrc/com/intellij/vcs/test/VcsPlatformTest.kt index 72b7be5cbe40..20572182b148 100644 --- a/platform/vcs-tests/testSrc/com/intellij/vcs/test/VcsPlatformTest.kt +++ b/platform/vcs-tests/testSrc/com/intellij/vcs/test/VcsPlatformTest.kt @@ -23,7 +23,6 @@ import com.intellij.openapi.progress.ProgressManager import com.intellij.openapi.util.io.FileUtil import com.intellij.openapi.util.text.StringUtil import com.intellij.openapi.vcs.changes.ChangeListManager -import com.intellij.openapi.vcs.changes.ChangeListManagerEx import com.intellij.openapi.vcs.changes.ChangeListManagerImpl import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager import com.intellij.openapi.vfs.LocalFileSystem @@ -33,7 +32,6 @@ import com.intellij.testFramework.PlatformTestCase import com.intellij.testFramework.RunAll import com.intellij.testFramework.TestLoggerFactory import com.intellij.testFramework.runInEdtAndWait -import com.intellij.testFramework.vcs.MockChangeListManager import com.intellij.util.ArrayUtil import com.intellij.util.ThrowableRunnable import java.io.File @@ -51,7 +49,7 @@ abstract class VcsPlatformTest : PlatformTestCase() { private lateinit var myTestStartedIndicator: String private val asyncTasks = mutableSetOf() - protected lateinit var changeListManager: ChangeListManagerEx + protected lateinit var changeListManager: ChangeListManagerImpl @Throws(Exception::class) override fun setUp() { @@ -73,12 +71,11 @@ abstract class VcsPlatformTest : PlatformTestCase() { @Throws(Exception::class) override fun tearDown() { - RunAll() - .append(ThrowableRunnable { waitForPendingTasks() }) - .append(ThrowableRunnable { changeListManager = MockChangeListManager() }) - .append(ThrowableRunnable { runInEdtAndWait { super@VcsPlatformTest.tearDown() }}) - .append(ThrowableRunnable { if (myAssertionsInTestDetected) TestLoggerFactory.dumpLogToStdout(myTestStartedIndicator) }) - .append(ThrowableRunnable { clearFields(this) }) + RunAll().append(ThrowableRunnable + { waitForPendingTasks() }).append(ThrowableRunnable + { runInEdtAndWait { super@VcsPlatformTest.tearDown() }}).append(ThrowableRunnable + { if (myAssertionsInTestDetected) TestLoggerFactory.dumpLogToStdout(myTestStartedIndicator) }).append(ThrowableRunnable + { clearFields(this) }) .run() } @@ -140,7 +137,6 @@ abstract class VcsPlatformTest : PlatformTestCase() { future.get(10, TimeUnit.SECONDS) } } - asyncTasks.clear() } protected fun executeOnPooledThread(runnable: () -> Unit){ diff --git a/plugins/git4idea/tests/git4idea/checkin/GitAddTest.kt b/plugins/git4idea/tests/git4idea/checkin/GitAddTest.kt index 354ded646d81..9bce01f8d1d2 100644 --- a/plugins/git4idea/tests/git4idea/checkin/GitAddTest.kt +++ b/plugins/git4idea/tests/git4idea/checkin/GitAddTest.kt @@ -16,7 +16,6 @@ package git4idea.checkin import com.intellij.openapi.vcs.VcsConfiguration.StandardConfirmation.ADD -import com.intellij.openapi.vcs.changes.ChangeListManagerImpl import com.intellij.openapi.vfs.VirtualFile import git4idea.test.GitSingleRepoTest import git4idea.test.git @@ -41,7 +40,7 @@ class GitAddTest : GitSingleRepoTest() { } private fun addUnversionedFile(file: VirtualFile) { - (changeListManager as ChangeListManagerImpl).addUnversionedFiles(changeListManager.addChangeList("dummy", null), listOf(file)) + changeListManager.addUnversionedFiles(changeListManager.addChangeList("dummy", null), listOf(file)) } private fun assertStatus(file: VirtualFile, status: Char) { diff --git a/plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java b/plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java index b654b5f8c53c..addf0178b418 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/HgPlatformTest.java @@ -78,7 +78,6 @@ public abstract class HgPlatformTest extends VcsPlatformTest { finally { try { myVcs.getGlobalSettings().setHgExecutable(null); - myVcs = null; } finally { super.tearDown(); diff --git a/plugins/hg4idea/testSrc/hg4idea/test/validator/HgReferenceValidatorTest.java b/plugins/hg4idea/testSrc/hg4idea/test/validator/HgReferenceValidatorTest.java index 6fcf56d82bb9..b783f870a57b 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/validator/HgReferenceValidatorTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/validator/HgReferenceValidatorTest.java @@ -63,13 +63,15 @@ public class HgReferenceValidatorTest extends HgPlatformTest { @Override @After public void tearDown() throws Exception { - UIUtil.invokeAndWaitIfNeeded((Runnable)() -> { - try { - myValidator = null; - super.tearDown(); - } - catch (Exception e) { - throw new RuntimeException(e); + UIUtil.invokeAndWaitIfNeeded(new Runnable() { + @Override + public void run() { + try { + HgReferenceValidatorTest.super.tearDown(); + } + catch (Exception e) { + throw new RuntimeException(e); + } } }); }