From 65fc4953dbc9c2fb87550056a8d3c08a301e65b7 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Fri, 31 Oct 2014 15:21:44 +0100 Subject: [PATCH] SONAR-5795 Component indexation right before the data cleaner step --- ...tionStep.java => ComponentIndexationInDatabaseStep.java} | 4 ++-- .../sonar/server/computation/ComputationStepRegistry.java | 2 +- .../java/org/sonar/server/platform/ServerComponents.java | 2 +- ...Test.java => ComponentIndexationInDatabaseStepTest.java} | 6 +++--- .../computation/ComputationStepRegistryMediumTest.java | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) rename server/sonar-server/src/main/java/org/sonar/server/computation/{ProjectDatabaseIndexationStep.java => ComponentIndexationInDatabaseStep.java} (90%) rename server/sonar-server/src/test/java/org/sonar/server/computation/{ProjectDatabaseIndexationStepTest.java => ComponentIndexationInDatabaseStepTest.java} (90%) diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ProjectDatabaseIndexationStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ComponentIndexationInDatabaseStep.java similarity index 90% rename from server/sonar-server/src/main/java/org/sonar/server/computation/ProjectDatabaseIndexationStep.java rename to server/sonar-server/src/main/java/org/sonar/server/computation/ComponentIndexationInDatabaseStep.java index 7f2c5d33503..490dbf7f3b7 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ProjectDatabaseIndexationStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ComponentIndexationInDatabaseStep.java @@ -25,10 +25,10 @@ import org.sonar.core.computation.db.AnalysisReportDto; import org.sonar.core.persistence.DbSession; import org.sonar.core.resource.ResourceIndexerDao; -public class ProjectDatabaseIndexationStep implements ComputationStep { +public class ComponentIndexationInDatabaseStep implements ComputationStep { private final ResourceIndexerDao resourceIndexerDao; - public ProjectDatabaseIndexationStep(ResourceIndexerDao resourceIndexerDao) { + public ComponentIndexationInDatabaseStep(ResourceIndexerDao resourceIndexerDao) { this.resourceIndexerDao = resourceIndexerDao; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationStepRegistry.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationStepRegistry.java index f5140b19d25..00c4d985954 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationStepRegistry.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationStepRegistry.java @@ -41,8 +41,8 @@ public class ComputationStepRegistry implements ServerComponent { steps.add(pico.getComponentByType(SynchronizeProjectPermissionsStep.class)); steps.add(pico.getComponentByType(SwitchSnapshotStep.class)); steps.add(pico.getComponentByType(InvalidatePreviewCacheStep.class)); + steps.add(pico.getComponentByType(ComponentIndexationInDatabaseStep.class)); steps.add(pico.getComponentByType(DataCleanerStep.class)); - steps.add(pico.getComponentByType(ProjectDatabaseIndexationStep.class)); steps.add(pico.getComponentByType(IndexProjectIssuesStep.class)); return ImmutableList.copyOf(steps); diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java index 03132c8a74b..acca81fec93 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java @@ -598,7 +598,7 @@ class ServerComponents { IndexProjectIssuesStep.class, SwitchSnapshotStep.class, InvalidatePreviewCacheStep.class, - ProjectDatabaseIndexationStep.class, + ComponentIndexationInDatabaseStep.class, DataCleanerStep.class)); pico.addSingleton(AnalysisReportQueue.class); pico.addSingleton(AnalysisReportTaskLauncher.class); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ProjectDatabaseIndexationStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ComponentIndexationInDatabaseStepTest.java similarity index 90% rename from server/sonar-server/src/test/java/org/sonar/server/computation/ProjectDatabaseIndexationStepTest.java rename to server/sonar-server/src/test/java/org/sonar/server/computation/ComponentIndexationInDatabaseStepTest.java index fdc9a57d55b..ef5167dc41d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ProjectDatabaseIndexationStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ComponentIndexationInDatabaseStepTest.java @@ -29,15 +29,15 @@ import org.sonar.core.resource.ResourceIndexerDao; import static org.mockito.Mockito.*; -public class ProjectDatabaseIndexationStepTest { +public class ComponentIndexationInDatabaseStepTest { - private ProjectDatabaseIndexationStep sut; + private ComponentIndexationInDatabaseStep sut; private ResourceIndexerDao resourceIndexerDao; @Before public void before() { this.resourceIndexerDao = mock(ResourceIndexerDao.class); - this.sut = new ProjectDatabaseIndexationStep(resourceIndexerDao); + this.sut = new ComponentIndexationInDatabaseStep(resourceIndexerDao); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationStepRegistryMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationStepRegistryMediumTest.java index cdf59656cc9..e059c099fbf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationStepRegistryMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationStepRegistryMediumTest.java @@ -48,7 +48,7 @@ public class ComputationStepRegistryMediumTest { pico.addSingleton(mock(SwitchSnapshotStep.class)); pico.addSingleton(mock(DataCleanerStep.class)); pico.addSingleton(mock(InvalidatePreviewCacheStep.class)); - pico.addSingleton(mock(ProjectDatabaseIndexationStep.class)); + pico.addSingleton(mock(ComponentIndexationInDatabaseStep.class)); sut = new ComputationStepRegistry(pico); } @@ -59,8 +59,8 @@ public class ComputationStepRegistryMediumTest { SynchronizeProjectPermissionsStep.class, SwitchSnapshotStep.class, InvalidatePreviewCacheStep.class, + ComponentIndexationInDatabaseStep.class, DataCleanerStep.class, - ProjectDatabaseIndexationStep.class, IndexProjectIssuesStep.class ); List steps = sut.steps(); -- 2.39.5