use of com.intellij.ide.plugins.InstalledPluginsState in project intellij-community by JetBrains.
the class UpdatePluginsFromCustomRepositoryTest method testOnlyCompatiblePluginsAreChecked.
@Test
public void testOnlyCompatiblePluginsAreChecked() throws Exception {
Map<PluginId, PluginDownloader> toUpdate = new LinkedHashMap<>();
IdeaPluginDescriptor[] descriptors = new IdeaPluginDescriptor[] { loadDescriptor("plugin1.xml"), loadDescriptor("plugin2.xml") };
BuildNumber currentBuildNumber = BuildNumber.fromString("IU-142.100");
for (IdeaPluginDescriptor descriptor : descriptors) {
PluginDownloader downloader = PluginDownloader.createDownloader(descriptor, null, currentBuildNumber);
UpdateChecker.checkAndPrepareToInstall(downloader, new InstalledPluginsState(), toUpdate, new ArrayList<>(), null);
}
assertEquals("Found: " + toUpdate.size(), 1, toUpdate.size());
PluginDownloader downloader = toUpdate.values().iterator().next();
assertNotNull(downloader);
assertEquals("0.1", downloader.getPluginVersion());
}
Aggregations