aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObserver.java (renamed from sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/ScanTaskObserver.java)4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObservers.java (renamed from sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/ScanTaskObservers.java)14
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisResult.java (renamed from sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/TaskResult.java)17
3 files changed, 17 insertions, 18 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/ScanTaskObserver.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObserver.java
index f5f7ba46617..59ce0f1422f 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/ScanTaskObserver.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObserver.java
@@ -26,8 +26,8 @@ import org.sonar.scanner.scan.ProjectScanContainer;
@ScannerSide
@ExtensionPoint
@FunctionalInterface
-public interface ScanTaskObserver {
+public interface AnalysisObserver {
- void scanTaskCompleted(ProjectScanContainer container);
+ void analysisCompleted(ProjectScanContainer container);
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/ScanTaskObservers.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObservers.java
index a950300d5d4..d6d229a482e 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/ScanTaskObservers.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObservers.java
@@ -21,23 +21,23 @@ package org.sonar.scanner.mediumtest;
import org.sonar.scanner.scan.ProjectScanContainer;
-public class ScanTaskObservers {
+public class AnalysisObservers {
- private ScanTaskObserver[] observers;
+ private AnalysisObserver[] observers;
private ProjectScanContainer projectScanContainer;
- public ScanTaskObservers(ProjectScanContainer projectScanContainer, ScanTaskObserver... observers) {
+ public AnalysisObservers(ProjectScanContainer projectScanContainer, AnalysisObserver... observers) {
this.projectScanContainer = projectScanContainer;
this.observers = observers;
}
- public ScanTaskObservers(ProjectScanContainer projectScanContainer) {
- this(projectScanContainer, new ScanTaskObserver[0]);
+ public AnalysisObservers(ProjectScanContainer projectScanContainer) {
+ this(projectScanContainer, new AnalysisObserver[0]);
}
public void notifyEndOfScanTask() {
- for (ScanTaskObserver scanTaskObserver : observers) {
- scanTaskObserver.scanTaskCompleted(projectScanContainer);
+ for (AnalysisObserver analysisObserver : observers) {
+ analysisObserver.analysisCompleted(projectScanContainer);
}
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/TaskResult.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisResult.java
index d2ea9681433..4c2cff60a32 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/TaskResult.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisResult.java
@@ -36,11 +36,11 @@ import org.sonar.api.batch.AnalysisMode;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.fs.InputDir;
import org.sonar.api.batch.fs.InputFile;
-import org.sonar.api.batch.fs.InputModule;
import org.sonar.api.batch.fs.TextPointer;
import org.sonar.api.batch.fs.TextRange;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.sensor.highlighting.TypeOfText;
+import org.sonar.api.scanner.fs.InputProject;
import org.sonar.core.util.CloseableIterator;
import org.sonar.scanner.issue.IssueCache;
import org.sonar.scanner.issue.tracking.TrackedIssue;
@@ -56,19 +56,19 @@ import org.sonar.scanner.scan.filesystem.InputComponentStore;
import static org.apache.commons.lang.StringUtils.isNotEmpty;
-public class TaskResult implements org.sonar.scanner.mediumtest.ScanTaskObserver {
+public class AnalysisResult implements AnalysisObserver {
- private static final Logger LOG = LoggerFactory.getLogger(TaskResult.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AnalysisResult.class);
private List<TrackedIssue> issues = new ArrayList<>();
private Map<String, InputFile> inputFiles = new HashMap<>();
private Map<String, Component> reportComponents = new HashMap<>();
private Map<String, InputDir> inputDirs = new HashMap<>();
- private InputModule root;
+ private InputProject project;
private ScannerReportReader reader;
@Override
- public void scanTaskCompleted(ProjectScanContainer container) {
+ public void analysisCompleted(ProjectScanContainer container) {
LOG.info("Store analysis results in memory for later assertions in medium test");
for (TrackedIssue issue : container.getComponentByType(IssueCache.class).all()) {
issues.add(issue);
@@ -80,8 +80,7 @@ public class TaskResult implements org.sonar.scanner.mediumtest.ScanTaskObserver
Metadata readMetadata = getReportReader().readMetadata();
int rootComponentRef = readMetadata.getRootComponentRef();
storeReportComponents(rootComponentRef, null);
- InputComponentStore inputFileCache = container.getComponentByType(InputComponentStore.class);
- root = inputFileCache.root();
+ project = container.getComponentByType(InputProject.class);
}
storeFs(container);
@@ -158,8 +157,8 @@ public class TaskResult implements org.sonar.scanner.mediumtest.ScanTaskObserver
return result;
}
- public InputModule root() {
- return root;
+ public InputProject project() {
+ return project;
}
public Collection<InputFile> inputFiles() {