aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-09-24 16:32:51 +0000
committerGodin <mandrikov@gmail.com>2010-09-24 16:32:51 +0000
commitcea7dd429645b3c86a7810f8bfc74cbbfb0955c9 (patch)
tree0a003ae8447de1512230435d3f3a9327c1708b51 /sonar-server
parentc0c61a4e995fb8c5dfd33620784142861f34b0be (diff)
downloadsonarqube-cea7dd429645b3c86a7810f8bfc74cbbfb0955c9.tar.gz
sonarqube-cea7dd429645b3c86a7810f8bfc74cbbfb0955c9.zip
SONAR-1634: Provide meaningful error message, when plugin tries to define metric, which already defined in other plugin or in core
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java b/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java
index adfa7485c3a..2f2244e938a 100644
--- a/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java
@@ -19,20 +19,20 @@
*/
package org.sonar.server.startup;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import org.junit.Test;
-import org.sonar.jpa.dao.MeasuresDao;
-import org.sonar.jpa.test.AbstractDbUnitTestCase;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Metric;
+import org.sonar.jpa.dao.MeasuresDao;
+import org.sonar.jpa.test.AbstractDbUnitTestCase;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
public class RegisterMetricsTest extends AbstractDbUnitTestCase {
@Test
@@ -41,7 +41,7 @@ public class RegisterMetricsTest extends AbstractDbUnitTestCase {
Metric metric1 = new Metric("new1", "short1", "desc1", Metric.ValueType.FLOAT, 1, true, "domain1", false);
Metric metric2 = new Metric("new2", "short2", "desc2", Metric.ValueType.FLOAT, 1, true, "domain2", false);
- RegisterMetrics synchronizer = new RegisterMetrics(getSession(), new MeasuresDao(getSession()), null);
+ RegisterMetrics synchronizer = new RegisterMetrics(getSession(), new MeasuresDao(getSession()), null, null);
synchronizer.register(Arrays.asList(metric1, metric2));
checkTables("shouldSaveIfNew", "metrics");
}
@@ -52,7 +52,7 @@ public class RegisterMetricsTest extends AbstractDbUnitTestCase {
final List<Metric> metrics = new ArrayList<Metric>();
metrics.add(new Metric("key", "new short name", "new description", Metric.ValueType.FLOAT, -1, true, "new domain", false));
- RegisterMetrics synchronizer = new RegisterMetrics(getSession(), new MeasuresDao(getSession()), null);
+ RegisterMetrics synchronizer = new RegisterMetrics(getSession(), new MeasuresDao(getSession()), null, null);
synchronizer.register(metrics);
checkTables("shouldUpdateIfAlreadyExists", "metrics");
@@ -62,7 +62,7 @@ public class RegisterMetricsTest extends AbstractDbUnitTestCase {
public void enableOnlyLoadedMetrics() throws SQLException {
setupData("enableOnlyLoadedMetrics");
- RegisterMetrics loader = new RegisterMetrics(getSession(), new MeasuresDao(getSession()), null);
+ RegisterMetrics loader = new RegisterMetrics(getSession(), new MeasuresDao(getSession()), null, null);
loader.start();
assertFalse(getDao().getMeasuresDao().getMetric("deprecated").getEnabled());
@@ -73,7 +73,7 @@ public class RegisterMetricsTest extends AbstractDbUnitTestCase {
public void cleanAlerts() throws SQLException {
setupData("cleanAlerts");
- RegisterMetrics loader = new RegisterMetrics(getSession(), new MeasuresDao(getSession()), null);
+ RegisterMetrics loader = new RegisterMetrics(getSession(), new MeasuresDao(getSession()), null, null);
loader.cleanAlerts();
checkTables("cleanAlerts", "metrics", "alerts");