diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-12-14 18:17:47 +0100 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-12-14 18:17:47 +0100 |
commit | f0fa06b6f52c87002e186a054b0ca7e41a04913f (patch) | |
tree | ac78d61573096b39ebc07f000f0405aa0954217f /sonar-server | |
parent | 7979e9dbfe01931c771f9fd8d13bc8a65cbb49d7 (diff) | |
download | sonarqube-f0fa06b6f52c87002e186a054b0ca7e41a04913f.tar.gz sonarqube-f0fa06b6f52c87002e186a054b0ca7e41a04913f.zip |
SONAR-1929 Improve the Dashboard template API
Use of enum instead of simple String constants.
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedDashboards.java | 4 | ||||
-rw-r--r-- | sonar-server/src/test/java/org/sonar/server/startup/RegisterProvidedDashboardsTest.java | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedDashboards.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedDashboards.java index 96cb9f7fa50..afe2d447b45 100644 --- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedDashboards.java +++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterProvidedDashboards.java @@ -37,8 +37,8 @@ import org.sonar.core.i18n.I18nManager; import org.sonar.persistence.dashboard.ActiveDashboardDao; import org.sonar.persistence.dashboard.ActiveDashboardDto; import org.sonar.persistence.dashboard.DashboardDao; -import org.sonar.persistence.template.LoadedTemplateDto; import org.sonar.persistence.template.LoadedTemplateDao; +import org.sonar.persistence.template.LoadedTemplateDto; import com.google.common.collect.Lists; @@ -128,7 +128,7 @@ public final class RegisterProvidedDashboards { dashboardDataModel.setKey(dashboard.getId()); dashboardDataModel.setName(i18nManager.message(Locale.ENGLISH, "dashboard." + dashboard.getId() + ".name", dashboard.getName())); dashboardDataModel.setDescription(dashboard.getDescription()); - dashboardDataModel.setColumnLayout(dashboard.getLayout()); + dashboardDataModel.setColumnLayout(dashboard.getLayout().toString()); dashboardDataModel.setShared(true); dashboardDataModel.setCreatedAt(now); dashboardDataModel.setUpdatedAt(now); diff --git a/sonar-server/src/test/java/org/sonar/server/startup/RegisterProvidedDashboardsTest.java b/sonar-server/src/test/java/org/sonar/server/startup/RegisterProvidedDashboardsTest.java index 52919c27447..a7815f16e51 100644 --- a/sonar-server/src/test/java/org/sonar/server/startup/RegisterProvidedDashboardsTest.java +++ b/sonar-server/src/test/java/org/sonar/server/startup/RegisterProvidedDashboardsTest.java @@ -37,14 +37,15 @@ import java.util.Locale; import org.junit.Before; import org.junit.Test; import org.sonar.api.web.dashboard.Dashboard; +import org.sonar.api.web.dashboard.DashboardLayout; import org.sonar.api.web.dashboard.DashboardTemplate; import org.sonar.core.i18n.I18nManager; import org.sonar.persistence.dashboard.ActiveDashboardDao; import org.sonar.persistence.dashboard.ActiveDashboardDto; import org.sonar.persistence.dashboard.DashboardDao; import org.sonar.persistence.dashboard.WidgetDto; -import org.sonar.persistence.template.LoadedTemplateDto; import org.sonar.persistence.template.LoadedTemplateDao; +import org.sonar.persistence.template.LoadedTemplateDto; import com.google.common.collect.Lists; @@ -190,7 +191,7 @@ public class RegisterProvidedDashboardsTest { @Override public Dashboard createDashboard() { - Dashboard dashboard = Dashboard.createDashboard("fake-dashboard", "Fake", "30%-70%"); + Dashboard dashboard = Dashboard.createDashboard("fake-dashboard", "Fake", DashboardLayout.TWO_COLUMNS_30_70); org.sonar.api.web.dashboard.Widget widget = dashboard.addWidget("fake-widget", 12, 13); widget.addProperty("fake-property", "fake_metric"); return dashboard; |