aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-06-03 11:16:23 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-06-03 11:16:23 +0200
commit507e8b9a0c214ca86722af265cb3fa81c3d0c09f (patch)
tree1e8e09d3197c8eda121a414ab57a4b9ba4118c40 /sonar-plugin-api
parent6ce3ec7f1b3f0b3c1baf823037873bdd672af4e5 (diff)
downloadsonarqube-507e8b9a0c214ca86722af265cb3fa81c3d0c09f.tar.gz
sonarqube-507e8b9a0c214ca86722af265cb3fa81c3d0c09f.zip
SONAR-4315 Add Issue Action WS and add Action links to Issue detail
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java36
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/workflow/function/CommentFunction.java35
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/workflow/function/package-info.java23
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/workflow/function/CommentFunctionTest.java43
5 files changed, 2 insertions, 139 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java
index 113b1ea7fe3..6da2f1ecbc4 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java
@@ -22,14 +22,14 @@ package org.sonar.api.issue.action;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
-import org.sonar.api.ServerComponent;
+import org.sonar.api.ServerExtension;
import org.sonar.api.issue.Issue;
import org.sonar.api.issue.condition.Condition;
import java.util.Arrays;
import java.util.List;
-public class Action implements ServerComponent {
+public class Action implements ServerExtension {
private final String key;
private final List<Condition> conditions;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java
deleted file mode 100644
index d883ab8a5c7..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.issue.action;
-
-import org.sonar.api.ServerComponent;
-
-import java.util.Set;
-
-/**
- * @since 3.6
- */
-// TODO remove it
-public interface Actions extends ServerComponent {
-
- Actions addAction(Action action);
-
- Set<Action> getActions();
-
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/workflow/function/CommentFunction.java b/sonar-plugin-api/src/main/java/org/sonar/api/workflow/function/CommentFunction.java
deleted file mode 100644
index 697e9b5f2a0..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/workflow/function/CommentFunction.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.workflow.function;
-
-import com.google.common.annotations.Beta;
-import org.sonar.api.issue.action.Function;
-
-/**
- * @since 3.1
- */
-@Beta
-public final class CommentFunction implements Function {
-
- @Override
- public void execute(Context context) {
- context.addComment("New comment!");
- }
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/workflow/function/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/workflow/function/package-info.java
deleted file mode 100644
index 3285b8fdd91..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/workflow/function/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.api.workflow.function;
-
-import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/workflow/function/CommentFunctionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/workflow/function/CommentFunctionTest.java
deleted file mode 100644
index 1d0b9ba3da6..00000000000
--- a/sonar-plugin-api/src/test/java/org/sonar/api/workflow/function/CommentFunctionTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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 this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.workflow.function;
-
-import org.junit.Test;
-
-public class CommentFunctionTest {
-
- @Test
- // TODO
- public void setTextAndUserId() {
-// CommentFunction function = new CommentFunction();
-// Map<String, String> parameters = Maps.newHashMap();
-// parameters.put("text", "foo");
-// DefaultReview review = new DefaultReview();
-// DefaultWorkflowContext context = new DefaultWorkflowContext();
-// context.setUserId(1234L);
-//
-// function.doExecute(review, new DefaultReview(), context, parameters);
-//
-// List<Comment> newComments = review.getNewComments();
-// assertThat(newComments).hasSize(1);
-// assertThat(newComments.get(0).getMarkdownText()).isEqualTo("foo");
-// assertThat(newComments.get(0).getUserId()).isEqualTo(1234L);
- }
-}