Search in sources :

Example 1 with SonarUpdate

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();
}
Also used : SonarUpdate(org.sonar.updatecenter.common.SonarUpdate)

Example 2 with SonarUpdate

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"));
}
Also used : SonarUpdate(org.sonar.updatecenter.common.SonarUpdate) Test(org.junit.Test)

Example 3 with SonarUpdate

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;
}
Also used : Sonar(org.sonar.updatecenter.common.Sonar) Release(org.sonar.updatecenter.common.Release) Plugin(org.sonar.updatecenter.common.Plugin) SonarUpdate(org.sonar.updatecenter.common.SonarUpdate)

Aggregations

SonarUpdate (org.sonar.updatecenter.common.SonarUpdate)3 Test (org.junit.Test)1 Plugin (org.sonar.updatecenter.common.Plugin)1 Release (org.sonar.updatecenter.common.Release)1 Sonar (org.sonar.updatecenter.common.Sonar)1