aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-01-29 14:05:53 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-01-29 14:06:10 +0100
commit16dee1a8ef024b31bf04e699e4ff166dec4a352b (patch)
treeed8d228982e10d2a6a3e4afc3a5abe55f617b10b /sonar-core
parent8d597284b1ccf0024bee5b0b86989d3df49910df (diff)
downloadsonarqube-16dee1a8ef024b31bf04e699e4ff166dec4a352b.tar.gz
sonarqube-16dee1a8ef024b31bf04e699e4ff166dec4a352b.zip
SONAR-4092 Renamed covererdBlocks by coveredLines and sort tests by name
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java8
-rw-r--r--sonar-core/src/main/java/org/sonar/core/test/DefaultTestable.java13
2 files changed, 14 insertions, 7 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java b/sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java
index 1bb55ed23cd..23e2789d4ff 100644
--- a/sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java
+++ b/sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java
@@ -116,20 +116,20 @@ public class DefaultTestCase extends BeanVertex implements MutableTestCase {
return beanGraph().wrap(plan, DefaultTestPlan.class);
}
- public boolean hasCoveredBlocks(){
+ public boolean hasCoveredLines(){
return Iterables.size(element().getEdges(Direction.OUT, "covers")) > 0;
}
- public int countCoveredBlocks() {
+ public int countCoveredLines() {
int coveredBlocks = 0;
for (Edge edge : element().getEdges(Direction.OUT, "covers")){
- List<String> lines = (List<String>) edge.getProperty("lines");
+ List<Integer> lines = (List<Integer>) edge.getProperty("lines");
coveredBlocks = coveredBlocks + lines.size();
}
return coveredBlocks;
}
- public Collection<CoveredTestable> coveredBlocks() {
+ public Collection<CoveredTestable> coveredTestable() {
return null;
}
}
diff --git a/sonar-core/src/main/java/org/sonar/core/test/DefaultTestable.java b/sonar-core/src/main/java/org/sonar/core/test/DefaultTestable.java
index dc46198fff1..d2e72ae271c 100644
--- a/sonar-core/src/main/java/org/sonar/core/test/DefaultTestable.java
+++ b/sonar-core/src/main/java/org/sonar/core/test/DefaultTestable.java
@@ -20,6 +20,7 @@
package org.sonar.core.test;
import com.tinkerpop.blueprints.Direction;
+import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
import org.sonar.api.component.Component;
import org.sonar.api.test.MutableTestable;
@@ -31,6 +32,8 @@ import org.sonar.core.graph.GraphUtil;
import java.util.List;
import java.util.SortedSet;
+import static com.google.common.collect.Sets.newTreeSet;
+
public class DefaultTestable extends BeanVertex implements MutableTestable {
public Component component() {
@@ -47,8 +50,12 @@ public class DefaultTestable extends BeanVertex implements MutableTestable {
}
public SortedSet<Integer> coveredLines() {
- return null;
+ SortedSet<Integer> coveredLines = newTreeSet();
+ for (Edge edge : element().getEdges(Direction.IN, "covers")){
+ List<Integer> lines = (List<Integer>) edge.getProperty("lines");
+ coveredLines.addAll(lines);
+ }
+ return coveredLines;
}
-
-}
+} \ No newline at end of file