aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-ce-task-projectanalysis
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-09-12 17:25:05 +0200
committersonartech <sonartech@sonarsource.com>2018-10-10 09:23:03 +0200
commit1b417e030525caf7295ee7532c5eaae4a5fe109b (patch)
treed2f1453803e313a5641b4bba1f64c65f36d6b7a0 /server/sonar-ce-task-projectanalysis
parent489d04fd705754904fd8a293a3c5508e112a60d8 (diff)
downloadsonarqube-1b417e030525caf7295ee7532c5eaae4a5fe109b.tar.gz
sonarqube-1b417e030525caf7295ee7532c5eaae4a5fe109b.zip
SONAR-11238 move PersistFileSourcesStep to source package
Diffstat (limited to 'server/sonar-ce-task-projectanalysis')
-rw-r--r--server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/source/PersistFileSourcesStep.java (renamed from server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistFileSourcesStep.java)5
-rw-r--r--server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ReportComputationSteps.java1
-rw-r--r--server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/source/PersistFileSourcesStepTest.java (renamed from server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/PersistFileSourcesStepTest.java)32
3 files changed, 13 insertions, 25 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistFileSourcesStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/source/PersistFileSourcesStep.java
index 5931994dd01..cefa5bb4568 100644
--- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistFileSourcesStep.java
+++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/source/PersistFileSourcesStep.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.ce.task.projectanalysis.step;
+package org.sonar.ce.task.projectanalysis.source;
import com.google.common.collect.ImmutableMap;
import java.util.HashMap;
@@ -34,9 +34,6 @@ import org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawle
import org.sonar.ce.task.projectanalysis.component.TreeRootHolder;
import org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorAdapter;
import org.sonar.ce.task.projectanalysis.scm.Changeset;
-import org.sonar.ce.task.projectanalysis.source.FileSourceDataComputer;
-import org.sonar.ce.task.projectanalysis.source.FileSourceDataWarnings;
-import org.sonar.ce.task.projectanalysis.source.SourceLinesHashRepository;
import org.sonar.ce.task.step.ComputationStep;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ReportComputationSteps.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ReportComputationSteps.java
index 47b209e3589..36785903a8a 100644
--- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ReportComputationSteps.java
+++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/ReportComputationSteps.java
@@ -25,6 +25,7 @@ import org.sonar.ce.task.container.TaskContainer;
import org.sonar.ce.task.projectanalysis.filemove.FileMoveDetectionStep;
import org.sonar.ce.task.projectanalysis.measure.PostMeasuresComputationChecksStep;
import org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep;
+import org.sonar.ce.task.projectanalysis.source.PersistFileSourcesStep;
import org.sonar.ce.task.step.ComputationStep;
import org.sonar.ce.task.step.ExecuteStatelessInitExtensionsStep;
diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/PersistFileSourcesStepTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/source/PersistFileSourcesStepTest.java
index a95d5774636..2d5be9616fb 100644
--- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/PersistFileSourcesStepTest.java
+++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/source/PersistFileSourcesStepTest.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.ce.task.projectanalysis.step;
+package org.sonar.ce.task.projectanalysis.source;
import java.util.Arrays;
import java.util.Collections;
@@ -35,11 +35,7 @@ import org.sonar.ce.task.projectanalysis.component.FileAttributes;
import org.sonar.ce.task.projectanalysis.component.ReportComponent;
import org.sonar.ce.task.projectanalysis.component.TreeRootHolderRule;
import org.sonar.ce.task.projectanalysis.scm.Changeset;
-import org.sonar.ce.task.projectanalysis.source.FileSourceDataComputer;
-import org.sonar.ce.task.projectanalysis.source.FileSourceDataWarnings;
-import org.sonar.ce.task.projectanalysis.source.SourceLinesHashRepository;
-import org.sonar.ce.task.projectanalysis.source.SourceLinesHashRepositoryImpl;
-import org.sonar.ce.task.projectanalysis.source.linereader.LineReader;
+import org.sonar.ce.task.projectanalysis.step.BaseStepTest;
import org.sonar.ce.task.step.ComputationStep;
import org.sonar.ce.task.step.TestComputationStepContext;
import org.sonar.db.DbClient;
@@ -49,16 +45,11 @@ import org.sonar.db.protobuf.DbFileSources;
import org.sonar.db.source.FileSourceDto;
import org.sonar.db.source.FileSourceDto.Type;
import org.sonar.db.source.LineHashVersion;
-import org.sonar.scanner.protocol.output.ScannerReport;
-import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.sonar.ce.task.projectanalysis.source.linereader.LineReader.Data.HIGHLIGHTING;
-import static org.sonar.ce.task.projectanalysis.source.linereader.LineReader.Data.SYMBOLS;
public class PersistFileSourcesStepTest extends BaseStepTest {
@@ -108,8 +99,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
DbFileSources.Data fileSourceData = DbFileSources.Data.newBuilder()
.addAllLines(Arrays.asList(
DbFileSources.Line.newBuilder().setSource("line1").setLine(1).build(),
- DbFileSources.Line.newBuilder().setSource("line2").setLine(2).build()
- ))
+ DbFileSources.Line.newBuilder().setSource("line2").setLine(2).build()))
.build();
when(fileSourceDataComputer.compute(fileComponent(), fileSourceDataWarnings)).thenReturn(new FileSourceDataComputer.Data(fileSourceData, lineHashes, sourceHash, null));
@@ -206,8 +196,8 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
.setScmDate(223456789L)
.build(),
DbFileSources.Line.newBuilder()
- .build()
- )).build();
+ .build()))
+ .build();
setComputedData(dbData);
underTest.execute(new TestComputationStepContext());
@@ -238,8 +228,8 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
DbFileSources.Data dbData = DbFileSources.Data.newBuilder().addLines(
DbFileSources.Line.newBuilder()
.setHighlighting("2,4,a")
- .build()
- ).build();
+ .build())
+ .build();
setComputedData(dbData);
underTest.execute(new TestComputationStepContext());
@@ -262,8 +252,8 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
DbFileSources.Line.newBuilder().build(),
DbFileSources.Line.newBuilder()
.setSymbols("1,3,1")
- .build()
- )).build();
+ .build()))
+ .build();
setComputedData(dbData);
underTest.execute(new TestComputationStepContext());
@@ -279,8 +269,8 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
DbFileSources.Data dbData = DbFileSources.Data.newBuilder().addLines(
DbFileSources.Line.newBuilder()
.addDuplication(2)
- .build()
- ).build();
+ .build())
+ .build();
setComputedData(dbData);
underTest.execute(new TestComputationStepContext());