diff options
4 files changed, 38 insertions, 12 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java index 0a136a4fcef..565df44a269 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java @@ -30,7 +30,6 @@ import org.sonar.api.notifications.NotificationDispatcherMetadata; import org.sonar.api.resources.Java; import org.sonar.core.timemachine.Periods; import org.sonar.plugins.core.batch.IndexProjectPostJob; -import org.sonar.plugins.core.batch.MavenInitializer; import org.sonar.plugins.core.charts.DistributionAreaChart; import org.sonar.plugins.core.charts.DistributionBarChart; import org.sonar.plugins.core.charts.XradarChart; @@ -413,9 +412,6 @@ public final class CorePlugin extends SonarPlugin { UserManagedMetrics.class, Periods.class, - // maven - MavenInitializer.class, - // languages Java.class, @@ -521,15 +517,15 @@ public final class CorePlugin extends SonarPlugin { // Notify incoming violations on my favourite projects NewViolationsOnMyFavouriteProject.class, NotificationDispatcherMetadata.create("NewViolationsOnMyFavouriteProject") - .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, "true"), + .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, String.valueOf(true)), // Notify alerts on my favourite projects AlertsOnMyFavouriteProject.class, NotificationDispatcherMetadata.create("AlertsOnMyFavouriteProject") - .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, "true"), + .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, String.valueOf(true)), // Notify reviews changes ChangesInReviewAssignedToMeOrCreatedByMe.class, NotificationDispatcherMetadata.create("ChangesInReviewAssignedToMeOrCreatedByMe") - .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, "true") - .setProperty(NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION, "true")); + .setProperty(NotificationDispatcherMetadata.GLOBAL_NOTIFICATION, String.valueOf(true)) + .setProperty(NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION, String.valueOf(true))); } } diff --git a/sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java b/sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java index ef4be64798e..97129dd9503 100644 --- a/sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java +++ b/sonar-core/src/main/java/org/sonar/core/test/DefaultTestCase.java @@ -26,7 +26,6 @@ import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Vertex; import org.sonar.api.test.CoverageBlock; import org.sonar.api.test.MutableTestCase; -import org.sonar.api.test.MutableTestPlan; import org.sonar.api.test.TestPlan; import org.sonar.api.test.Testable; import org.sonar.api.test.exception.CoverageAlreadyExistsException; @@ -98,7 +97,7 @@ public class DefaultTestCase extends BeanVertex implements MutableTestCase { } public MutableTestCase setCoverageBlock(Testable testable, List<Integer> lines) { - if (coverageBlock(testable)!=null) { + if (coverageBlock(testable) != null) { throw new CoverageAlreadyExistsException("The link between " + name() + " and " + testable.component().key() + " already exists"); } beanGraph().getUnderlyingGraph().addEdge(null, element(), ((BeanVertex) testable).element(), "covers").setProperty("lines", lines); 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 0eb710cb796..90629bae049 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 @@ -21,8 +21,6 @@ package org.sonar.api.test; import org.sonar.api.component.Perspective; -import java.util.List; - public interface TestPlan<T extends TestCase> extends Perspective { Iterable<T> testCases(); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/test/TestCaseTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/test/TestCaseTest.java new file mode 100644 index 00000000000..5b3c80074b8 --- /dev/null +++ b/sonar-plugin-api/src/test/java/org/sonar/api/test/TestCaseTest.java @@ -0,0 +1,33 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2012 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.api.test; + +import org.junit.Test; + +import static org.fest.assertions.Assertions.assertThat; + +public class TestCaseTest { + @Test + public void value_of_status() { + assertThat(TestCase.Status.of("OK")).isEqualTo(TestCase.Status.OK); + assertThat(TestCase.Status.of("OK")).isEqualTo(TestCase.Status.OK); + assertThat(TestCase.Status.of(null)).isNull(); + } +} |