use of org.sonar.core.platform.PluginInfo in project sonarqube by SonarSource.
the class DebtModelPluginRepository method findAvailableXMLFiles.
private void findAvailableXMLFiles() {
if (contributingPluginKeyToClassLoader == null) {
contributingPluginKeyToClassLoader = Maps.newTreeMap();
// Add default model
contributingPluginKeyToClassLoader.put(DEFAULT_MODEL, getClass().getClassLoader());
for (PluginInfo pluginInfo : pluginRepository.getPluginInfos()) {
String pluginKey = pluginInfo.getKey();
Plugin plugin = pluginRepository.getPluginInstance(pluginKey);
ClassLoader classLoader = plugin.getClass().getClassLoader();
if (classLoader.getResource(getXMLFilePath(pluginKey)) != null) {
contributingPluginKeyToClassLoader.put(pluginKey, classLoader);
}
}
}
contributingPluginKeyToClassLoader = Collections.unmodifiableMap(contributingPluginKeyToClassLoader);
}
use of org.sonar.core.platform.PluginInfo in project sonarqube by SonarSource.
the class ScannerSettingsTest method return_license_hash_keys.
@Test
public void return_license_hash_keys() throws Exception {
PluginInfo pluginInfo = mock(PluginInfo.class);
when(pluginInfo.getKey()).thenReturn("myplugin");
when(repository.getPluginInfos()).thenReturn(singletonList(pluginInfo));
underTest.start();
assertThat(underTest.getScannerSettingKeys()).contains("sonar.myplugin.licenseHash.secured");
}
use of org.sonar.core.platform.PluginInfo in project sonarqube by SonarSource.
the class ValuesActionTest method setUp.
@Before
public void setUp() throws Exception {
PluginInfo pluginInfo = mock(PluginInfo.class);
when(pluginInfo.getKey()).thenReturn("plugin");
when(repository.getPluginInfos()).thenReturn(singletonList(pluginInfo));
scannerSettings.start();
OrganizationDto organizationDto = db.organizations().insert();
project = componentDb.insertComponent(newProjectDto(organizationDto));
}
use of org.sonar.core.platform.PluginInfo in project sonarqube by SonarSource.
the class InstalledPluginsActionTest method return_plugins_with_plugin_having_no_version.
@Test
public void return_plugins_with_plugin_having_no_version() throws Exception {
when(pluginRepository.getPluginInfos()).thenReturn(singletonList(new PluginInfo("java").setName("Java")));
String result = ws.newRequest().execute().getInput();
assertJson(result).isSimilarTo("[" + " {" + " \"key\": \"java\",\n" + " \"name\": \"Java\"\n" + " }" + "]");
}
use of org.sonar.core.platform.PluginInfo in project sonarqube by SonarSource.
the class DefaultI18nTest method newPlugin.
private PluginInfo newPlugin(String key) {
PluginInfo plugin = mock(PluginInfo.class);
when(plugin.getKey()).thenReturn(key);
return plugin;
}
Aggregations