diff options
author | Michal Duda <michal.duda@sonarsource.com> | 2020-09-11 14:30:31 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-09-29 20:07:41 +0000 |
commit | 8a94f2ffc23369e675fceb34c03c98e1535d49d6 (patch) | |
tree | c5eb21cccc85b7d73af13e201387e52d51659156 /sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd | |
parent | 4b3d914bf578d1eb88fc9ca79efef00843511865 (diff) | |
download | sonarqube-8a94f2ffc23369e675fceb34c03c98e1535d49d6.tar.gz sonarqube-8a94f2ffc23369e675fceb34c03c98e1535d49d6.zip |
SONAR-13867 Collect number of indexed C/C++ files in the scanner
Diffstat (limited to 'sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/CpdExecutorTest.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/CpdExecutorTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/CpdExecutorTest.java index 7598a64e485..f8614ce4fcc 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/CpdExecutorTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/CpdExecutorTest.java @@ -36,6 +36,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.mockito.ArgumentMatchers; +import org.sonar.api.SonarRuntime; import org.sonar.api.utils.log.LogTester; import org.sonar.api.utils.log.LoggerLevel; import org.sonar.core.util.CloseableIterator; @@ -72,10 +73,11 @@ public class CpdExecutorTest { public ExpectedException thrown = ExpectedException.none(); private CpdExecutor executor; - private ExecutorService executorService = mock(ExecutorService.class); - private CpdSettings settings = mock(CpdSettings.class); - private ReportPublisher publisher = mock(ReportPublisher.class); - private SonarCpdBlockIndex index = new SonarCpdBlockIndex(publisher, settings); + private final ExecutorService executorService = mock(ExecutorService.class); + private final CpdSettings settings = mock(CpdSettings.class); + private final ReportPublisher publisher = mock(ReportPublisher.class); + private final SonarRuntime sonarRuntime = mock(SonarRuntime.class); + private final SonarCpdBlockIndex index = new SonarCpdBlockIndex(publisher, settings); private ScannerReportReader reader; private DefaultInputFile batchComponent1; private DefaultInputFile batchComponent2; @@ -90,7 +92,7 @@ public class CpdExecutorTest { when(publisher.getWriter()).thenReturn(new ScannerReportWriter(outputDir)); DefaultInputProject project = TestInputFileBuilder.newDefaultInputProject("foo", baseDir); - componentStore = new InputComponentStore(mock(BranchConfiguration.class)); + componentStore = new InputComponentStore(mock(BranchConfiguration.class), sonarRuntime); executor = new CpdExecutor(settings, index, publisher, componentStore, executorService); reader = new ScannerReportReader(outputDir); |