From 7515f738fb15473d144dd376fac2a1562486c049 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 27 Jul 2017 09:12:49 +0200 Subject: SONAR-9616 compute engine backend to support branches --- .../test/java/org/sonar/scanner/report/MetadataPublisherTest.java | 5 +++-- .../test/java/org/sonar/scanner/report/ReportPublisherTest.java | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'sonar-scanner-engine/src/test/java/org/sonar/scanner/report') diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java index a949364d429..3a4051ece54 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java @@ -34,6 +34,7 @@ import org.sonar.api.batch.fs.internal.DefaultInputModule; import org.sonar.api.batch.fs.internal.InputModuleHierarchy; import org.sonar.api.batch.fs.internal.TestInputFileBuilder; import org.sonar.api.config.internal.MapSettings; +import org.sonar.core.config.ScannerProperties; import org.sonar.scanner.ProjectAnalysisInfo; import org.sonar.scanner.bootstrap.ScannerPlugin; import org.sonar.scanner.bootstrap.ScannerPluginRepository; @@ -141,13 +142,13 @@ public class MetadataPublisherTest { ScannerReport.Metadata metadata = reader.readMetadata(); assertThat(metadata.getAnalysisDate()).isEqualTo(1234567L); assertThat(metadata.getProjectKey()).isEqualTo("foo"); - assertThat(metadata.getBranch()).isEqualTo("myBranch"); + assertThat(metadata.getDeprecatedBranch()).isEqualTo("myBranch"); assertThat(metadata.getCrossProjectDuplicationActivated()).isFalse(); } @Test public void write_project_organization() throws Exception { - settings.setProperty(CoreProperties.PROJECT_ORGANIZATION_PROPERTY, "SonarSource"); + settings.setProperty(ScannerProperties.ORGANIZATION, "SonarSource"); File outputDir = temp.newFolder(); ScannerReportWriter writer = new ScannerReportWriter(outputDir); diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java index ae65b6d01b7..9138d06f8c4 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java @@ -32,7 +32,6 @@ import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; -import org.sonar.api.CoreProperties; import org.sonar.api.batch.bootstrap.ProjectDefinition; import org.sonar.api.batch.fs.internal.DefaultInputModule; import org.sonar.api.batch.fs.internal.InputModuleHierarchy; @@ -44,6 +43,7 @@ import org.sonar.api.utils.TempFolder; import org.sonar.api.utils.log.LogTester; import org.sonar.api.utils.log.LoggerLevel; import org.sonar.core.config.CorePropertyDefinitions; +import org.sonar.core.config.ScannerProperties; import org.sonar.scanner.analysis.DefaultAnalysisMode; import org.sonar.scanner.bootstrap.ScannerWsClient; import org.sonarqube.ws.WsCe; @@ -91,7 +91,7 @@ public class ReportPublisherTest { public void log_and_dump_information_about_report_uploading() throws IOException { ReportPublisher underTest = new ReportPublisher(settings.asConfig(), wsClient, server, contextPublisher, moduleHierarchy, mode, mock(TempFolder.class), new ReportPublisherStep[0]); - settings.setProperty(CoreProperties.PROJECT_ORGANIZATION_PROPERTY, "MyOrg"); + settings.setProperty(ScannerProperties.ORGANIZATION, "MyOrg"); underTest.logSuccess("TASK-123"); @@ -202,7 +202,7 @@ public class ReportPublisherTest { ReportPublisher underTest = new ReportPublisher(settings.asConfig(), wsClient, server, contextPublisher, moduleHierarchy, mode, mock(TempFolder.class), new ReportPublisherStep[0]); - settings.setProperty(CoreProperties.PROJECT_ORGANIZATION_PROPERTY, "MyOrg"); + settings.setProperty(ScannerProperties.ORGANIZATION, "MyOrg"); WsResponse response = mock(WsResponse.class); @@ -232,7 +232,7 @@ public class ReportPublisherTest { new ReportPublisherStep[0]); when(mode.isIncremental()).thenReturn(true); - settings.setProperty(CoreProperties.PROJECT_ORGANIZATION_PROPERTY, "MyOrg"); + settings.setProperty(ScannerProperties.ORGANIZATION, "MyOrg"); WsResponse response = mock(WsResponse.class); -- cgit v1.2.3