use of org.sonar.updatecenter.common.SonarUpdate in project sonarqube by SonarSource.
the class UpgradesAction method writeUpgrades.
private void writeUpgrades(JsonWriter jsonWriter, Optional<UpdateCenter> updateCenter) {
jsonWriter.name(ARRAY_UPGRADES).beginArray();
if (updateCenter.isPresent()) {
for (SonarUpdate sonarUpdate : updateCenter.get().findSonarUpdates()) {
writeUpgrade(jsonWriter, sonarUpdate);
}
}
jsonWriter.endArray();
}
use of org.sonar.updatecenter.common.SonarUpdate in project sonarqube by SonarSource.
the class UpgradesActionTest method verify_JSON_response_against_example.
@Test
public void verify_JSON_response_against_example() throws Exception {
SonarUpdate sonarUpdate = createSonar_51_update();
when(updateCenter.findSonarUpdates()).thenReturn(of(sonarUpdate));
underTest.handle(request, response);
assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo(getClass().getResource("example-upgrades_plugins.json"));
}
use of org.sonar.updatecenter.common.SonarUpdate in project sonarqube by SonarSource.
the class UpgradesActionTest method createSonar_51_update.
private static SonarUpdate createSonar_51_update() {
Plugin brandingPlugin = Plugin.factory("branding").setCategory("Integration").setName("Branding").setDescription("Allows to add your own logo to the SonarQube UI.").setHomepageUrl("http://docs.codehaus.org/display/SONAR/Branding+Plugin").setLicense("GNU LGPL 3").setOrganization("SonarSource").setOrganizationUrl("http://www.sonarsource.com").setIssueTrackerUrl("http://jira.sonarsource.com/browse/SONARPLUGINS/component/14663").setSourcesUrl("https://github.com/SonarCommunity/sonar-branding");
Plugin viewsPlugin = Plugin.factory("views").setName("Views").setCategory("Governance").setDescription("Create aggregation trees to group projects. Projects can for instance be grouped by applications, applications by team, teams by department.").setHomepageUrl("https://redirect.sonarsource.com/plugins/views.html").setLicense("Commercial").setOrganization("SonarSource").setOrganizationUrl("http://www.sonarsource.com").setTermsConditionsUrl("http://dist.sonarsource.com/SonarSource_Terms_And_Conditions.pdf").setIssueTrackerUrl("http://jira.sonarsource.com/browse/VIEWS");
release = new Release(new Sonar(), Version.create("5.1.0.5498")).setDate(DateUtils.parseDate("2015-04-02")).setDescription("New overall layout, merge Issues Drilldown [...]").setDownloadUrl("http://dist.sonar.codehaus.org/sonarqube-5.1.zip").setChangelogUrl("http://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=11694&version=20666");
SonarUpdate sonarUpdate = new SonarUpdate(release);
sonarUpdate.addIncompatiblePlugin(brandingPlugin);
sonarUpdate.addPluginToUpgrade(new Release(viewsPlugin, Version.create("2.8.0.5498")).setDisplayVersion("2.8 (build 5498)"));
return sonarUpdate;
}
Aggregations