aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2018-10-22 10:06:52 +0200
committerSonarTech <sonartech@sonarsource.com>2018-11-07 20:21:03 +0100
commit7f59b2e51acb56b9d280fbeea4564194f3dd07cd (patch)
treec4ecd37498f71cf84ec1c0a29b341750448070dc /sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd
parentc7153cbc9057fa19651dba01c8d9c94ff5e1f4b2 (diff)
downloadsonarqube-7f59b2e51acb56b9d280fbeea4564194f3dd07cd.tar.gz
sonarqube-7f59b2e51acb56b9d280fbeea4564194f3dd07cd.zip
SONAR-11394 Calculate estimated overall duplication in SLB
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.java21
1 files changed, 1 insertions, 20 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 8acc34a63b3..30b257eb2f6 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,7 +36,6 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.TemporaryFolder;
import org.mockito.ArgumentMatchers;
-import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.fs.internal.DefaultInputModule;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
@@ -76,13 +75,11 @@ public class CpdExecutorTest {
private ExecutorService executorService = mock(ExecutorService.class);
private CpdSettings settings = mock(CpdSettings.class);
private ReportPublisher publisher = mock(ReportPublisher.class);
- private BranchConfiguration branchConfiguration = mock(BranchConfiguration.class);
private SonarCpdBlockIndex index = new SonarCpdBlockIndex(publisher, settings);
private ScannerReportReader reader;
private DefaultInputFile batchComponent1;
private DefaultInputFile batchComponent2;
private DefaultInputFile batchComponent3;
- private DefaultInputFile batchComponent4;
private File baseDir;
private InputComponentStore componentStore;
@@ -94,13 +91,12 @@ public class CpdExecutorTest {
DefaultInputModule inputModule = TestInputFileBuilder.newDefaultInputModule("foo", baseDir);
componentStore = new InputComponentStore(inputModule, mock(BranchConfiguration.class));
- executor = new CpdExecutor(settings, index, publisher, componentStore, branchConfiguration, executorService);
+ executor = new CpdExecutor(settings, index, publisher, componentStore, executorService);
reader = new ScannerReportReader(outputDir);
batchComponent1 = createComponent("src/Foo.php", 5);
batchComponent2 = createComponent("src/Foo2.php", 5);
batchComponent3 = createComponent("src/Foo3.php", 5);
- batchComponent4 = createComponent("src/Foo4.php", 5, f -> f.setStatus(InputFile.Status.SAME));
}
@Test
@@ -196,21 +192,6 @@ public class CpdExecutorTest {
}
@Test
- public void should_ignore_unmodified_files_in_SLB() {
- when(branchConfiguration.isShortOrPullRequest()).thenReturn(true);
- Block block = Block.builder()
- .setBlockHash(new ByteArray("AAAABBBBCCCC"))
- .setResourceId(batchComponent4.key())
- .build();
- index.insert(batchComponent4, Collections.singletonList(block));
- executor.execute();
-
- verify(executorService).shutdown();
- verifyNoMoreInteractions(executorService);
- readDuplications(batchComponent4, 0);
- }
-
- @Test
public void should_ignore_missing_component() {
Block block = Block.builder()
.setBlockHash(new ByteArray("AAAABBBBCCCC"))