diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-09-21 16:09:18 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-09-22 17:05:11 +0200 |
commit | 129962bb39832f0312884c9d2bb4c61dd77111e3 (patch) | |
tree | 07cfc625b0f3c2f1ca42f7314c8af4e7876997a0 /server/sonar-server-benchmarks | |
parent | 9b9827ed18a6d3d379c20279c002bd311d53dc06 (diff) | |
download | sonarqube-129962bb39832f0312884c9d2bb4c61dd77111e3.tar.gz sonarqube-129962bb39832f0312884c9d2bb4c61dd77111e3.zip |
SONAR-6843 Read source lines db when nothing in report
Diffstat (limited to 'server/sonar-server-benchmarks')
-rw-r--r-- | server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java index eadde392bb5..c8d5df53746 100644 --- a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java +++ b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java @@ -31,19 +31,19 @@ import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.utils.System2; -import org.sonar.core.util.Uuids; import org.sonar.batch.protocol.Constants; import org.sonar.batch.protocol.output.BatchReport; import org.sonar.batch.protocol.output.BatchReportWriter; +import org.sonar.core.util.Uuids; +import org.sonar.db.DbClient; import org.sonar.db.DbTester; -import org.sonar.db.source.FileSourceDao; import org.sonar.server.computation.batch.BatchReportDirectoryHolderImpl; import org.sonar.server.computation.batch.BatchReportReaderImpl; import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.ReportComponent; +import org.sonar.server.computation.source.SourceLinesRepositoryImpl; import org.sonar.server.computation.step.PersistFileSourcesStep; -import org.sonar.server.db.DbClient; import static org.assertj.core.api.Assertions.assertThat; @@ -75,13 +75,15 @@ public class PersistFileSourcesStepTest { private void persistFileSources(File reportDir) { LOGGER.info("Persist file sources"); - DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new FileSourceDao(dbTester.myBatis())); + DbClient dbClient = dbTester.getDbClient(); long start = System.currentTimeMillis(); BatchReportDirectoryHolderImpl batchReportDirectoryHolder = new BatchReportDirectoryHolderImpl(); batchReportDirectoryHolder.setDirectory(reportDir); - PersistFileSourcesStep step = new PersistFileSourcesStep(dbClient, System2.INSTANCE, treeRootHolder, new BatchReportReaderImpl(batchReportDirectoryHolder)); + org.sonar.server.computation.batch.BatchReportReader batchReportReader = new BatchReportReaderImpl(batchReportDirectoryHolder); + PersistFileSourcesStep step = new PersistFileSourcesStep(dbClient, System2.INSTANCE, treeRootHolder, batchReportReader, + new SourceLinesRepositoryImpl(dbClient, batchReportReader)); step.execute(); long end = System.currentTimeMillis(); |