diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-05-20 10:10:34 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-05-21 00:00:49 +0200 |
commit | 921963613e862a3749cda659f5a9f8d4813ca13c (patch) | |
tree | 092be658d2d2852770118eb5426f89e167eb9b55 /sonar-plugin-api | |
parent | 6e9f4404b707c8cd5d9f77a593fcb1aaf6293351 (diff) | |
download | sonarqube-921963613e862a3749cda659f5a9f8d4813ca13c.tar.gz sonarqube-921963613e862a3749cda659f5a9f8d4813ca13c.zip |
SONAR-6278 Stop relying on graph to store tests
Diffstat (limited to 'sonar-plugin-api')
11 files changed, 34 insertions, 75 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/Component.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/Component.java index 098b469a172..9ae9872d603 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/Component.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/Component.java @@ -21,6 +21,10 @@ package org.sonar.api.component; import javax.annotation.CheckForNull; +/** + * @deprecated since 5.2 + */ +@Deprecated public interface Component { String key(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/MutablePerspective.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/MutablePerspective.java deleted file mode 100644 index 8395148c9cf..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/MutablePerspective.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 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.component; - -public interface MutablePerspective extends Perspective { -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspective.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspective.java index 9f5395c0a02..10bbed9a754 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspective.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspective.java @@ -19,6 +19,9 @@ */ package org.sonar.api.component; +/** + * @deprecated since 5.2 + */ +@Deprecated public interface Perspective<C extends Component> { - C component(); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspectives.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspectives.java deleted file mode 100644 index 58eff623a4e..00000000000 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/Perspectives.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 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.component; - -import org.sonar.api.batch.BatchSide; -import org.sonar.api.server.ServerSide; - -/** - * @deprecated since 5.2 unused - */ -@Deprecated -@BatchSide -@ServerSide -public interface Perspectives { - - <P extends Perspective> P as(Class<P> perspectiveClass, Component component); - -} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java index 18bce8f9e36..c14cf64d622 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java @@ -19,8 +19,10 @@ */ package org.sonar.api.component; +import javax.annotation.CheckForNull; import org.sonar.api.batch.fs.InputFile; import org.sonar.api.batch.fs.InputPath; +import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.issue.Issuable; import org.sonar.api.resources.Resource; import org.sonar.api.source.Highlightable; @@ -28,8 +30,6 @@ import org.sonar.api.source.Symbolizable; import org.sonar.api.test.TestPlan; import org.sonar.api.test.Testable; -import javax.annotation.CheckForNull; - /** * Use this component to create perspective from resources or {@link InputPath} * Only on batch-side. @@ -57,8 +57,10 @@ import javax.annotation.CheckForNull; * @see Testable * @see TestPlan * @since 3.5 + * @deprecated since 5.2. Use appropriate methods on {@link SensorContext}. */ -public interface ResourcePerspectives extends Perspectives { +@Deprecated +public interface ResourcePerspectives { @CheckForNull <P extends Perspective> P as(Class<P> perspectiveClass, Resource resource); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestCase.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestCase.java index 50a5e0c21ff..05e528885ba 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestCase.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestCase.java @@ -19,9 +19,9 @@ */ package org.sonar.api.test; -import javax.annotation.Nullable; - import java.util.List; +import javax.annotation.Nullable; +import org.sonar.api.batch.fs.InputFile; public interface MutableTestCase extends TestCase { MutableTestCase setStatus(@Nullable Status s); @@ -38,5 +38,11 @@ public interface MutableTestCase extends TestCase { @Deprecated MutableTestCase setType(@Nullable String s); + /** + * @deprecated since 5.2. Use {@link #setCoverageBlock(InputFile, List)} + */ + @Deprecated MutableTestCase setCoverageBlock(Testable testable, List<Integer> lines); + + MutableTestCase setCoverageBlock(InputFile mainFile, List<Integer> lines); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestPlan.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestPlan.java index 4659917f0ee..020606d412b 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestPlan.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestPlan.java @@ -19,15 +19,13 @@ */ package org.sonar.api.test; -import org.sonar.api.component.MutablePerspective; - -public interface MutableTestPlan extends TestPlan<MutableTestCase>, MutablePerspective { +public interface MutableTestPlan extends TestPlan<MutableTestCase> { /** * Add a {@link TestCase} to this test file. * Note that a same physical test (for example in Java a single method annotated with @Test) * can be executed several times (parameterized tests, different test suites, ...). As a result it is perfectly valid to register several - * tests with the same name. Anyway in this situation the coverage per test. + * tests with the same name. Anyway in this situation the coverage per test will be merged for all tests with the same name. * @param name * @return */ diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestable.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestable.java index be9c30892b1..c1812cef41e 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestable.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/test/MutableTestable.java @@ -19,8 +19,6 @@ */ package org.sonar.api.test; -import org.sonar.api.component.MutablePerspective; - -public interface MutableTestable extends Testable, MutablePerspective { +public interface MutableTestable extends Testable { } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/TestCase.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/TestCase.java index 301d347f9af..f7296c4cf6c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/TestCase.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/test/TestCase.java @@ -23,8 +23,9 @@ import javax.annotation.CheckForNull; import javax.annotation.Nullable; /** - * Represents a simple test execution result. + * @deprecated since 5.2 not used */ +@Deprecated public interface TestCase { enum Status { OK, FAILURE, ERROR, SKIPPED; @@ -75,5 +76,6 @@ public interface TestCase { Iterable<CoverageBlock> coverageBlocks(); + @CheckForNull CoverageBlock coverageBlock(Testable testable); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/TestPlan.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/TestPlan.java index 74b4291598e..ac1655c1522 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/TestPlan.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/test/TestPlan.java @@ -22,8 +22,9 @@ package org.sonar.api.test; import org.sonar.api.component.Perspective; /** - * A {@link TestPlan} is + * @deprecated since 5.2 not used */ +@Deprecated public interface TestPlan<T extends TestCase> extends Perspective { Iterable<T> testCases(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/test/Testable.java b/sonar-plugin-api/src/main/java/org/sonar/api/test/Testable.java index 7091b6bee86..7b1c0c35a68 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/test/Testable.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/test/Testable.java @@ -19,12 +19,15 @@ */ package org.sonar.api.test; -import org.sonar.api.component.Perspective; - import java.util.List; import java.util.Map; import java.util.SortedSet; +import org.sonar.api.component.Perspective; +/** + * @deprecated since 5.2 + */ +@Deprecated public interface Testable extends Perspective { List<TestCase> testCases(); |