aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-server-benchmarks')
-rw-r--r--server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java7
1 files changed, 6 insertions, 1 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 87ad097dbab..09520d5b788 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
@@ -37,6 +37,7 @@ 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.server.computation.analysis.MutableAnalysisMetadataHolderRule;
import org.sonar.server.computation.batch.BatchReportDirectoryHolderImpl;
import org.sonar.server.computation.batch.BatchReportReaderImpl;
import org.sonar.server.computation.batch.TreeRootHolderRule;
@@ -69,6 +70,9 @@ public class PersistFileSourcesStepTest {
@Rule
public TreeRootHolderRule treeRootHolder = new TreeRootHolderRule();
+ @Rule
+ public MutableAnalysisMetadataHolderRule analysisMetadataHolder = new MutableAnalysisMetadataHolderRule();
+
@Test
public void benchmark() throws Exception {
File reportDir = prepareReport();
@@ -85,7 +89,8 @@ public class PersistFileSourcesStepTest {
batchReportDirectoryHolder.setDirectory(reportDir);
org.sonar.server.computation.batch.BatchReportReader batchReportReader = new BatchReportReaderImpl(batchReportDirectoryHolder);
SourceService sourceService = new SourceService(dbClient, null);
- ScmInfoRepositoryImpl scmInfoRepository = new ScmInfoRepositoryImpl(batchReportReader, dbClient, sourceService);
+ analysisMetadataHolder.setIsFirstAnalysis(false);
+ ScmInfoRepositoryImpl scmInfoRepository = new ScmInfoRepositoryImpl(batchReportReader, analysisMetadataHolder, dbClient, sourceService);
PersistFileSourcesStep step = new PersistFileSourcesStep(dbClient, System2.INSTANCE, treeRootHolder, batchReportReader,
new SourceLinesRepositoryImpl(batchReportReader), scmInfoRepository);
step.execute();