diff options
Diffstat (limited to 'sonar-squid/src')
7 files changed, 20 insertions, 23 deletions
diff --git a/sonar-squid/src/test/java/org/sonar/squid/measures/AbstractnessFormulaTest.java b/sonar-squid/src/test/java/org/sonar/squid/measures/AbstractnessFormulaTest.java index 9aa726b1246..a3705488374 100644 --- a/sonar-squid/src/test/java/org/sonar/squid/measures/AbstractnessFormulaTest.java +++ b/sonar-squid/src/test/java/org/sonar/squid/measures/AbstractnessFormulaTest.java @@ -30,7 +30,7 @@ import static org.junit.Assert.assertEquals; public class AbstractnessFormulaTest { AbstractnessFormula abstractness = new AbstractnessFormula(); - Measurable measurable = new SourcePackage("pac1"); + Measurable<Metric> measurable = new SourcePackage("pac1"); @Test public void testCalculate() { @@ -40,7 +40,7 @@ public class AbstractnessFormulaTest { assertEquals(0.2, abstractness.calculate(measurable), 0); } - + @Test public void testCalculateOnEmptyProject() { measurable.setMeasure(Metric.CLASSES, 0); diff --git a/sonar-squid/src/test/java/org/sonar/squid/measures/CommentLinesDensityFormulaTest.java b/sonar-squid/src/test/java/org/sonar/squid/measures/CommentLinesDensityFormulaTest.java index 28a4a44fcab..496d62ce963 100644 --- a/sonar-squid/src/test/java/org/sonar/squid/measures/CommentLinesDensityFormulaTest.java +++ b/sonar-squid/src/test/java/org/sonar/squid/measures/CommentLinesDensityFormulaTest.java @@ -25,11 +25,10 @@ import org.sonar.squid.api.SourceClass; import static org.junit.Assert.*; - public class CommentLinesDensityFormulaTest { - + CommentLinesDensityFormula formula = new CommentLinesDensityFormula(); - Measurable measurable = new SourceClass("com.Toto"); + Measurable<Metric> measurable = new SourceClass("com.Toto"); @Test public void calculateDensityOnEmptyFile() { @@ -37,7 +36,7 @@ public class CommentLinesDensityFormulaTest { measurable.setMeasure(Metric.COMMENT_LINES, 0); assertEquals(0, measurable.getDouble(Metric.COMMENT_LINES_DENSITY), 0.01); } - + @Test public void calculate() { measurable.setMeasure(Metric.LINES_OF_CODE, 10); diff --git a/sonar-squid/src/test/java/org/sonar/squid/measures/CommentLinesWithoutHeaderFormulaTest.java b/sonar-squid/src/test/java/org/sonar/squid/measures/CommentLinesWithoutHeaderFormulaTest.java index 886184546fd..9fb255e3e2c 100644 --- a/sonar-squid/src/test/java/org/sonar/squid/measures/CommentLinesWithoutHeaderFormulaTest.java +++ b/sonar-squid/src/test/java/org/sonar/squid/measures/CommentLinesWithoutHeaderFormulaTest.java @@ -27,8 +27,8 @@ import static org.junit.Assert.assertEquals; public class CommentLinesWithoutHeaderFormulaTest { - CommentLinesWithoutHeaderFormula formula = new CommentLinesWithoutHeaderFormula(); - Measurable measurable = new SourceClass("com.Toto"); + CommentLinesWithoutHeaderFormula formula = new CommentLinesWithoutHeaderFormula(); + Measurable<Metric> measurable = new SourceClass("com.Toto"); @Test public void calculateDensityOnEmptyFile() { diff --git a/sonar-squid/src/test/java/org/sonar/squid/measures/DistanceFormulaTest.java b/sonar-squid/src/test/java/org/sonar/squid/measures/DistanceFormulaTest.java index f4d4f39eb42..406fb261171 100644 --- a/sonar-squid/src/test/java/org/sonar/squid/measures/DistanceFormulaTest.java +++ b/sonar-squid/src/test/java/org/sonar/squid/measures/DistanceFormulaTest.java @@ -27,8 +27,8 @@ import static org.junit.Assert.assertEquals; public class DistanceFormulaTest { - DistanceFormula distance = new DistanceFormula(); - Measurable measurable = new SourcePackage("pac1"); + DistanceFormula distance = new DistanceFormula(); + Measurable<Metric> measurable = new SourcePackage("pac1"); @Test public void calculateBestDistance() { @@ -38,7 +38,7 @@ public class DistanceFormulaTest { measurable.setMeasure(Metric.CE, 10); assertEquals(0.5, measurable.getDouble(Metric.DISTANCE), 0.01); } - + @Test public void calculateWorstDistance() { measurable.setMeasure(Metric.CLASSES, 5); diff --git a/sonar-squid/src/test/java/org/sonar/squid/measures/InstabilityFormulaTest.java b/sonar-squid/src/test/java/org/sonar/squid/measures/InstabilityFormulaTest.java index 641f227695c..92f3aca2ace 100644 --- a/sonar-squid/src/test/java/org/sonar/squid/measures/InstabilityFormulaTest.java +++ b/sonar-squid/src/test/java/org/sonar/squid/measures/InstabilityFormulaTest.java @@ -27,8 +27,8 @@ import static org.junit.Assert.assertEquals; public class InstabilityFormulaTest { - InstabilityFormula distance = new InstabilityFormula(); - Measurable measurable = new SourcePackage("pac1"); + InstabilityFormula distance = new InstabilityFormula(); + Measurable<Metric> measurable = new SourcePackage("pac1"); @Test public void calculateBestStability() { @@ -36,14 +36,14 @@ public class InstabilityFormulaTest { measurable.setMeasure(Metric.CE, 0); assertEquals(0, measurable.getDouble(Metric.INSTABILITY), 0.01); } - + @Test public void calculateWorstStability() { measurable.setMeasure(Metric.CA, 0); measurable.setMeasure(Metric.CE, 10); assertEquals(1, measurable.getDouble(Metric.INSTABILITY), 0.01); } - + @Test public void calculateOnIsolatedProject() { measurable.setMeasure(Metric.CA, 0); diff --git a/sonar-squid/src/test/java/org/sonar/squid/measures/MeanAggregationFormulaTest.java b/sonar-squid/src/test/java/org/sonar/squid/measures/MeanAggregationFormulaTest.java index 84d8ace882d..80796ff9be1 100644 --- a/sonar-squid/src/test/java/org/sonar/squid/measures/MeanAggregationFormulaTest.java +++ b/sonar-squid/src/test/java/org/sonar/squid/measures/MeanAggregationFormulaTest.java @@ -28,9 +28,8 @@ import static org.junit.Assert.*; import org.sonar.squid.api.SourceClass; - public class MeanAggregationFormulaTest { - + MeanAggregationFormula formula = new MeanAggregationFormula(); @Test @@ -42,10 +41,10 @@ public class MeanAggregationFormulaTest { SourceClass class2 = new SourceClass("com.My"); class2.setMeasure(Metric.COMPLEXITY, 3); measurables.add(class2); - + assertEquals(2.5, formula.aggregate(Metric.COMPLEXITY, measurables), 0.01); } - + @Test public void testAggregateEmptyCollections() { List<Measurable> measurables = new ArrayList<Measurable>(); diff --git a/sonar-squid/src/test/java/org/sonar/squid/measures/PublicDocumentedApiDensityFormulaTest.java b/sonar-squid/src/test/java/org/sonar/squid/measures/PublicDocumentedApiDensityFormulaTest.java index bf20ee2c419..bfc38bba206 100644 --- a/sonar-squid/src/test/java/org/sonar/squid/measures/PublicDocumentedApiDensityFormulaTest.java +++ b/sonar-squid/src/test/java/org/sonar/squid/measures/PublicDocumentedApiDensityFormulaTest.java @@ -25,11 +25,10 @@ import org.sonar.squid.api.SourceClass; import static org.junit.Assert.*; - public class PublicDocumentedApiDensityFormulaTest { - + PublicDocumentedApiDensityFormula formula = new PublicDocumentedApiDensityFormula(); - Measurable measurable = new SourceClass("com.Toto"); + Measurable<Metric> measurable = new SourceClass("com.Toto"); @Test public void calculateWhenNoPublicApi() { @@ -37,7 +36,7 @@ public class PublicDocumentedApiDensityFormulaTest { measurable.setMeasure(Metric.PUBLIC_DOC_API, 0); assertEquals(1, measurable.getDouble(Metric.PUBLIC_DOCUMENTED_API_DENSITY), 0.01); } - + @Test public void calculate() { measurable.setMeasure(Metric.PUBLIC_API, 10); |