aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-design-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-design-plugin
parent628bb6718fc76baba8f452691cfc983a000e1397 (diff)
downloadsonarqube-d4bb3b72f9e188c93d0857d478a3ebc6f52365c1.tar.gz
sonarqube-d4bb3b72f9e188c93d0857d478a3ebc6f52365c1.zip
SONAR-1898 Introduce new entry point - SonarPlugin
Diffstat (limited to 'plugins/sonar-design-plugin')
-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
2 files changed, 34 insertions, 18 deletions
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));
+ }
+}