aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstylePlugin.java17
-rw-r--r--plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstylePluginTest.java6
-rw-r--r--plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaPlugin.java19
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java21
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java16
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java21
-rw-r--r--plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java19
-rw-r--r--plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java33
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java15
-rw-r--r--plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsPluginTest.java34
-rw-r--r--plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java18
-rw-r--r--plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdPlugin.java26
-rw-r--r--plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdPluginTest.java35
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPlugin.java21
-rw-r--r--plugins/sonar-squid-java-plugin/src/test/java/org/sonar/plugins/squid/SquidPluginTest.java7
-rw-r--r--plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefirePlugin.java14
-rw-r--r--plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefirePluginTest.java35
17 files changed, 165 insertions, 192 deletions
diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstylePlugin.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstylePlugin.java
index 3af36e2809c..070b076271d 100644
--- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstylePlugin.java
+++ b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstylePlugin.java
@@ -19,6 +19,8 @@
*/
package org.sonar.plugins.checkstyle;
+import org.sonar.api.SonarPlugin;
+
import org.sonar.api.CoreProperties;
import org.sonar.api.Plugin;
import org.sonar.api.Properties;
@@ -35,20 +37,7 @@ import java.util.List;
+ "This property allows to configure all those filters with a native XML format."
+ " See <a href='http://checkstyle.sourceforge.net/config.html'>Checkstyle configuration page</a> to get more information on those filters.",
project = false, global = true) })
-public class CheckstylePlugin implements Plugin {
-
- public String getKey() {
- return CoreProperties.CHECKSTYLE_PLUGIN;
- }
-
- public String getName() {
- return CheckstyleConstants.PLUGIN_NAME;
- }
-
- public String getDescription() {
- return "Checkstyle is a rule engine that helps programmers writing Java code that adheres to a coding standard. " +
- "You can find more by going to the <a href='http://checkstyle.sourceforge.net'>Checkstyle web site</a>.";
- }
+public class CheckstylePlugin extends SonarPlugin {
public List getExtensions() {
return Arrays.asList(
diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstylePluginTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstylePluginTest.java
index 57ecda9920d..c85bf6529be 100644
--- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstylePluginTest.java
+++ b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstylePluginTest.java
@@ -19,15 +19,15 @@
*/
package org.sonar.plugins.checkstyle;
-import org.junit.Test;
-
import static org.hamcrest.number.OrderingComparisons.greaterThan;
import static org.junit.Assert.assertThat;
+import org.junit.Test;
+
public class CheckstylePluginTest {
@Test
- public void getSonarWayProfileDefinition() {
+ public void testGetExtensions() {
CheckstylePlugin plugin = new CheckstylePlugin();
assertThat(plugin.getExtensions().size(), greaterThan(1));
}
diff --git a/plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaPlugin.java b/plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaPlugin.java
index 2ab62423cb1..91e37b6fada 100644
--- a/plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaPlugin.java
+++ b/plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaPlugin.java
@@ -38,19 +38,7 @@ import java.util.List;
description = "Maximum memory to pass to JVM of Cobertura processes",
project = true,
global = true) })
-public class CoberturaPlugin implements Plugin {
-
- public String getKey() {
- return CoreProperties.COBERTURA_PLUGIN;
- }
-
- public String getName() {
- return "Cobertura";
- }
-
- public String getDescription() {
- return "Cobertura is a tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of Java program are lacking test coverage. You can find more by going to the <a href='http://cobertura.sourceforge.net'>Cobertura web site</a>.";
- }
+public class CoberturaPlugin extends SonarPlugin {
public List<Class<? extends Extension>> getExtensions() {
List<Class<? extends Extension>> list = new ArrayList<Class<? extends Extension>>();
@@ -59,9 +47,4 @@ public class CoberturaPlugin implements Plugin {
list.add(CoberturaMavenInitializer.class);
return list;
}
-
- @Override
- public String toString() {
- return getKey();
- }
}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index 236581dc351..37281c10c46 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -21,7 +21,7 @@ package org.sonar.plugins.core;
import com.google.common.collect.Lists;
import org.sonar.api.CoreProperties;
-import org.sonar.api.Plugin;
+import org.sonar.api.SonarPlugin;
import org.sonar.api.Properties;
import org.sonar.api.Property;
import org.sonar.api.checks.NoSonarFilter;
@@ -155,19 +155,7 @@ import java.util.List;
defaultValue = CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_5
)
})
-public class CorePlugin implements Plugin {
-
- public String getKey() {
- return CoreProperties.CORE_PLUGIN;
- }
-
- public String getName() {
- return "General";
- }
-
- public String getDescription() {
- return "";
- }
+public class CorePlugin extends SonarPlugin {
public List getExtensions() {
List extensions = Lists.newLinkedList();
@@ -238,9 +226,4 @@ public class CorePlugin implements Plugin {
return extensions;
}
-
- @Override
- public String toString() {
- return getKey();
- }
}
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java
index 4950b178270..7a11a8fcd0f 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java
+++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java
@@ -20,9 +20,9 @@
package org.sonar.plugins.cpd;
import org.sonar.api.CoreProperties;
-import org.sonar.api.Plugin;
import org.sonar.api.Properties;
import org.sonar.api.Property;
+import org.sonar.api.SonarPlugin;
import org.sonar.plugins.cpd.decorators.DuplicationDensityDecorator;
import org.sonar.plugins.cpd.decorators.SumDuplicationsDecorator;
@@ -64,19 +64,7 @@ import java.util.List;
module = true,
global = true)
})
-public class CpdPlugin implements Plugin {
-
- public String getKey() {
- return CoreProperties.CPD_PLUGIN;
- }
-
- public String getName() {
- return "Duplications";
- }
-
- public String getDescription() {
- return "Find duplicated source code within project.";
- }
+public class CpdPlugin extends SonarPlugin {
public List getExtensions() {
return Arrays.asList(CpdSensor.class, SumDuplicationsDecorator.class, DuplicationDensityDecorator.class, JavaCpdMapping.class);
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java
index 68308e30f6a..f38a6c39b20 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java
@@ -19,9 +19,9 @@
*/
package org.sonar.plugins.dbcleaner;
-import org.sonar.api.Plugin;
import org.sonar.api.Properties;
import org.sonar.api.Property;
+import org.sonar.api.SonarPlugin;
import org.sonar.plugins.dbcleaner.api.DbCleanerConstants;
import org.sonar.plugins.dbcleaner.period.DefaultPeriodCleaner;
import org.sonar.plugins.dbcleaner.period.PeriodPurge;
@@ -43,24 +43,7 @@ import java.util.List;
@Property(key = DbCleanerConstants.MONTHS_BEFORE_DELETING_ALL_SNAPSHOTS, defaultValue = DbCleanerConstants.FIVE_YEARS,
name = "Number of months before starting to delete all remaining snapshots",
description = "After this number of months, all snapshots are fully deleted.", global = true, project = true)})
-public final class DbCleanerPlugin implements Plugin {
-
- @Override
- public String toString() {
- return DbCleanerConstants.PLUGIN_NAME;
- }
-
- public String getKey() {
- return DbCleanerConstants.PLUGIN_KEY;
- }
-
- public String getName() {
- return DbCleanerConstants.PLUGIN_NAME;
- }
-
- public String getDescription() {
- return "The DbCleaner optimizes the Sonar DB performances by removing old and useless quality snapshots.";
- }
+public final class DbCleanerPlugin extends SonarPlugin {
public List getExtensions() {
return Arrays.asList(
diff --git a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java
index 3b2c0464684..a53bdf72f70 100644
--- a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java
+++ b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java
@@ -40,19 +40,7 @@ import java.util.List;
project = true,
global = true)
})
-public class DesignPlugin implements Plugin {
-
- public String getKey() {
- return "design";
- }
-
- public String getName() {
- return "Design";
- }
-
- public String getDescription() {
- return "";
- }
+public class DesignPlugin extends SonarPlugin {
public List<Class<? extends Extension>> getExtensions() {
List<Class<? extends Extension>> extensions = new ArrayList<Class<? extends Extension>>();
@@ -75,9 +63,4 @@ public class DesignPlugin implements Plugin {
return extensions;
}
-
- @Override
- public String toString() {
- return getKey();
- }
}
diff --git a/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java b/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java
new file mode 100644
index 00000000000..881df3d48a9
--- /dev/null
+++ b/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java
@@ -0,0 +1,33 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.plugins.design;
+
+import static org.hamcrest.number.OrderingComparisons.greaterThan;
+import static org.junit.Assert.assertThat;
+import org.junit.Test;
+
+public class DesignPluginTest {
+
+ @Test
+ public void getExtensions() {
+ DesignPlugin plugin = new DesignPlugin();
+ assertThat(plugin.getExtensions().size(), greaterThan(1));
+ }
+}
diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java
index 994b9e46f46..c234f6b9059 100644
--- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java
+++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java
@@ -39,20 +39,7 @@ import java.util.List;
description = "Specifies the amount of time, in milliseconds, that FindBugs may run before it is assumed to be hung and is terminated. " +
"The default is 600,000 milliseconds, which is ten minutes.",
project = true, module = true, global = true) })
-public class FindbugsPlugin implements Plugin {
-
- public String getKey() {
- return CoreProperties.FINDBUGS_PLUGIN;
- }
-
- public String getName() {
- return "Findbugs";
- }
-
- public String getDescription() {
- return "FindBugs is a program that uses static analysis to look for bugs in Java code. It can detect a variety of common coding mistakes, " +
- "including thread synchronization problems, misuse of API methods... You can find more by going to the <a href='http://findbugs.sourceforge.net'>Findbugs web site</a>.";
- }
+public class FindbugsPlugin extends SonarPlugin {
public List<Class<? extends Extension>> getExtensions() {
List<Class<? extends Extension>> list = new ArrayList<Class<? extends Extension>>();
diff --git a/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsPluginTest.java b/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsPluginTest.java
new file mode 100644
index 00000000000..c70bbd1704b
--- /dev/null
+++ b/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsPluginTest.java
@@ -0,0 +1,34 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.plugins.findbugs;
+
+import static org.hamcrest.Matchers.greaterThan;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+public class FindbugsPluginTest {
+
+ @Test
+ public void testGetExtensions() {
+ assertThat(new FindbugsPlugin().getExtensions().size(), greaterThan(1));
+ }
+
+}
diff --git a/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java b/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java
index 2f667a7fb91..5c05b12d12a 100644
--- a/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java
+++ b/plugins/sonar-googleanalytics-plugin/src/main/java/org/sonar/plugins/googleanalytics/GoogleAnalyticsPlugin.java
@@ -30,19 +30,7 @@ import java.util.List;
name = "Account key",
description = "Example : UA-1234567-8")
})
-public class GoogleAnalyticsPlugin implements Plugin {
-
- public String getKey() {
- return CoreProperties.GOOGLE_ANALYTICS_PLUGIN;
- }
-
- public String getName() {
- return "Google analytics";
- }
-
- public String getDescription() {
- return "Google analytics is a tool that collects data on the traffic of web sites and then, through a powerful interface, enables to get reporting, segmentation, chart, .. on the traffic. You can find more by going to the <a href='http://www.google.com/analytics/'>Google analytics web site</a>.";
- }
+public class GoogleAnalyticsPlugin extends SonarPlugin {
public List<Class<? extends Extension>> getExtensions() {
List<Class<? extends Extension>> list = new ArrayList<Class<? extends Extension>>();
@@ -50,8 +38,4 @@ public class GoogleAnalyticsPlugin implements Plugin {
return list;
}
- @Override
- public String toString() {
- return getKey();
- }
}
diff --git a/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdPlugin.java b/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdPlugin.java
index 3db3b2687cc..89c6dbaf3b3 100644
--- a/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdPlugin.java
+++ b/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdPlugin.java
@@ -19,33 +19,21 @@
*/
package org.sonar.plugins.pmd;
+import org.sonar.api.SonarPlugin;
+
import java.util.Arrays;
import java.util.List;
-import org.sonar.api.Plugin;
-
-public class PmdPlugin implements Plugin {
-
- public String getKey() {
- return PmdConstants.PLUGIN_KEY;
- }
-
- public String getName() {
- return PmdConstants.PLUGIN_NAME;
- }
-
- public String getDescription() {
- return "PMD is a tool that looks for potential problems like possible bugs, dead code, suboptimal code, overcomplicated expressions or duplicate code. You can find more by going to the <a href='http://pmd.sourceforge.net'>PMD web site</a>.";
- }
+public class PmdPlugin extends SonarPlugin {
public List getExtensions() {
return Arrays.asList(
- PmdSensor.class,
- PmdConfiguration.class,
- PmdExecutor.class,
+ PmdSensor.class,
+ PmdConfiguration.class,
+ PmdExecutor.class,
PmdRuleRepository.class,
PmdProfileExporter.class,
- PmdProfileImporter.class,
+ PmdProfileImporter.class,
SonarWayProfile.class,
SonarWayWithFindbugsProfile.class,
SunConventionsProfile.class
diff --git a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdPluginTest.java b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdPluginTest.java
new file mode 100644
index 00000000000..fc6c73b8384
--- /dev/null
+++ b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdPluginTest.java
@@ -0,0 +1,35 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.plugins.pmd;
+
+import static org.hamcrest.number.OrderingComparisons.greaterThan;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+public class PmdPluginTest {
+
+ @Test
+ public void testGetExtensions() {
+ PmdPlugin plugin = new PmdPlugin();
+ assertThat(plugin.getExtensions().size(), greaterThan(1));
+ }
+
+}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPlugin.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPlugin.java
index 075cfd34a5a..cd7fb31c5a3 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPlugin.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPlugin.java
@@ -19,10 +19,9 @@
*/
package org.sonar.plugins.squid;
-import org.sonar.api.CoreProperties;
-import org.sonar.api.Plugin;
import org.sonar.api.Properties;
import org.sonar.api.Property;
+import org.sonar.api.SonarPlugin;
import org.sonar.plugins.squid.decorators.*;
import java.util.Arrays;
@@ -44,19 +43,7 @@ import java.util.List;
+ "The best example is a logger used by all methods of a class. " +
"All field names to exclude from LCOM4 computation must be separated by a comma.",
project = true, global = true)})
-public class SquidPlugin implements Plugin {
-
- public String getKey() {
- return CoreProperties.SQUID_PLUGIN;
- }
-
- public String getName() {
- return "Squid";
- }
-
- public String getDescription() {
- return "Squid collects standard metrics on source code, such as lines of code, cyclomatic complexity, documentation level...";
- }
+public class SquidPlugin extends SonarPlugin {
public List getExtensions() {
return Arrays.asList(SquidSensor.class, SquidRuleRepository.class, JavaSourceImporter.class,
@@ -64,8 +51,4 @@ public class SquidPlugin implements Plugin {
ChidamberKemererDistributionBuilder.class, FunctionsDecorator.class);
}
- @Override
- public String toString() {
- return getKey();
- }
}
diff --git a/plugins/sonar-squid-java-plugin/src/test/java/org/sonar/plugins/squid/SquidPluginTest.java b/plugins/sonar-squid-java-plugin/src/test/java/org/sonar/plugins/squid/SquidPluginTest.java
index 52db97389cf..49dd90cf347 100644
--- a/plugins/sonar-squid-java-plugin/src/test/java/org/sonar/plugins/squid/SquidPluginTest.java
+++ b/plugins/sonar-squid-java-plugin/src/test/java/org/sonar/plugins/squid/SquidPluginTest.java
@@ -19,18 +19,15 @@
*/
package org.sonar.plugins.squid;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
+import org.junit.Test;
+
public class SquidPluginTest {
@Test
public void coverageForFun() {
- assertThat(new SquidPlugin().getKey(), not(nullValue()));
assertThat(new SquidPlugin().getExtensions().size(), is(8));
}
}
diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefirePlugin.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefirePlugin.java
index aa15b652ced..6a637fcc1e1 100644
--- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefirePlugin.java
+++ b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefirePlugin.java
@@ -32,19 +32,7 @@ import java.util.List;
project = true,
global = false)
})
-public class SurefirePlugin implements Plugin {
-
- public String getKey() {
- return CoreProperties.SUREFIRE_PLUGIN;
- }
-
- public String getName() {
- return "Surefire";
- }
-
- public String getDescription() {
- return "<a href=' http://maven.apache.org/plugins/maven-surefire-plugin/'>Surefire</a> is a test framework for Maven.";
- }
+public class SurefirePlugin extends SonarPlugin {
public List<Class<? extends Extension>> getExtensions() {
List<Class<? extends Extension>> extensions = new ArrayList<Class<? extends Extension>>();
diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefirePluginTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefirePluginTest.java
new file mode 100644
index 00000000000..a3d19a328c1
--- /dev/null
+++ b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefirePluginTest.java
@@ -0,0 +1,35 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.plugins.surefire;
+
+import static org.hamcrest.Matchers.greaterThan;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+public class SurefirePluginTest {
+
+ @Test
+ public void testGetExtensions() {
+ SurefirePlugin plugin = new SurefirePlugin();
+ assertThat(plugin.getExtensions().size(), greaterThan(0));
+ }
+
+}