aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-pmd-plugin
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-03-25 02:56:46 +0300
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-04-04 22:46:21 +0400
commitd4bb3b72f9e188c93d0857d478a3ebc6f52365c1 (patch)
tree0109f7c074ad54661ff60d89bfab215ac3fa02a5 /plugins/sonar-pmd-plugin
parent628bb6718fc76baba8f452691cfc983a000e1397 (diff)
downloadsonarqube-d4bb3b72f9e188c93d0857d478a3ebc6f52365c1.tar.gz
sonarqube-d4bb3b72f9e188c93d0857d478a3ebc6f52365c1.zip
SONAR-1898 Introduce new entry point - SonarPlugin
Diffstat (limited to 'plugins/sonar-pmd-plugin')
-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
2 files changed, 42 insertions, 19 deletions
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));
+ }
+
+}