plugin manager: test to ensure declared module contract

GitOrigin-RevId: 198f034e5a3d7199bf2ddeb6d505621c4de9d73b
This commit is contained in:
Anna Kozlova
2020-04-14 12:01:57 +00:00
committed by intellij-monorepo-bot
parent ca0f7587db
commit e46cd16b38
2 changed files with 15 additions and 0 deletions
@@ -0,0 +1,5 @@
<idea-plugin>
<id>my.plugin</id>
<version>0.1.0</version>
<module value="foo.bar"/>
</idea-plugin>
@@ -122,6 +122,16 @@ public class PluginManagerTest {
doPluginSortTest("ultimatePlugins", true);
}
@Test
public void testModulePluginIdContract() throws Exception {
Path pluginsPath = Paths.get(PlatformTestUtil.getPlatformTestDataPath(), "plugins", "withModules");
IdeaPluginDescriptorImpl descriptorBundled = loadDescriptorInTest(pluginsPath, Collections.emptySet(), true);
Map<PluginId, IdeaPluginDescriptorImpl> idMap = PluginManagerCore.buildPluginIdMap(Collections.singletonList(descriptorBundled));
PluginId moduleId = PluginId.getId("foo.bar");
PluginId corePlugin = PluginId.getId("my.plugin");
assertEquals(corePlugin, idMap.get(moduleId).getPluginId());
}
@Test
public void testIdentifyPreInstalledPlugins() {
Path pluginsPath = Paths.get(PlatformTestUtil.getPlatformTestDataPath(), "plugins", "updatedBundled");