From 04dca5f1261065cabe6edf2671765d18238de1ed Mon Sep 17 00:00:00 2001 From: anstarovoyt Date: Wed, 15 Jan 2020 20:02:20 +0300 Subject: [PATCH] dynamic plugins: twice check that plugin can be unloaded (2) GitOrigin-RevId: 311dc9d67195ecd3f22821fdcc0f16352153bcf9 --- .../com/intellij/ide/plugins/DynamicPluginsTest.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/platform/platform-tests/testSrc/com/intellij/ide/plugins/DynamicPluginsTest.kt b/platform/platform-tests/testSrc/com/intellij/ide/plugins/DynamicPluginsTest.kt index d623d125f41c..86ef8a2fffae 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/plugins/DynamicPluginsTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/ide/plugins/DynamicPluginsTest.kt @@ -34,6 +34,7 @@ import org.junit.ClassRule import org.junit.Rule import org.junit.Test import java.io.File +import java.lang.AssertionError @RunsInEdt class DynamicPluginsTest { @@ -320,7 +321,15 @@ class DynamicPluginsTest { val descriptor = loadDescriptorInTest(plugin.toPath().parent.parent) descriptor.setLoader(DynamicPluginsTest::class.java.classLoader) DynamicPlugins.loadPlugin(descriptor, false) - return Disposable { DynamicPlugins.unloadPlugin(loadDescriptorInTest(plugin.toPath().parent.parent), false) } + + return Disposable { + val unloadDescriptor = loadDescriptorInTest(plugin.toPath().parent.parent) + val canBeUnloaded = DynamicPlugins.allowLoadUnloadWithoutRestart(descriptor) + DynamicPlugins.unloadPlugin(unloadDescriptor, false) + if (!canBeUnloaded) { + throw AssertionError("'Allow unload without restart' returned false, why expected true") + } + } } private class MyUISettingsListener : UISettingsListener {