diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-03-25 02:56:46 +0300 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-04-04 22:46:21 +0400 |
commit | d4bb3b72f9e188c93d0857d478a3ebc6f52365c1 (patch) | |
tree | 0109f7c074ad54661ff60d89bfab215ac3fa02a5 /plugins/sonar-squid-java-plugin/src | |
parent | 628bb6718fc76baba8f452691cfc983a000e1397 (diff) | |
download | sonarqube-d4bb3b72f9e188c93d0857d478a3ebc6f52365c1.tar.gz sonarqube-d4bb3b72f9e188c93d0857d478a3ebc6f52365c1.zip |
SONAR-1898 Introduce new entry point - SonarPlugin
Diffstat (limited to 'plugins/sonar-squid-java-plugin/src')
2 files changed, 4 insertions, 24 deletions
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)); } } |