diff options
author | Janos Gyerik <janos.gyerik@sonarsource.com> | 2017-10-11 16:51:21 +0200 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2017-10-12 09:56:30 +0200 |
commit | e146d1732e5b3671aa56e9fc32e9149345aea403 (patch) | |
tree | 7baa930d04a6de3a5589254334b0eceb73222a59 /sonar-scanner-engine/src/test | |
parent | e9e277c47db4fd089cbcbeb6b533a3a808bed641 (diff) | |
download | sonarqube-e146d1732e5b3671aa56e9fc32e9149345aea403.tar.gz sonarqube-e146d1732e5b3671aa56e9fc32e9149345aea403.zip |
Revert "SONAR-9757 Copy issues in directories with unchanged files only"
This reverts commit aa5537ba9748dd4f3f9c876064ff6a6e641cba3e.
Diffstat (limited to 'sonar-scanner-engine/src/test')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ComponentsPublisherTest.java | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ComponentsPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ComponentsPublisherTest.java index 00c496be9ab..1f017e7ada9 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ComponentsPublisherTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ComponentsPublisherTest.java @@ -289,54 +289,6 @@ public class ComponentsPublisherTest { } @Test - public void should_set_directory_status() throws IOException { - ProjectAnalysisInfo projectAnalysisInfo = mock(ProjectAnalysisInfo.class); - when(projectAnalysisInfo.analysisDate()).thenReturn(DateUtils.parseDate("2012-12-12")); - - ProjectDefinition rootDef = ProjectDefinition.create() - .setKey("foo") - .setProperty(CoreProperties.PROJECT_VERSION_PROPERTY, "1.0") - .setName("Root project") - .setDescription("Root description") - .setBaseDir(temp.newFolder()) - .setWorkDir(temp.newFolder()); - DefaultInputModule root = new DefaultInputModule(rootDef, 1); - - moduleHierarchy = mock(InputModuleHierarchy.class); - when(moduleHierarchy.root()).thenReturn(root); - when(moduleHierarchy.children(root)).thenReturn(Collections.emptyList()); - - // dir with unchanged files - DefaultInputDir dir = new DefaultInputDir("module1", "src", 2); - tree.index(dir, root); - - // dir with changed files - DefaultInputDir dir2 = new DefaultInputDir("module1", "src2", 3); - tree.index(dir2, root); - - DefaultInputFile file = new TestInputFileBuilder("module1", "src/Foo.java", 4).setLines(2).setStatus(InputFile.Status.SAME).build(); - tree.index(file, dir); - - DefaultInputFile file2 = new TestInputFileBuilder("module1", "src/Foo.java", 5).setLines(2).setStatus(InputFile.Status.ADDED).build(); - tree.index(file2, dir2); - - ComponentsPublisher publisher = new ComponentsPublisher(moduleHierarchy, tree, branchConfiguration); - publisher.publish(writer); - - assertThat(writer.hasComponentData(FileStructure.Domain.COMPONENT, 1)).isTrue(); - assertThat(writer.hasComponentData(FileStructure.Domain.COMPONENT, 2)).isTrue(); - assertThat(writer.hasComponentData(FileStructure.Domain.COMPONENT, 3)).isTrue(); - assertThat(writer.hasComponentData(FileStructure.Domain.COMPONENT, 4)).isTrue(); - assertThat(writer.hasComponentData(FileStructure.Domain.COMPONENT, 5)).isTrue(); - - // directory is unchanged because its files are unchanged - assertThat(reader.readComponent(2).getStatus()).isEqualTo(FileStatus.SAME); - // status not set - assertThat(reader.readComponent(3).getStatus()).isEqualTo(FileStatus.UNAVAILABLE); - - } - - @Test public void skip_unchanged_components_in_short_branches() throws IOException { when(branchConfiguration.isShortLivingBranch()).thenReturn(true); ProjectAnalysisInfo projectAnalysisInfo = mock(ProjectAnalysisInfo.class); |