aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-12-13 09:01:37 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-12-13 09:01:37 +0000
commitab1f321e58cea13e35fd9986de416512c6e51c59 (patch)
tree78df733ba443a6b24d74012fb7c27905979d4db9 /tests/integration
parent3a7235c0209772229ee4bd82cb0a505729749b3a (diff)
downloadsonarqube-ab1f321e58cea13e35fd9986de416512c6e51c59.tar.gz
sonarqube-ab1f321e58cea13e35fd9986de416512c6e51c59.zip
add IT to test data measures
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/tests/src/it/java/org/sonar/tests/integration/Struts139Test.java12
1 files changed, 11 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 c350bfc721f..37194027b61 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
@@ -28,6 +28,7 @@ import org.sonar.wsclient.services.*;
import java.util.Date;
import java.util.List;
+import static junit.framework.Assert.assertTrue;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.number.OrderingComparisons.greaterThan;
@@ -144,7 +145,7 @@ public class Struts139Test {
}
@Test
- public void design() {
+ public void designMeaures() {
assertThat(getCoreModuleMeasure("package_cycles").getIntValue(), greaterThan(10));
assertThat(getCoreModuleMeasure("package_cycles").getIntValue(), lessThan(50));
@@ -158,6 +159,15 @@ public class Struts139Test {
}
@Test
+ public void shouldGetDetailsOfCoverageHits() {
+ Resource resource = sonar.find(ResourceQuery.createForMetrics("org.apache.struts:struts-core:org.apache.struts.action.ActionForward", CoreMetrics.COVERAGE_LINE_HITS_DATA_KEY));
+ Measure coverageData = resource.getMeasure(CoreMetrics.COVERAGE_LINE_HITS_DATA_KEY);
+ assertNotNull(coverageData);
+ assertThat(coverageData.getData().length(), greaterThan(10));
+ assertTrue(coverageData.getData().matches("(\\d+=\\d+;{0,1})+"));
+ }
+
+ @Test
public void dependencyTree() {
List<DependencyTree> trees = sonar.findAll(DependencyTreeQuery.createForProject(PROJECT_STRUTS));
assertThat(trees.size(), is(0));