aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine
diff options
context:
space:
mode:
authorTobias Stadler <ts.stadler@gmx.de>2020-07-25 22:02:39 +0200
committersonartech <sonartech@sonarsource.com>2021-06-18 20:03:41 +0000
commit7b3853ad9c32b823ea3a70023e462b6b813e1a22 (patch)
treef872543b045ac5bec36d391651927e50e889de35 /sonar-scanner-engine
parente451875e4ba85ae989a5f1a84ca4f9e5de465431 (diff)
downloadsonarqube-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.java16
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();