diff options
author | Tobias Stadler <ts.stadler@gmx.de> | 2020-07-25 22:02:39 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-06-18 20:03:41 +0000 |
commit | 7b3853ad9c32b823ea3a70023e462b6b813e1a22 (patch) | |
tree | f872543b045ac5bec36d391651927e50e889de35 /sonar-scanner-engine | |
parent | e451875e4ba85ae989a5f1a84ca4f9e5de465431 (diff) | |
download | sonarqube-7b3853ad9c32b823ea3a70023e462b6b813e1a22.tar.gz sonarqube-7b3853ad9c32b823ea3a70023e462b6b813e1a22.zip |
SONAR-15056 It should be possible to create external issues with project location
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/issues/IssuesMediumTest.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/issues/IssuesMediumTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/issues/IssuesMediumTest.java index 5a584bd275d..176db54d632 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/issues/IssuesMediumTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/issues/IssuesMediumTest.java @@ -38,6 +38,7 @@ import org.sonar.scanner.protocol.output.ScannerReport.ExternalIssue; import org.sonar.scanner.protocol.output.ScannerReport.Issue; import org.sonar.xoo.XooPlugin; import org.sonar.xoo.rule.HasTagSensor; +import org.sonar.xoo.rule.OneExternalIssueOnProjectSensor; import org.sonar.xoo.rule.OneExternalIssuePerLineSensor; import org.sonar.xoo.rule.XooRulesDefinition; @@ -93,6 +94,21 @@ public class IssuesMediumTest { } @Test + public void testOneExternalIssueOnProject() throws Exception { + File projectDir = new File("test-resources/mediumtest/xoo/sample"); + File tmpDir = temp.newFolder(); + FileUtils.copyDirectory(projectDir, tmpDir); + + AnalysisResult result = tester + .newAnalysis(new File(tmpDir, "sonar-project.properties")) + .property(OneExternalIssueOnProjectSensor.ACTIVATE, "true") + .execute(); + + List<ExternalIssue> externalIssues = result.externalIssuesFor(result.project()); + assertThat(externalIssues).hasSize(1); + } + + @Test public void findActiveRuleByInternalKey() throws Exception { File projectDir = new File("test-resources/mediumtest/xoo/sample"); File tmpDir = temp.newFolder(); |