mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[tests] PluginDependenciesTest: rewrite test
GitOrigin-RevId: 67a3f0be415bb8395e8983f6ddf0f50371d032fd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
68fb0f3055
commit
0f36272ed7
@@ -38,28 +38,10 @@ internal class PluginDependenciesTest {
|
||||
|
||||
@Test
|
||||
fun `depends optional - plugin loads when dependency is resolved`() {
|
||||
writeDescriptor("foo", """
|
||||
<idea-plugin>
|
||||
<id>foo</id>
|
||||
<depends optional="true" config-file="optional-part.xml">bar</depends>
|
||||
<vendor>JetBrains</vendor>
|
||||
</idea-plugin>
|
||||
""")
|
||||
|
||||
pluginDirPath.resolve("foo/META-INF/optional-part.xml").write("""
|
||||
<idea-plugin>
|
||||
<actions>
|
||||
</actions>
|
||||
</idea-plugin>
|
||||
""")
|
||||
|
||||
writeDescriptor("bar", """
|
||||
<idea-plugin>
|
||||
<id>bar</id>
|
||||
<vendor>JetBrains</vendor>
|
||||
</idea-plugin>
|
||||
""")
|
||||
|
||||
PluginBuilder.empty().id("foo")
|
||||
.depends("bar", PluginBuilder.empty().actions(""), "optional-part.xml")
|
||||
.build(pluginDirPath.resolve("foo"))
|
||||
PluginBuilder.empty().id("bar").build(pluginDirPath.resolve("bar"))
|
||||
val pluginSet = buildPluginSet()
|
||||
assertThat(pluginSet).hasExactlyEnabledPlugins("foo", "bar")
|
||||
val (foo, bar) = pluginSet.getEnabledPlugins("foo", "bar")
|
||||
@@ -241,13 +223,6 @@ internal class PluginDependenciesTest {
|
||||
assertThat(pluginSet).doesNotHaveEnabledPlugins()
|
||||
}
|
||||
|
||||
|
||||
private fun writeDescriptor(id: String, @Language("xml") data: String) {
|
||||
pluginDirPath.resolve(id)
|
||||
.resolve(PluginManagerCore.PLUGIN_XML_PATH)
|
||||
.write(data.trimIndent())
|
||||
}
|
||||
|
||||
private fun buildPluginSet(expiredPluginIds: Array<String> = emptyArray(), disabledPluginIds: Array<String> = emptyArray()) =
|
||||
PluginSetTestBuilder(pluginDirPath)
|
||||
.withExpiredPlugins(*expiredPluginIds)
|
||||
|
||||
Reference in New Issue
Block a user