diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2014-10-28 14:00:19 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2014-10-28 16:24:58 +0100 |
commit | 57a783af79cf8c0444f08e8f08f282a5e706976f (patch) | |
tree | f44bef55f4958b7cbca73b5022f2de8a715ab291 /server/sonar-server | |
parent | 4fec3d9d21f94ddfb2cfaa4497b130b1810b46e3 (diff) | |
download | sonarqube-57a783af79cf8c0444f08e8f08f282a5e706976f.tar.gz sonarqube-57a783af79cf8c0444f08e8f08f282a5e706976f.zip |
Compute Engine - commit at each step and delete unimplemented test
Diffstat (limited to 'server/sonar-server')
3 files changed, 3 insertions, 15 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationService.java b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationService.java index be2499e31a3..b13bd049ee7 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/ComputationService.java @@ -52,6 +52,7 @@ public class ComputationService implements ServerComponent { for (ComputationStep step : stepRegistry.steps()) { LOG.info(String.format("# %s step started...", step.description())); step.execute(session, report); + session.commit(); LOG.info(String.format("# %s step finished", step.description())); } } finally { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java index 9a99ec197fb..991f2a240e4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java @@ -40,8 +40,9 @@ public class ComputationServiceTest { @Before public void before() { - this.dbClient = mock(DbClient.class); this.stepRegistry = mock(ComputationStepRegistry.class); + this.dbClient = mock(DbClient.class); + when(dbClient.openSession(anyBoolean())).thenReturn(mock(DbSession.class)); this.sut = new ComputationService(dbClient, stepRegistry); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/SynchronizeProjectPermissionsStepMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/SynchronizeProjectPermissionsStepMediumTest.java index a4f08f5692c..c248b93e786 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/SynchronizeProjectPermissionsStepMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/SynchronizeProjectPermissionsStepMediumTest.java @@ -109,18 +109,4 @@ public class SynchronizeProjectPermissionsStepMediumTest { return project; } - - @Test - public void do_nothing_when_permissions_are_already_set() throws Exception { - ComponentDto project = insertPermissionsForProject(DEFAULT_PROJECT_KEY); - - queue.add(DEFAULT_PROJECT_KEY, 123L); - List<AnalysisReportDto> reports = queue.findByProjectKey(DEFAULT_PROJECT_KEY); - getAndSetProjectStep.execute(session, reports.get(0)); - - sut.execute(session, reports.get(0)); - - IssueAuthorizationDoc issueAuthorizationIndex = tester.get(IssueAuthorizationIndex.class).getNullableByKey(project.uuid()); - assertThat(issueAuthorizationIndex).isNotNull(); - } } |