From 303f3f29a59629ea5644043fae2e01ec57656fab Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 21 May 2015 16:57:18 +0200 Subject: [PATCH] Remove IndexViewsStep as Views is currently disabled --- .../computation/step/ComputationSteps.java | 1 - .../computation/step/IndexViewsStep.java | 43 ---------------- .../step/ComputationStepsTest.java | 5 +- .../computation/step/IndexViewsStepTest.java | 50 ------------------- 4 files changed, 2 insertions(+), 97 deletions(-) delete mode 100644 server/sonar-server/src/main/java/org/sonar/server/computation/step/IndexViewsStep.java delete mode 100644 server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexViewsStepTest.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputationSteps.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputationSteps.java index f846367ebaf..25d58b8cc40 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputationSteps.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputationSteps.java @@ -60,7 +60,6 @@ public class ComputationSteps { IndexIssuesStep.class, IndexSourceLinesStep.class, IndexTestsStep.class, - IndexViewsStep.class, // notifications are sent at the end, so that webapp displays up-to-date information SendIssueNotificationsStep.class); diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/IndexViewsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/IndexViewsStep.java deleted file mode 100644 index 98ca5fdc826..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/IndexViewsStep.java +++ /dev/null @@ -1,43 +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.server.computation.step; - -import org.sonar.server.computation.ComputationContext; -import org.sonar.server.view.index.ViewIndexer; - -public class IndexViewsStep implements ComputationStep { - - private final ViewIndexer indexer; - - public IndexViewsStep(ViewIndexer indexer) { - this.indexer = indexer; - } - - @Override - public void execute(ComputationContext context) { - indexer.index(context.getProject().uuid()); - } - - @Override - public String getDescription() { - return "Index views"; - } -} diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepsTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepsTest.java index a69c7786473..dad2e0562e8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputationStepsTest.java @@ -35,7 +35,6 @@ public class ComputationStepsTest { mock(ApplyPermissionsStep.class), mock(ParseReportStep.class), mock(IndexSourceLinesStep.class), - mock(IndexViewsStep.class), mock(PersistIssuesStep.class), mock(IndexIssuesStep.class), mock(SwitchSnapshotStep.class), @@ -52,9 +51,9 @@ public class ComputationStepsTest { mock(IndexTestsStep.class) ); - assertThat(registry.orderedSteps()).hasSize(18); + assertThat(registry.orderedSteps()).hasSize(17); assertThat(registry.orderedSteps().get(0)).isInstanceOf(ParseReportStep.class); - assertThat(registry.orderedSteps().get(17)).isInstanceOf(SendIssueNotificationsStep.class); + assertThat(registry.orderedSteps().get(16)).isInstanceOf(SendIssueNotificationsStep.class); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexViewsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexViewsStepTest.java deleted file mode 100644 index d2d8b2b4049..00000000000 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexViewsStepTest.java +++ /dev/null @@ -1,50 +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.server.computation.step; - -import org.junit.Test; -import org.sonar.api.resources.Qualifiers; -import org.sonar.server.component.ComponentTesting; -import org.sonar.server.computation.ComputationContext; -import org.sonar.server.view.index.ViewIndexer; - -import static org.mockito.Mockito.*; - -public class IndexViewsStepTest extends BaseStepTest { - - ComputationContext context = mock(ComputationContext.class); - ViewIndexer indexer = mock(ViewIndexer.class); - IndexViewsStep sut = new IndexViewsStep(indexer); - - @Test - public void index_views() { - when(context.getProject()).thenReturn(ComponentTesting.newProjectDto("ABCD").setQualifier(Qualifiers.VIEW)); - - sut.execute(context); - - verify(indexer).index("ABCD"); - } - - @Override - protected ComputationStep step() { - return sut; - } -} -- 2.39.5