aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-12-10 18:24:52 +0000
committerGodin <mandrikov@gmail.com>2010-12-10 18:24:52 +0000
commitd4faa4b6767b2b23652cf479307124010545a8d9 (patch)
tree9ce45fec84c98653005d8ac3b7f34b943a41af1d /tests/integration
parentddbaf492be30974ce54995ce0927d598e4128552 (diff)
downloadsonarqube-d4faa4b6767b2b23652cf479307124010545a8d9.tar.gz
sonarqube-d4faa4b6767b2b23652cf479307124010545a8d9.zip
Add IT for SONAR-2041
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/tests/src/it/java/org/sonar/tests/integration/Struts139Test.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/integration/tests/src/it/java/org/sonar/tests/integration/Struts139Test.java b/tests/integration/tests/src/it/java/org/sonar/tests/integration/Struts139Test.java
index 25120ad51f6..c350bfc721f 100644
--- a/tests/integration/tests/src/it/java/org/sonar/tests/integration/Struts139Test.java
+++ b/tests/integration/tests/src/it/java/org/sonar/tests/integration/Struts139Test.java
@@ -29,6 +29,7 @@ import java.util.Date;
import java.util.List;
import static org.hamcrest.core.Is.is;
+import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.number.OrderingComparisons.greaterThan;
import static org.hamcrest.number.IsCloseTo.closeTo;
import static org.hamcrest.number.OrderingComparisons.greaterThanOrEqualTo;
@@ -178,6 +179,17 @@ public class Struts139Test {
assertThat(version.getCategory(), is("Version"));
}
+ /**
+ * See http://jira.codehaus.org/browse/SONAR-2041
+ */
+ @Test
+ public void unknownMetric() {
+ assertThat(getProjectMeasure("notfound"), nullValue());
+ assertThat(getCoreModuleMeasure("notfound"), nullValue());
+ assertThat(getPackageMeasure("notfound"), nullValue());
+ assertThat(getFileMeasure("notfound"), nullValue());
+ }
+
private Measure getFileMeasure(String metricKey) {
return sonar.find(ResourceQuery.createForMetrics(FILE_ACTION, metricKey)).getMeasure(metricKey);
}
@@ -189,7 +201,7 @@ public class Struts139Test {
private Measure getProjectMeasure(String metricKey) {
return sonar.find(ResourceQuery.createForMetrics(PROJECT_STRUTS, metricKey)).getMeasure(metricKey);
}
-
+
private Measure getPackageMeasure(String metricKey) {
return sonar.find(ResourceQuery.createForMetrics(PACKAGE_ACTION, metricKey)).getMeasure(metricKey);
}